/** * @param driver the web driver to use for the test * @param wait the implicit wait value for this run * @param waiter handles driver specific waits * @return always returns true */ private boolean mothersNavigationExercise( final WebDriver driver, final long wait, final PageWaiter waiter) { try { driver.manage().timeouts().implicitlyWait(wait, TimeUnit.SECONDS); // Melissa PersonPage currentPerson = new PersonPage(driver, "I11", null, waiter); currentPerson.open(); assertEquals("Person ID mismatch", "I11", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Lisa currentPerson = currentPerson.navigateMother(); assertEquals("Person ID mismatch", "I33", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Estelle currentPerson = currentPerson.navigateMother(); assertEquals("Person ID mismatch", "I117", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); } finally { // Close the browser driver.quit(); } return true; }
/** * @param driver the web driver to use for the test * @param wait the implicit wait value for this run * @param waiter handles driver specific waits * @return always returns true */ private boolean fathersNavigationExercise( final WebDriver driver, final long wait, final PageWaiter waiter) { try { driver.manage().timeouts().implicitlyWait(wait, TimeUnit.SECONDS); // Grandpop PersonPage currentPerson = new PersonPage(driver, "I11", null, waiter); currentPerson.open(); assertEquals("Person ID mismatch", "I11", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Fred currentPerson = currentPerson.navigateFather(); assertEquals("Person ID mismatch", "I32", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); final SourcePage currentSource = new SourcePage(driver, "S21", currentPerson, waiter); assertTrue("Title mismatch", currentSource.titleCheck()); currentPerson = currentSource.back(); assertEquals("Person ID mismatch", "I32", currentPerson.getId()); // Johannes currentPerson = currentPerson.navigateFather(); assertEquals("Person ID mismatch", "I99", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Matthias currentPerson = currentPerson.navigateFather(); assertEquals("Person ID mismatch", "I180", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); } finally { // Close the browser driver.quit(); } return true; }
/** * @param driver the web driver to use for the test * @param wait the implicit wait value for this run * @param waiter handles driver specific waits * @return always returns true */ private boolean childNavigationExercise( final WebDriver driver, final long wait, final PageWaiter waiter) { try { driver.manage().timeouts().implicitlyWait(wait, TimeUnit.SECONDS); // Matthias PersonPage currentPerson = new PersonPage(driver, "I180", null, waiter); currentPerson.open(); assertEquals("Person ID mismatch", "I180", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Johann Martin currentPerson = currentPerson.navigateChild(1, 1); assertEquals("Person ID mismatch", "I3554", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Anna Maria currentPerson = currentPerson.navigateChild(1, 1); assertEquals("Person ID mismatch", "I3881", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); // Go to Maria Berta Faigle currentPerson = currentPerson.navigateChild(1, 1); assertEquals("Person ID mismatch", "I3891", currentPerson.getId()); assertEquals("Person failed check", "", currentPerson.check()); } finally { // Close the browser driver.quit(); } return true; }