Skip to content

Commit

Permalink
HSP-6453 Check Delete Case right working without Edit rights - steps …
Browse files Browse the repository at this point in the history
…refactoring(#12827)

* HSP-6453 Check Delete Case right working without Edit rights - changed amount of readonly fields, added waitForPageLoadingSpinnerToDisappear to step

* HSP-6453 Stabilize "Check Delete Case right working without Edit rights" - Steps refactoring
  • Loading branch information
mk-sgent authored Jan 16, 2024
1 parent 8d02044 commit 1503a65
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,16 @@ public CaseDirectorySteps(

Then(
"I check that number of displayed cases results is {int}",
(Integer number) ->
assertHelpers.assertWithPoll20Second(
() ->
Assert.assertEquals(
Integer.parseInt(
webDriverHelpers.getTextFromPresentWebElement(TOTAL_CASES_COUNTER)),
number.intValue(),
"Number of displayed cases is not correct")));
(Integer number) -> {
webDriverHelpers.waitForPageLoadingSpinnerToDisappear(120);
assertHelpers.assertWithPoll20Second(
() ->
Assert.assertEquals(
Integer.parseInt(
webDriverHelpers.getTextFromPresentWebElement(TOTAL_CASES_COUNTER)),
number.intValue(),
"Number of displayed cases is not correct"));
});

And(
"I filter by mocked CaseID on Case directory page",
Expand Down Expand Up @@ -1740,6 +1742,8 @@ public CaseDirectorySteps(
And(
"^I set the Relevance Status Filter to \"([^\"]*)\" on Case Directory page$",
(String status) -> {
webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(
RELEVANT_STATUS_COMBOBOX);
webDriverHelpers.selectFromCombobox(RELEVANT_STATUS_COMBOBOX, status);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,10 @@ public EditImmunizationSteps(
When(
"I click on Yes option in Confirm deletion popup",
() -> {
webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(ACTION_CONFIRM_BUTTON);
webDriverHelpers.clickOnWebElementBySelector(ACTION_CONFIRM_BUTTON);
TimeUnit.SECONDS.sleep(1); // wait for page loaded
webDriverHelpers.waitForPageLoadingSpinnerToDisappear(40);
webDriverHelpers.waitForPageLoadingSpinnerToDisappear(100);
});

When(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ Feature: User roles checks

@tmsLink=HSP-6300 @env_main
Scenario: Check Delete Case right working without Edit rights
When API: I create a new person
And API: I check that POST call status code is 200
Then API: I create a new case
And API: I check that POST call status code is 200
Given I log in as a Admin User
And I open the last created Case via API
Then I get the case person UUID displayed on Edit case page
And I click on the Users from navbar
And I check if there is any user with the "NewTestUser" role and change his role
And I click on User roles tab from Users Page
Expand All @@ -184,16 +190,16 @@ Feature: User roles checks
Then I click on logout button from navbar
And I login with new created user with chosen new role
And I click on the Cases button from navbar
Then I search for the last "created" case on Case directory page
And I open the first Case result in Case Directory
Then I get the case person UUID displayed on Edit case page
Then I click on Delete button from case
And I click on Yes option in Confirm deletion popup
When I set Reason for deletion as "Deletion request by affected person according to GDPR"
And I click on Yes option in Confirm deletion popup
And I set the Relevance Status Filter to "Deleted cases" on Case Directory page
And I search for the last "deleted" case on Case directory page
Then I open the first Case result in Case Directory
And Total number of read only fields should be 14
And Total number of read only fields should be 17
Then I check that "Discard" button is readonly on Edit case page
And I check that "Save" button is readonly on Edit case page
Then I click on Restore button from case
Expand Down

0 comments on commit 1503a65

Please sign in to comment.