@Before
 public void beforeDemoExampleTest() {
   customerPortalExample.navigateTo();
   driver.manage().deleteAllCookies();
   productPortalExample.navigateTo();
   driver.manage().deleteAllCookies();
 }
  @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"));
  }
  @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"));
  }
  @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();
  }