Skip to content

Commit be369cd

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

8 files changed

Lines changed: 71 additions & 9 deletions

File tree

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

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

2121
describe("dependents - dashboard", () => {
2222
beforeEach(() => {
23+
cy.intercept("GET", `**/Immunization?hdid=${validDependent.hdid}*`).as(
24+
"getImmunization"
25+
);
2326
cy.configureSettings({
2427
homepage: {
2528
showRecommendationsLink: true,
@@ -79,6 +82,7 @@ describe("dependents - dashboard", () => {
7982
.should("be.visible", "be.enabled")
8083
.click();
8184

85+
cy.wait("@getImmunization", { timeout: defaultTimeout });
8286
cy.get(recommendationsTableSelector).should("exist");
8387
cy.get(recommendationsDownloadButtonSelector)
8488
.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/covid19Test.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ const {
55
} = require("../../../support/functions/timeline");
66

77
describe("COVID-19 Test Results", () => {
8+
function waitForCovid19TestResults() {
9+
cy.wait("@getCovid19TestResults", { timeout: 120000 })
10+
.its("response.statusCode")
11+
.should("eq", 200);
12+
}
13+
814
beforeEach(() => {
15+
cy.intercept("GET", "**/Laboratory/Covid19Orders*").as(
16+
"getCovid19TestResults"
17+
);
918
cy.configureSettings({
1019
datasets: [
1120
{
@@ -23,16 +32,24 @@ describe("COVID-19 Test Results", () => {
2332
});
2433

2534
it("Validate file download", () => {
35+
waitForCovid19TestResults();
36+
2637
cy.contains("[data-testid=entryCardDate]", "2020-Dec-03")
2738
.parents("[data-testid=timelineCard]")
2839
.filter(":has([data-testid=attachment-button])")
2940
.first()
3041
.within(() => {
31-
validateFileDownload("[data-testid=covid-result-download-btn]");
42+
validateFileDownload(
43+
"[data-testid=covid-result-download-btn]",
44+
true,
45+
60000
46+
);
3247
});
3348
});
3449

3550
it("Validate attachment download", () => {
51+
waitForCovid19TestResults();
52+
3653
cy.contains("[data-testid=entryCardDate]", "2020-Dec-03")
3754
.parents("[data-testid=timelineCard]")
3855
.filter(":has([data-testid=attachment-button])")

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

Lines changed: 17 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"
@@ -304,6 +319,8 @@ describe("Filters", () => {
304319
});
305320

306321
it("Filter Laboratory", () => {
322+
waitForLabResults();
323+
307324
testDatasetTimelineFiltering(
308325
"[data-testid=LabResult-filter]",
309326
"[data-testid=labresultTitle]",

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ const {
55
} = require("../../../support/functions/timeline");
66

77
describe("Laboratory Orders", () => {
8+
function waitForLabResults() {
9+
cy.wait("@getLabResults", { timeout: 120000 })
10+
.its("response.statusCode")
11+
.should("eq", 200);
12+
}
13+
814
beforeEach(() => {
15+
cy.intercept("GET", "**/Laboratory/LaboratoryOrders*").as(
16+
"getLabResults"
17+
);
918
cy.configureSettings({
1019
datasets: [
1120
{
@@ -23,6 +32,8 @@ describe("Laboratory Orders", () => {
2332
});
2433

2534
it("Validate file download", () => {
35+
waitForLabResults();
36+
2637
cy.get("[data-testid=timelineCard")
2738
.filter(":has([data-testid=attachment-button])")
2839
.first()
@@ -34,6 +45,8 @@ describe("Laboratory Orders", () => {
3445
});
3546

3647
it("Validate attachment download", () => {
48+
waitForLabResults();
49+
3750
cy.get("[data-testid=timelineCard")
3851
.filter(":has([data-testid=attachment-button])")
3952
.first()

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

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

673+
cy.intercept("GET", `**/Immunization?hdid=${validDependent.hdid}*`).as(
674+
"getImmunization"
675+
);
673676
cy.intercept("POST", "**/UserProfile/*/Dependent").as("postDependent");
674677
cy.get("[data-testid=register-dependent-btn]").click();
675678
cy.wait("@postDependent", { timeout: defaultTimeout });
@@ -701,7 +704,6 @@ describe("CRUD Operations", () => {
701704
cy.log("Validating Immunization tab");
702705

703706
cy.setupDownloads();
704-
cy.intercept("GET", "**/Immunization?hdid*").as("getImmunization");
705707
cy.get("@newDependentCard").within(() => {
706708
cy.get(
707709
`[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);

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ export function validateAttachmentDownload() {
1515
});
1616
}
1717

18-
export function validateFileDownload(buttonSelector, clickEntryCard = true) {
18+
export function validateFileDownload(
19+
buttonSelector,
20+
clickEntryCard = true,
21+
downloadTimeout = 20000
22+
) {
1923
getEntryCardDateString().then((dateString) => {
2024
if (clickEntryCard) {
2125
cy.get("[data-testid=entryCardDetailsTitle]")
2226
.should("be.visible")
2327
.click({ force: true });
2428
}
2529
cy.get(buttonSelector).should("be.visible").click();
26-
validateSensitiveDocumentDownload(dateString);
30+
validateSensitiveDocumentDownload(dateString, false, downloadTimeout);
2731
});
2832
}
2933

3034
export function validateSensitiveDocumentDownload(
3135
filename,
32-
exactMatch = false
36+
exactMatch = false,
37+
downloadTimeout = 20000
3338
) {
3439
cy.document()
3540
.find("[data-testid=generic-message-submit-btn]")
@@ -43,6 +48,6 @@ export function validateSensitiveDocumentDownload(
4348
cy.verifyDownload(filename, {
4449
contains: !exactMatch,
4550
interval: 500,
46-
timeout: 20000,
51+
timeout: downloadTimeout,
4752
});
4853
}

0 commit comments

Comments
 (0)