Skip to content

Commit a7f1bab

Browse files
authored
Merge pull request DIGI-UW#2006 from Bahati308/testName-fix
fix: Result Test Hardening
2 parents b642aa3 + a0b1ef3 commit a7f1bab

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

frontend/cypress/e2e/result.cy.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ describe("Result By Range Of Order", function () {
287287
});
288288

289289
describe("Result By Test And Status", function () {
290-
before("navigate to Result By Test And Status", function () {
290+
// This will run before every test case
291+
beforeEach("Navigate to Results page", function () {
291292
homePage = loginPage.goToHomePage();
292293
result = homePage.goToResultsByTestAndStatus();
293294
});
@@ -298,6 +299,18 @@ describe("Result By Test And Status", function () {
298299
});
299300
});
300301

302+
it("Search by TestName", function () {
303+
cy.fixture("workplan").then((order) => {
304+
result.selectTestName(order.testName);
305+
result.searchResults();
306+
result.expandSampleDetails();
307+
});
308+
cy.fixture("result").then((res) => {
309+
result.selectTestMethod(res.pcrTestMethod);
310+
});
311+
result.submitResults();
312+
});
313+
301314
it("Search by Collection Date", function () {
302315
cy.fixture("result").then((res) => {
303316
result.enterCollectionDate();
@@ -307,7 +320,6 @@ describe("Result By Test And Status", function () {
307320
result.selectTestMethod(res.pcrTestMethod);
308321
});
309322
result.submitResults();
310-
cy.reload();
311323
});
312324

313325
it("Search by Received Date", function () {
@@ -318,7 +330,6 @@ describe("Result By Test And Status", function () {
318330
result.selectTestMethod(res.pcrTestMethod);
319331
});
320332
result.submitResults();
321-
cy.reload();
322333
});
323334

324335
it("Search by Sample status", function () {
@@ -329,7 +340,6 @@ describe("Result By Test And Status", function () {
329340
result.selectTestMethod(res.pcrTestMethod);
330341
});
331342
result.submitResults();
332-
cy.reload();
333343
});
334344

335345
it("Search by Test Analysis", function () {
@@ -340,19 +350,5 @@ describe("Result By Test And Status", function () {
340350
result.selectTestMethod(res.pcrTestMethod);
341351
});
342352
result.submitResults();
343-
cy.reload();
344-
});
345-
346-
it("Search by TestName", function () {
347-
cy.reload();
348-
cy.fixture("workplan").then((order) => {
349-
result.selectTestName(order.testName);
350-
result.searchResults();
351-
result.expandSampleDetails();
352-
});
353-
cy.fixture("result").then((res) => {
354-
result.selectTestMethod(res.pcrTestMethod);
355-
});
356-
result.submitResults();
357353
});
358354
});

0 commit comments

Comments
 (0)