public RedMineLoginPage(WebDriver driver) throws IOException { this.driver = driver; this.uiElementMapper = UIElementMapper.getInstance(); // Check that we're on the right page. if (!(driver.getCurrentUrl().contains("redmine"))) { throw new IllegalStateException("This is not the Red mine page"); } }
public WebAppListPage(WebDriver driver) throws IOException { this.driver = driver; UIElementMapper uiElementMapper = UIElementMapper.getInstance(); // Check that we're on the right page. driver.findElement(By.xpath(uiElementMapper.getElement("webapp.list.xpath"))).click(); if (!driver .findElement(By.id(uiElementMapper.getElement("webapp.list.page.middle"))) .getText() .contains("Running Applications")) { throw new IllegalStateException("This is not the Running Web Applications Page"); } }