Ejemplo n.º 1
0
 @Before
 public void setUp() throws Exception {
   super.setUp();
   selenium = getDefaultSeleniumFlex();
   logger.log(Level.INFO, "Starting selenium browser");
   selenium.start();
 }
Ejemplo n.º 2
0
  @Test
  public void testLogin() {
    try {
      logger.log(Level.INFO, "Starting to interact with the browser");
      selenium.open(baseURL);

      selenium.waitForPageToLoad("10000");
      Thread.sleep(3000);
      // login
      selenium.flexSetFocus("email");
      selenium.flexType("email", "*****@*****.**");

      selenium.flexSetFocus("password");
      selenium.flexType("password", "admin");

      selenium.flexCheckBox("rememberMe", "true");
      selenium.flexClick("loginBtn");
      selenium.flexWaitForElement("addBannerB");

      // adding banner
      selenium.flexClick("addBannerB");

      selenium.flexSetFocus("bannerNameTI");
      selenium.flexType("bannerNameTI", "banner test name");

      selenium.flexSetFocus("adFormat");
      selenium.flexSelectIndex("adFormat", "10");

      selenium.flexSetFocus("targetURLTI");
      selenium.flexType("targetURLTI", "http://www.agentpress.com");

      selenium.flexSetFocus("bannerFileTI");
      selenium.flexType(
          "bannerFileTI",
          "/opt/checkout/myads/server/src/web/images/sample_banners/250x250_agent_press.jpg");

      selenium.flexClick("saveBtn");
      selenium.flexWaitForElement("bannerNameTI");
      Thread.sleep(3000);

      selenium.executeCommand("verifyFlexProperty", "bannerNameTI.text", "banner test name");

      Thread.sleep(3000);

    } catch (Exception e) {
      System.err.println("\nTest FAILED (" + e.getMessage() + ")");
      throw new AssertionFailedError();
    }
  }
Ejemplo n.º 3
0
 @After
 public void tearDown() throws Exception {
   selenium.stop();
   super.tearDown();
 }