Skip to content

Commit

Permalink
rearranged the verification
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 committed Nov 18, 2024
1 parent 1b8b464 commit 9b8a8f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ describe("Sample Test", () => {
sampleTestPage.checkHasSari();
sampleTestPage.checkHasAri();
sampleTestPage.checkIsUnusualCourse();
sampleTestPage.interceptSampleTestReq();
// Submit the form and verify notification
cy.clickSubmitButton("Confirm your request to send sample for testing");
sampleTestPage.interceptSampleTestReq();
cy.verifyNotification("Sample test created successfully");
sampleTestPage.verifySampleTestReq();
cy.verifyNotification("Sample test created successfully");
// Check the updated request history
sampleTestPage.checkRequestHistory(
sampleTestStatus,
Expand Down
3 changes: 2 additions & 1 deletion cypress/pageobject/Sample/SampleTestCreate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export class SampleTestPage {
visitSampleRequestPage(): void {
cy.verifyAndClickElement("#sample-request-btn", "Request Sample Test");
cy.url().should("include", "/sample-test");
}

selectSampleType(option: string): void {
Expand Down Expand Up @@ -100,7 +101,7 @@ export class SampleTestPage {
}

verifySampleTestReq(): void {
cy.wait("@sampleDetails").its("response.statusCode").should("eq", 200);
cy.wait("@sampleDetails").its("response.statusCode").should("eq", 201);
}

interceptGetSampleTestReq(): void {
Expand Down

0 comments on commit 9b8a8f8

Please sign in to comment.