Skip to content

Commit bd960cd

Browse files
committed
Increase e2e provider response timeouts AB#17107
1 parent 0a8736d commit bd960cd

5 files changed

Lines changed: 25 additions & 4 deletions

File tree

Testing/functional/tests/cypress/integration/e2e/dependent/dashboard.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const confirmationModalButton = "[data-testid=generic-message-submit-btn]";
2020

2121
describe("dependents - dashboard", () => {
2222
beforeEach(() => {
23+
cy.intercept("GET", "**/Immunization?hdid*").as("getImmunization");
2324
cy.configureSettings({
2425
homepage: {
2526
showRecommendationsLink: true,
@@ -79,6 +80,7 @@ describe("dependents - dashboard", () => {
7980
.should("be.visible", "be.enabled")
8081
.click();
8182

83+
cy.wait("@getImmunization", { timeout: defaultTimeout });
8284
cy.get(recommendationsTableSelector).should("exist");
8385
cy.get(recommendationsDownloadButtonSelector)
8486
.should("be.visible", "be.enabled")

Testing/functional/tests/cypress/integration/e2e/services/encounter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
describe("Encounter Service", () => {
2+
const providerResponseTimeout = 120000;
23
beforeEach(() => {
34
cy.readConfig().as("config");
45
cy.getTokens(
@@ -145,6 +146,7 @@ describe("Encounter Service", () => {
145146
cy.request({
146147
url: `${config.serviceEndpoints.Encounter}Encounter/HospitalVisit/${HDID}`,
147148
followRedirect: false,
149+
timeout: providerResponseTimeout,
148150
auth: {
149151
bearer: tokens.access_token,
150152
},
@@ -170,7 +172,7 @@ describe("Encounter Service", () => {
170172
method: "GET",
171173
url: `${encounterEndpoint}Encounter/HospitalVisit/${HDID}?api-version=2`,
172174
followRedirect: false,
173-
timeout: 120000,
175+
timeout: providerResponseTimeout,
174176
auth: {
175177
bearer: tokens.access_token,
176178
},

Testing/functional/tests/cypress/integration/e2e/timeline/filter.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ describe("Disabled Filters", () => {
4343
});
4444

4545
describe("Filters", () => {
46+
function waitForLabResults() {
47+
cy.wait("@getLabResult", { timeout: 120000 }).then(({ response }) => {
48+
expect(response.statusCode).to.eq(200);
49+
expect(response.body.resourcePayload.loaded).to.eq(true);
50+
expect(response.body.resourcePayload.queued).to.eq(false);
51+
});
52+
}
53+
4654
function testDatasetTimelineFiltering(
4755
filterTestId,
4856
titleTestId,
@@ -125,6 +133,9 @@ describe("Filters", () => {
125133
},
126134
],
127135
});
136+
cy.intercept("GET", "**/Laboratory/LaboratoryOrders*").as(
137+
"getLabResult"
138+
);
128139
cy.login(
129140
Cypress.env("keycloak.username"),
130141
Cypress.env("keycloak.password"),
@@ -170,6 +181,8 @@ describe("Filters", () => {
170181
});
171182

172183
it("Validate Date Range Filter", () => {
184+
waitForLabResults();
185+
173186
//Validate No records... text should be hidden by default (or with data)
174187
cy.get("[data-testid=noTimelineEntriesText]").should("not.exist");
175188

@@ -210,6 +223,8 @@ describe("Filters", () => {
210223
});
211224

212225
it("No Records on Linear Timeline", () => {
226+
waitForLabResults();
227+
213228
cy.get("[data-testid=filterDropdown]").click();
214229
cy.get("[data-testid=filterTextInput]").type(
215230
"no-data-should-match-this-unique-string"

Testing/functional/tests/cypress/integration/e2e/user/dependents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ describe("CRUD Operations", () => {
670670
force: true,
671671
});
672672

673+
cy.intercept("GET", "**/Immunization?hdid*").as("getImmunization");
673674
cy.intercept("POST", "**/UserProfile/*/Dependent").as("postDependent");
674675
cy.get("[data-testid=register-dependent-btn]").click();
675676
cy.wait("@postDependent", { timeout: defaultTimeout });
@@ -701,7 +702,6 @@ describe("CRUD Operations", () => {
701702
cy.log("Validating Immunization tab");
702703

703704
cy.setupDownloads();
704-
cy.intercept("GET", "**/Immunization?hdid*").as("getImmunization");
705705
cy.get("@newDependentCard").within(() => {
706706
cy.get(
707707
`[data-testid=immunization-tab-title-${validDependent.hdid}]`

Testing/functional/tests/cypress/support/functions/intercept.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ export function waitForInitialDataLoad(username, config, path) {
172172
cy.log(`Feature Toggle: ${JSON.stringify(featureToggle)}`);
173173
cy.log(`Path: ${path}`);
174174

175-
cy.log("Wait on patient.");
176-
cy.wait("@getPatient", { timeout: defaultTimeout });
175+
if (!isDependents(path) && !isDependentsTimeline(path)) {
176+
cy.log("Wait on patient.");
177+
cy.wait("@getPatient", { timeout: defaultTimeout });
178+
}
177179

178180
waitForUserProfile(username).then((blockedDataSources) => {
179181
waitForClinicalDocument(featureToggle, path, blockedDataSources);

0 commit comments

Comments
 (0)