@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!"); }
@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!"); }