@Step("Log in - {0}/{1}")
  public <T extends BasePage<T>> T login(
      String username, String password, Class<T> classOfExpectedPageObject) {

    usernameField.clear();
    usernameField.sendKeys(username);

    passwordField.clear();
    passwordField.sendKeys(password);

    loginButton.click();
    return PageFactory.newInstance(classOfExpectedPageObject);
  }
Ejemplo n.º 2
0
  public SearchResultsPage triggerSearch(String query) {
    searchField.sendKeys(query);
    searchBtn.click();

    return new SearchResultsPage();
  }