diff --git a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/configuration/FacilitiesTabPage.java b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/configuration/FacilitiesTabPage.java index 5e43c6e0193..169183257fa 100644 --- a/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/configuration/FacilitiesTabPage.java +++ b/sormas-e2e-tests/src/main/java/org/sormas/e2etests/pages/application/configuration/FacilitiesTabPage.java @@ -77,4 +77,5 @@ public class FacilitiesTabPage { public static final By ACTION_CONFIRM_BUTTON = By.id("actionConfirm"); public static final By RELEVANCE_STATUS_COMBOBOX_FACILITIES_CONFIGURATION = By.cssSelector("#relevanceStatus > div"); + public static final By FACILITY_GRID_RESULTS_ROWS = By.xpath("//tbody[@role='rowgroup']//tr"); } diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/configuration/FacilitySteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/configuration/FacilitySteps.java index a008088e80b..c23cd92310e 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/configuration/FacilitySteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/configuration/FacilitySteps.java @@ -44,6 +44,7 @@ import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_CONTACT_PERSON_LAST_NAME_INPUT; import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_CONTACT_PERSON_PHONE_INPUT; import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_EXPOSURE_TYPE_COMBOBOX; +import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_GRID_RESULTS_ROWS; import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_NAME_INPUT; import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_TYPE_COMBOBOX; import static org.sormas.e2etests.pages.application.configuration.FacilitiesTabPage.FACILITY_TYPE_COMBOBOX_FACILITIES_CONFIGURATION; @@ -86,7 +87,9 @@ import org.sormas.e2etests.entities.services.EventService; import org.sormas.e2etests.enums.DistrictsValues; import org.sormas.e2etests.enums.RegionsValues; +import org.sormas.e2etests.helpers.AssertHelpers; import org.sormas.e2etests.helpers.WebDriverHelpers; +import org.testng.Assert; import org.testng.asserts.SoftAssert; public class FacilitySteps implements En { @@ -104,7 +107,8 @@ public FacilitySteps( SoftAssert softly, Faker faker, CaseService caseService, - EventService eventService) { + EventService eventService, + AssertHelpers assertHelpers) { this.webDriverHelpers = webDriverHelpers; this.faker = faker; @@ -365,6 +369,25 @@ public FacilitySteps( "Relevance status Combo box is Not present in Facilities Configuration"); softly.assertAll(); }); + + When( + "I filter facility by {string}", + (String facilName) -> { + webDriverHelpers.fillAndSubmitInWebElement(SEARCH_FACILITY, facilName); + TimeUnit.SECONDS.sleep(2); // wait for system reaction + webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40); + }); + + When( + "I check that number of displayed Facilities results is {int}", + (Integer nr) -> { + assertHelpers.assertWithPoll20Second( + () -> + Assert.assertEquals( + webDriverHelpers.getNumberOfElements(FACILITY_GRID_RESULTS_ROWS), + nr.intValue(), + "Number of displayed facilities is not correct")); + }); } private void selectFacilityType(String facilityType) { diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Country.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Country.feature index eff13581e1b..077a32ec5da 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Country.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Country.feature @@ -1,7 +1,7 @@ @UI @Sanity @Configuration Feature: Country end to end tests - @tmsLink=SORDEV-7463 @env_main + @tmsLink=SORDEV-7463 @env_main @precon Scenario: Test configuration for country and its Subcontinent association Given I log in as a Admin User Then I click on the Configuration button from navbar @@ -9,7 +9,7 @@ Feature: Country end to end tests And I fill search filter with "Germany" country name on Country Configuration Page Then I check the "Central Europe" name for the country on Country Configuration Page - @tmsLink=SORDEV-7464 @env_main + @tmsLink=SORDEV-7464 @env_main @precon Scenario: Test configuration for NCL and its Subcontinent association Given I log in as a Admin User Then I click on the Configuration button from navbar @@ -51,3 +51,11 @@ Feature: Country end to end tests Then I verify the Subcontinent Central America combo box returns appropriate filter results in Countries Configuration page Then I verify the Subcontinent Central Asia combo box returns appropriate filter results in Countries Configuration page Then I verify the Subcontinent Central Europe combo box returns appropriate filter results in Countries Configuration page + + @tmsLink=SORQA-707 @env_main @precon + Scenario: Test configuration for country and its Subcontinent association + Given I log in as a Admin User + Then I click on the Configuration button from navbar + And I navigate to countries tab in Configuration + And I fill search filter with "Cameroon" country name on Country Configuration Page + Then I check the "Central Africa" name for the country on Country Configuration Page \ No newline at end of file diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Facility.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Facility.feature index a32143017df..f00352a42c2 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Facility.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Facility.feature @@ -65,3 +65,35 @@ Feature: Facility end to end tests Then I click on the Configuration button from navbar And I click on Facilities button in Configuration tab Then I Verify the page elements are present in Facilities Configuration Page + + @tmsLink=SORQA-707 @env_main @precon + Scenario: Check if Standard Einrichtung facility is available in the system + Given I log in as a Admin User + Then I click on the Configuration button from navbar + Then I click on Facilities button in Configuration tab + And I filter facility by "Standard Einrichtung" + Then I check that number of displayed Facilities results is 1 + + @tmsLink=SORQA-707 @env_main @precon + Scenario: Check if Voreingestelltes Labor facility is available in the system + Given I log in as a Admin User + Then I click on the Configuration button from navbar + Then I click on Facilities button in Configuration tab + And I filter facility by "Voreingestelltes Labor" + Then I check that number of displayed Facilities results is 1 + + @tmsLink=SORQA-707 @env_s2s_1 @precon + Scenario: Check if General Hospital facility is available in the system + Given I log in as a Admin User + Then I click on the Configuration button from navbar + Then I click on Facilities button in Configuration tab + And I filter facility by "General Hospital" + Then I check that number of displayed Facilities results is 1 + + @tmsLink=SORQA-707 @env_main @precon + Scenario: Check if Community111 facility is available in the system + Given I log in as a Admin User + Then I click on the Configuration button from navbar + Then I click on Facilities button in Configuration tab + And I filter facility by "Community111" + Then I check that number of displayed Facilities results is 1 \ No newline at end of file diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Keycloak.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Keycloak.feature index 67b41d7b653..e3f430a5777 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Keycloak.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Keycloak.feature @@ -1,7 +1,7 @@ @UI @Sanity @Keycloak Feature: Keycloak tests - @tmsLink=SORQA-458 @env_keycloak + @tmsLink=SORQA-458 @env_keycloak @precon Scenario:SORMAS - Keycloak Synchronisation (manual sync) Given I log in as a Admin User Then I click on the Users from navbar @@ -16,7 +16,7 @@ Feature: Keycloak tests Then I count the number of users displayed in Users tab in Keycloak Administrator Console And I check that number of users from SORMAS is equal to number of users in Keycloak Administrator Console - @tmsLink=SORQA-459 @env_keycloak + @tmsLink=SORQA-459 @env_keycloak @precon Scenario:SORMAS - Keycloak Synchronisation (automatic sync) Given I log in as a Admin User Then I click on the Users from navbar