Skip to content

Commit

Permalink
fix: use strict getByLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
arnou authored Nov 23, 2023
1 parent 204634e commit 6c5488a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void test_should_identify_jane_with_Login_name() {
page.navigate(KEYCLOAK_CONTAINER.getAuthServerUrl() + "/realms/testloginattribute/account");
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in")).click();
page.getByLabel("Username").fill(username);
page.getByLabel("Password").fill(password);
page.getByLabel("Password", new Page.GetByLabelOptions().setExact(true)).fill(password);
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign In")).click();
// Then
assertThat(page.locator("#landingLoggedInUser")).hasText(expected);
Expand All @@ -71,7 +71,7 @@ void test_should_identify_john_with_attribute() {
page.navigate(KEYCLOAK_CONTAINER.getAuthServerUrl() + "/realms/testloginattribute/account");
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in")).click();
page.getByLabel("Username").fill(attributeValueOfJohnDoe);
page.getByLabel("Password").fill(password);
page.getByLabel("Password", new Page.GetByLabelOptions().setExact(true)).fill(password);
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign In")).click();
// Then
assertThat(page.locator("#landingLoggedInUser")).hasText(expected);
Expand All @@ -87,7 +87,7 @@ void test_should_not_identify_jane_with_attribute() {
page.navigate(KEYCLOAK_CONTAINER.getAuthServerUrl() + "/realms/testloginattribute/account");
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in")).click();
page.getByLabel("Username").fill(attributeValueOfJaneDoe);
page.getByLabel("Password").fill(password);
page.getByLabel("Password", new Page.GetByLabelOptions().setExact(true)).fill(password);
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign In")).click();
// Then
assertThat(page.getByText(expected)).isVisible();
Expand Down Expand Up @@ -137,4 +137,4 @@ void test_should_not_reset_jane_with_attribute() {
// Then
assertThat(page.getByText(expected)).isVisible();
}
}
}

0 comments on commit 6c5488a

Please sign in to comment.