コード例 #1
0
  @Test
  public void shouldDisplayErrorMessageIfLoginFails()
      throws MalformedURLException, InterruptedException {

    // given
    pageOne.openPageOne(domainURL);

    // when
    pageOne.openLoginToggle();
    pageOne.clickLoginLink();
    pageOne.loginAsUser(COMMON_USER, INCORRECT_PASSWORD);

    // then
    assertThat(pageOne.notificationMessage(), is(INCORRECT_CREDENTIALS));
  }
コード例 #2
0
  @Test
  public void shouldSuccessfullyLogin() throws MalformedURLException, InterruptedException {

    // given
    pageOne.openPageOne(domainURL);

    // when
    pageOne.openLoginToggle();
    pageOne.clickLoginLink();
    pageOne.loginAsUser(COMMON_USER, DEFAULT_PASSWORD);

    // then
    assertThat(pageOne.isConfirmationDisplayed(LOGIN_CONFIRMATION_MESSAGE), is(true));
    assertThat(pageOne.isMyAccountButtonAvailable(), is(true));
  }