diff --git a/.github/workflows/run-tests-on-gh.yml b/.github/workflows/run-tests-on-gh.yml index 767168a1..f6a11ff8 100644 --- a/.github/workflows/run-tests-on-gh.yml +++ b/.github/workflows/run-tests-on-gh.yml @@ -47,7 +47,10 @@ jobs: - name: Update the load configuration for PRS if: github.event_name == 'pull_request' run: | - echo "SIMULATION_PRESET=pull_request" >> $GITHUB_ENV + echo "SIMULATION_PRESET=dev" >> $GITHUB_ENV + echo "TIER_COUNT=1" >> $GITHUB_ENV + echo "TIER_DURATION_MINUTES=30" >> $GITHUB_ENV + echo "USER_INCREMENT_PER_TIER=200" >> $GITHUB_ENV - name: Update the load configuration for commits if: github.event_name == 'push' diff --git a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java index 3a7707ae..88820e53 100644 --- a/src/test/java/org/openmrs/performance/http/DoctorHttpService.java +++ b/src/test/java/org/openmrs/performance/http/DoctorHttpService.java @@ -30,6 +30,13 @@ public HttpRequestActionBuilder getVisitTypes() { } public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) { + String customRepresentation = "custom:(uuid,voided,indication,startDatetime,stopDatetime)"; + + return http("Get Visits of Patient") + .get("/openmrs/ws/rest/v1/visit/?patient=" + patientUuid + "&v=" + customRepresentation+"&limit=5"); + } + + public HttpRequestActionBuilder getVisit(String visitUuid) { String customRepresentation = "custom:(uuid,encounters:(uuid,diagnoses:(uuid,display,rank,diagnosis)," + "form:(uuid,display),encounterDatetime,orders:full," + "obs:(uuid,concept:(uuid,display,conceptClass:(uuid,display)),display," @@ -40,8 +47,8 @@ public HttpRequestActionBuilder getVisitsOfPatient(String patientUuid) { + "startDatetime,stopDatetime,patient," + "attributes:(attributeType:ref,display,uuid,value))"; - return http("Get Visits of Patient") - .get("/openmrs/ws/rest/v1/visit?patient=" + patientUuid + "&v=" + customRepresentation); + return http("Get Visit") + .get("/openmrs/ws/rest/v1/visit/" + visitUuid + "&v=" + customRepresentation); } public HttpRequestActionBuilder getActiveVisitOfPatient(String patientUuid) { diff --git a/src/test/java/org/openmrs/performance/http/HttpService.java b/src/test/java/org/openmrs/performance/http/HttpService.java index 10be4a66..7d9d8196 100644 --- a/src/test/java/org/openmrs/performance/http/HttpService.java +++ b/src/test/java/org/openmrs/performance/http/HttpService.java @@ -61,7 +61,7 @@ public HttpRequestActionBuilder getPrimaryIdentifierTermMapping() { } public HttpRequestActionBuilder getVisitsOfLocation(String locationUuid) { - return http("Get Visits") + return http("Get Visits of a Location") .get("/openmrs/ws/rest/v1/visit?v=custom:(uuid,patient:(uuid,identifiers:(identifier,uuid,identifierType:(name,uuid)),person:(age,display,gender,uuid,attributes:(value,attributeType:(uuid,display)))),visitType:(uuid,name,display),location:(uuid,name,display),startDatetime,stopDatetime)&includeInactive=false&totalCount=true&location=" + locationUuid); } diff --git a/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java b/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java index 27875e27..6f6f16b8 100644 --- a/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java +++ b/src/test/java/org/openmrs/performance/registries/DoctorRegistry.java @@ -108,8 +108,11 @@ public ChainBuilder openAttachmentsTab(String patientUuid) { .exec(httpService.getAllowedFileExtensions()); } - public ChainBuilder openVisitsTab(String patientUuid) { - return exec(httpService.getVisitsOfPatient(patientUuid)); + public ChainBuilder openVisitsTab(String patientUuid, String visitUuid) { + return exec( + httpService.getVisitsOfPatient(patientUuid), + httpService.getVisit(visitUuid) + ); } public ChainBuilder addDrugOrder(String patientUuid, String visitUuid, String currentUserUuid) { diff --git a/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java b/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java index 9d247e4e..cf54f2ef 100644 --- a/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java +++ b/src/test/java/org/openmrs/performance/scenarios/VisitPatientScenario.java @@ -23,7 +23,7 @@ public ScenarioBuilder getScenarioBuilder() { .exec(registry.openHomePage()) .exec(registry.openPatientChartPage("#{patient_uuid}")) .exec(registry.startVisit("#{patient_uuid}")) - .exec(registry.openVisitsTab("#{patient_uuid}")) + .exec(registry.openVisitsTab("#{patient_uuid}", "#{visitUuid}")) .exec(registry.openVitalsAndBiometricsTab("#{patient_uuid}")) .exec(registry.openMedicationsTab("#{patient_uuid}")) .exec(registry.openOrdersTab("#{patient_uuid}"))