Skip to content

Commit

Permalink
qa-auto/HSP-6605 Check that Travel Entry tasks display the correct re…
Browse files Browse the repository at this point in the history
…gion and district in Task Management Directory

* qa-auto/HSP-6605 Check that Travel Entry tasks display the correct region and district in Task Management Directory - initial commit

* qa-auto/HSP-6605 Check that Travel Entry tasks display the correct region and district in Task Management Directory - second commit
  • Loading branch information
mk-sgent authored Feb 26, 2024
1 parent 19f93cc commit 79bd735
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public class SideCards {
public static By HANDOVER_SIDE_CARD = By.xpath("//div[@location='sormasToSormas']");
public static final By SURVEILLANCE_REPORT_NOTIFICATION_DETAILS = By.id("notificationDetails");
public static final By POPUP_EDIT_REPORT_WINDOW_SAVE_BUTTON = By.cssSelector(".v-window #commit");
public static final By POPUP_EDIT_REPORT_WINDOW_DISCARD_BUTTON = By.cssSelector(".v-window #discard");
public static final By POPUP_EDIT_REPORT_WINDOW_DISCARD_BUTTON =
By.cssSelector(".v-window #discard");
public static final By SURVEILLANCE_REPORT_UUID_TEXT = By.cssSelector(".popupContent #uuid");
public static final By SURVEILLANCE_REPORT_EXTERNAL_ID_TEXT =
By.cssSelector(".popupContent #externalId");
Expand All @@ -58,9 +59,12 @@ public class SideCards {
By.cssSelector("#reportingUser > input");
public static final By TYPE_OF_REPORTING_COMBOBOX = By.cssSelector("#reportingType > div");
public static final By REPORTER_FACILITY_COMBOBOX = By.cssSelector("#facility > div");
public static final By REPORTER_FACILITY_REGION_COMBOBOX = By.cssSelector("#facilityRegion > div");
public static final By REPORTER_FACILITY_DISTRICT_COMBOBOX = By.cssSelector("#facilityDistrict > div");
public static final By REPORTER_FACILITY_CATEGORY_COMBOBOX = By.cssSelector("#facilityTypeGroup > div");
public static final By REPORTER_FACILITY_REGION_COMBOBOX =
By.cssSelector("#facilityRegion > div");
public static final By REPORTER_FACILITY_DISTRICT_COMBOBOX =
By.cssSelector("#facilityDistrict > div");
public static final By REPORTER_FACILITY_CATEGORY_COMBOBOX =
By.cssSelector("#facilityTypeGroup > div");
public static final By REPORTER_FACILITY_TYPE_COMBOBOX = By.cssSelector("#facilityType > div");
public static final By CLOSE_POPUP_SHARING_MESSAGE =
By.xpath("//div[@class='v-window v-widget v-has-width']//div[@class='v-window-closebox']");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public class TaskManagementPage {
"//div[@class='popupContent']//div[contains(@id, '-delete') and not(contains(@id, 'null-delete'))]");
public static final By CUSTOM_EXPORT_CONFIGURATION_NAME_INPUT =
By.xpath("//div[@id='sormasui-1655777373-overlays']//input[@type='text']");
public static final By FIRST_GRID_REGION_VALUE = By.xpath("//tbody/tr/td[5]");
public static final By FIRST_GRID_DISTRICT_VALUE = By.xpath("//tbody/tr/td[6]");

public static By getCheckboxByIndex(String idx) {
return By.xpath(String.format("(//input[@type=\"checkbox\"])[%s]", idx));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

import cucumber.api.java8.En;
import io.restassured.http.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import lombok.SneakyThrows;
Expand All @@ -35,12 +37,14 @@
import org.sormas.e2etests.helpers.RestAssuredClient;
import org.sormas.e2etests.helpers.WebDriverHelpers;
import org.sormas.e2etests.helpers.api.sormasrest.TravelEntryHelper;
import org.sormas.e2etests.pages.application.entries.EditTravelEntryPage;
import org.sormas.e2etests.state.ApiState;

public class TravelEntrySteps implements En {

private static WebDriverHelpers webDriverHelpers;
private final RestAssuredClient restAssuredClient;
public static List<String> travelEntriesUUID = new ArrayList<>();

@Inject
public TravelEntrySteps(
Expand Down Expand Up @@ -77,6 +81,13 @@ public TravelEntrySteps(
webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(UUID_INPUT);
});

When(
"I collect uuid of the new travel entry",
() -> {
travelEntriesUUID.add(
webDriverHelpers.getValueFromWebElement(EditTravelEntryPage.UUID_INPUT));
});

When(
"I filter by last created travel entry via API",
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import static org.sormas.e2etests.pages.application.samples.SamplesDirectoryPage.CONFIRM_BUTTON;
import static org.sormas.e2etests.pages.application.tasks.CreateNewTaskPage.*;
import static org.sormas.e2etests.pages.application.tasks.TaskManagementPage.*;
import static org.sormas.e2etests.steps.api.TravelEntrySteps.travelEntriesUUID;
import static org.sormas.e2etests.steps.web.application.events.EventDirectorySteps.eventsUUID;

import com.opencsv.CSVParser;
Expand Down Expand Up @@ -195,6 +196,17 @@ public TaskManagementSteps(
getByEventUuid(eventsUUID.get(0)));
});

When(
"^I am search the last created travel Entry by API in task management directory$",
() -> {
webDriverHelpers.waitForPageLoadingSpinnerToDisappear(70);
webDriverHelpers.fillAndSubmitInWebElement(
GENERAL_SEARCH_INPUT, travelEntriesUUID.get(0));
webDriverHelpers.waitForPageLoadingSpinnerToDisappear(15);
webDriverHelpers.waitUntilIdentifiedElementIsVisibleAndClickable(
getByEventUuid(travelEntriesUUID.get(0)));
});

When(
"^I filter Task context by ([^\"]*)$",
(String filterType) -> {
Expand Down Expand Up @@ -234,6 +246,22 @@ public TaskManagementSteps(
softly.assertAll();
});

When(
"^I check that region and district are correct displayed for the last created travel entry by API in task management$",
() -> {
softly.assertEquals(
manager.getRegionName(
apiState.getCreatedTravelEntry().getResponsibleRegion().getUuid()),
webDriverHelpers.getTextFromWebElement(FIRST_GRID_REGION_VALUE),
"Regions are not equal");
softly.assertEquals(
manager.getDistrictName(
apiState.getCreatedTravelEntry().getResponsibleDistrict().getUuid()),
webDriverHelpers.getTextFromWebElement(FIRST_GRID_DISTRICT_VALUE),
"Districts are not equal");
softly.assertAll();
});

When(
"^I check displayed task's context is ([^\"]*)$",
(String taskContext) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ Feature: Create travel entries
When I fill the required fields in a new travel entry form with same person data
And I click on Save button from the new travel entry form
Then I check if National Health Id, Nickname and Passport number appear in Pick or create person popup

@tmsLink=SORDEV-7166 @env_de
Scenario: Test Link DEA TravelEntries to cases
Given I log in as a Admin User
Expand Down Expand Up @@ -401,6 +402,7 @@ Feature: Create travel entries
When I back to deleted travel entry by url
Then I check if reason of deletion is set to "Löschen auf Anforderung der betroffenen Person nach DSGVO"
And I check if External ID input on travel entry edit page is disabled

@tmsLink=SORDEV-10227 @env_de
Scenario: Test Permanent deletion for Person for Travel Entry
Given I log in as a National User
Expand Down Expand Up @@ -468,10 +470,8 @@ Feature: Create travel entries
@tmsLink=SORQA-669 @env_de @oldfake
Scenario: Check automatic deletion of TRAVEL_ENTRY origin 16 days ago
Given API: I create a new person

And API: I check that POST call status code is 200
Then API: I create a new travel entry with creation date 16 days ago

And API: I check that POST call status code is 200
Then I log in as a Admin User
And I open the last created travel entry via api
Expand All @@ -490,7 +490,6 @@ Feature: Create travel entries
Given API: I create a new person
And API: I check that POST call status code is 200
Then API: I create a new travel entry with creation date 13 days ago

And API: I check that POST call status code is 200
Then I log in as a Admin User
And I open the last created travel entry via api
Expand All @@ -502,4 +501,21 @@ Feature: Create travel entries
And API: I check that GET call status code is 200
Then I click on the Entries button from navbar
And I filter by last created travel entry via API
And I check that number of displayed Travel Entry results is 1
And I check that number of displayed Travel Entry results is 1

@tmsLink=HSP-6605 @env_de
Scenario: Check that Travel Entry tasks display the correct region and district in Task Management Directory
Given API: I create a new person
And API: I check that POST call status code is 200
Then API: I create a new travel entry with creation date 2 days ago
And API: I check that POST call status code is 200
Then I log in as a Admin User
And I open the last created travel entry via api
And I collect uuid of the new travel entry
And I click NEW TASK in Edit Travel Entry page
Then I fill a new task form with specific data for DE version
And I click on Save button in New Task form
Then I check if new task is displayed in Task tab on Edit Travel Entry page
And I click on the Tasks button from navbar
And I am search the last created travel Entry by API in task management directory
And I check that region and district are correct displayed for the last created travel entry by API in task management

0 comments on commit 79bd735

Please sign in to comment.