コード例 #1
0
 @Before
 public void beforeDemoExampleTest() {
   customerPortalExample.navigateTo();
   driver.manage().deleteAllCookies();
   productPortalExample.navigateTo();
   driver.manage().deleteAllCookies();
 }
コード例 #2
0
  @Test
  public void customerPortalSessionTest() {

    customerPortalExample.navigateTo();
    customerPortalExample.customerSession();

    testRealmLoginPage.form().login("*****@*****.**", "password");

    assertCurrentUrlStartsWith(customerPortalExample);

    customerPortalExample.waitForCustomerSessionHeader();
    Assert.assertTrue(driver.getPageSource().contains("You visited this page"));
  }
コード例 #3
0
  @Test
  public void customerPortalListingTest() {

    customerPortalExample.navigateTo();
    customerPortalExample.customerListing();

    testRealmLoginPage.form().login("*****@*****.**", "password");

    assertCurrentUrlStartsWith(customerPortalExample);
    customerPortalExample.waitForCustomerListingHeader();

    Assert.assertTrue(driver.getPageSource().contains("Username: [email protected]"));
    Assert.assertTrue(driver.getPageSource().contains("Bill Burke"));
    Assert.assertTrue(driver.getPageSource().contains("Stian Thorgersen"));
  }
コード例 #4
0
  @Test
  public void logoutFromAllAppsTest() {

    productPortalExample.navigateTo();
    productPortalExample.productListing();

    testRealmLoginPage.form().login("*****@*****.**", "password");

    assertCurrentUrlStartsWith(productPortalExample);
    productPortalExample.waitForProductListingHeader();

    productPortalExample.logOut();
    assertCurrentUrlStartsWith(productPortalExample);
    productPortalExample.productListing();

    customerPortalExample.navigateTo();
    customerPortalExample.customerListing();
    testRealmLoginPage.form().login("*****@*****.**", "password");

    customerPortalExample.logOut();
  }