diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java index 7e09b6a49eb..4887e4c3226 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/cases/EditCaseSteps.java @@ -3009,6 +3009,25 @@ public EditCaseSteps( softly.assertAll(); }); + When( + "I check if Follow up until date is ([^\"]*) days before last created API case report date", + (Integer days) -> { + TimeUnit.SECONDS.sleep(3); + String date = webDriverHelpers.getValueFromWebElement(FOLLOW_UP_UNTIL_DATE); + softly.assertEquals( + DateTimeFormatter.ofPattern("dd.MM.yyyy") + .format( + apiState + .getCreatedCase() + .getReportDate() + .toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDate() + .minusDays(days)), + date); + softly.assertAll(); + }); + And( "^I select \"([^\"]*)\" from the infection settings on Edit Case page$", (String infectionOption) -> { diff --git a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/CreateNewSampleSteps.java b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/CreateNewSampleSteps.java index 085d8136eb5..ec07bfdb193 100644 --- a/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/CreateNewSampleSteps.java +++ b/sormas-e2e-tests/src/test/java/org/sormas/e2etests/steps/web/application/samples/CreateNewSampleSteps.java @@ -461,6 +461,7 @@ public CreateNewSampleSteps( When( "^I save the created sample", () -> { + webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(SAVE_SAMPLE_BUTTON); webDriverHelpers.clickOnWebElementBySelector(SAVE_SAMPLE_BUTTON); }); diff --git a/sormas-e2e-tests/src/test/resources/features/sanity/web/Case.feature b/sormas-e2e-tests/src/test/resources/features/sanity/web/Case.feature index 6a65a15cb22..a8275f295e0 100644 --- a/sormas-e2e-tests/src/test/resources/features/sanity/web/Case.feature +++ b/sormas-e2e-tests/src/test/resources/features/sanity/web/Case.feature @@ -1912,25 +1912,4 @@ Feature: Case end to end tests And API: I check that POST call status code is 200 Given I log in as a National User Then I navigate to the last created case via the url - And I check if Follow up until date is 14 days after last created API case report date - When I click on New Sample in German - Then I create a new Sample with positive test result for DE version - And I select the German words for Antigen Detection Test as Type of Test in the Create New Sample popup - And I set date of sample collection to 5 day ago in Sample form - And I set Final Laboratory Result to "Positiv" on Create new Sample page - And I save the created sample - And I check if Follow up until date is 9 days after last created API case report date - And I navigate to symptoms tab - When I check Yes Option for Soar Throat on Symptoms tab page - And I select sore throat option - And I set date of symptoms to 6 day ago from Symptoms tab - And I click on save button from Edit Case page - Then I navigate to the last created case via the url - And I check if Follow up until date is 8 days after last created API case report date - When I click on New Sample in German - Then I create a new Sample with positive test result for DE version - And I select the German words for Antigen Detection Test as Type of Test in the Create New Sample popup - And I set date of sample collection to 7 day ago in Sample form - And I set Final Laboratory Result to "Positiv" on Create new Sample page - And I save the created sample - And I check if Follow up until date is 8 days after last created API case report date \ No newline at end of file + And I check if Follow up until date is 14 days after last created API case report date \ No newline at end of file