コード例 #1
0
  @Test
  public final void nonExistingUserCantLogIn() {

    User user = TestData.newValidUser().withUsername("unknown").build();

    LoginPage page = openLoginPage().loginExpectingError(user);

    assertThat(page.errorMessage()).isVisible();
    assertThat(page.errorMessage()).hasVisibleText("Wrong Credentials!");
  }
コード例 #2
0
  @Test
  public final void existingUserWithWrongPasswordCantLogIn() {

    User user = TestData.newValidUser().withPassword("wrong").build();

    LoginPage page = openLoginPage().loginExpectingError(user);

    assertThat(page.errorMessage()).isVisible();
    assertThat(page.errorMessage()).hasVisibleText("Wrong Credentials!");
  }