diff --git a/src/main/java/framework/ui/pages/simplOpen/AuthorityPage.java b/src/main/java/framework/ui/pages/simplOpen/AuthorityPage.java index e96be1cc7cfc88390c950459ac12e53031e94a0d..9bd4ff2dbc584dc5498e239f82c3f123224013fa 100644 --- a/src/main/java/framework/ui/pages/simplOpen/AuthorityPage.java +++ b/src/main/java/framework/ui/pages/simplOpen/AuthorityPage.java @@ -510,7 +510,6 @@ public class AuthorityPage { return df.format(date); } - /*** * This method compares the values obtained dynamically from the first row of the Participant List page * and compares them with the values obtained dynamically from the Participant Detail page. @@ -559,4 +558,24 @@ public class AuthorityPage { realValues.replaceAll(String::strip); assertEqualCollections(expectedValues, realValues); } + + /*** + * The method verifies if the tag or label to the right of the "Filter" button was applied successfully. + * + * @param filter + * @param valueFilter + * @param dateParsed ; this value is not taken from the Authority.feature as a parameter, it is calculated and parsed as String + */ + public void verifyFilterIsAppied(String filter, String valueFilter, String dateParsed) { + String filterValueApplied = "null"; + if (filter.equals("Onboarding Date")) { + filterValueApplied = filter.concat(":").concat(" ").concat(dateParsed).concat(";"); + } else { + filterValueApplied = filter.concat(":").concat(" ").concat(valueFilter.toUpperCase()).concat(";"); + } + String filterAppliedLocatorValue = page.locator(FILTER_APPLIED_VALUE_LOCATOR).innerText().trim(); + if (!filterValueApplied.equals(filterAppliedLocatorValue)) { + throw new AssertionError("The filter: " + filter + " with the value " + valueFilter + " is not displayed."); + } + } } diff --git a/src/test/java/features/ui/simplOpen/Authority.feature b/src/test/java/features/ui/simplOpen/Authority.feature index 30796fefcabdaebb92762f82e3897104951761c1..8b04449b5bfee1565eb2fe700730ed0ea1645bd0 100644 --- a/src/test/java/features/ui/simplOpen/Authority.feature +++ b/src/test/java/features/ui/simplOpen/Authority.feature @@ -484,9 +484,9 @@ Feature: Authority Then the dialog for the delete action is displayed successfully - @TCA32 @SIMPL-3309 @SIMPL-3310 @SIMPL-3311 @bugSIMPL-10276 @SIMPL-3313 @SIMPL-3314 + @TCA32 @SIMPL-3309 @SIMPL-3310 @SIMPL-3311 @bugSIMPL-10276 @SIMPL-3312 @SIMPL-3313 @SIMPL-3314 # Filter by email scenario has a bug associated. - Scenario Outline: Participants Management page filtering and reseting the filters: <caseName> + Scenario Outline: Participants Management page filtering and resetting the filters: <caseName> Given the user navigates to the "Participant Management" page And the user logs in with a user with "IATTR_M" role When the user filters by "<filter>" with value "<filterValue>" @@ -498,6 +498,7 @@ Feature: Authority | caseName | filter | filterValue | | the user is filtering by Participant type | Participant Type | Consumer | | the user is filtering by Participant Name | Participant Name | PSO | + | the user is filtering by Onboarding date | Onboarding Date | | #| the user is filtering by Email | Email | complete | @TCA34 @SIMPL-4917 diff --git a/src/test/java/stepDefinitions/ui/simplOpen/AuthoritySteps.java b/src/test/java/stepDefinitions/ui/simplOpen/AuthoritySteps.java index 2e1e490eb54570b9d8596832c9da348b82dc2ef0..9d39b45e68f5bc3513115d8a4210d3813a10e7fa 100644 --- a/src/test/java/stepDefinitions/ui/simplOpen/AuthoritySteps.java +++ b/src/test/java/stepDefinitions/ui/simplOpen/AuthoritySteps.java @@ -40,6 +40,7 @@ public class AuthoritySteps { private static String participantDetailNameValue = "null"; private static String participantDetailTypeValue = null; private static String participantDetailOnboardingValue = null; + private static String datePasedToString = null; @Given("the user clicks the register for this dataspace button") @@ -251,6 +252,7 @@ public class AuthoritySteps { LocalDate today = LocalDate.now(); DateTimeFormatter formatter = CalendarWidget.getDateFormat(); page.locator(PARTICIPANT_LIST_SECOND_FILTER_LOCATOR).fill(today.format(formatter)); + datePasedToString = authorityPage.parseDate(today.format(formatter)); } default -> throw new IllegalArgumentException("Unknown filter: " + filter); } @@ -781,12 +783,7 @@ public class AuthoritySteps { @Then("the user resets the {string} with the value {string} applied successfully") public void the_user_resets_the_filters_applied_successfully(String filter, String valueFilter) { - String filterValueApplied = "null"; - filterValueApplied = filter.concat(":").concat(" ").concat(valueFilter.toUpperCase()).concat(";"); - String filterAppliedLocatorValue = page.locator(FILTER_APPLIED_VALUE_LOCATOR).innerText().trim(); - if (!filterValueApplied.equals(filterAppliedLocatorValue)) { - throw new AssertionError("The filter: " + filter + " with the value " + valueFilter + " is not displayed."); - } + authorityPage.verifyFilterIsAppied(filter, valueFilter, datePasedToString); page.getByText(PARTICIPANT_PAGE_FILTER_BUTTON).click(); assertElementIsVisibleByLocator(page.getByText(PARTICIPANT_PAGE_RESET_FILTER_BUTTON)); page.getByText(PARTICIPANT_PAGE_RESET_FILTER_BUTTON).click();