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

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

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

    assertCurrentUrlStartsWith(productPortalExample);
    productPortalExample.waitForProductListingHeader();
    productPortalExample.goToCustomers();

    assertCurrentUrlStartsWith(customerPortalExample);
    customerPortalExample.customerListing();
    customerPortalExample.goToProducts();
    assertCurrentUrlStartsWith(productPortalExample);
  }
  @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();
  }