Skip to content

Commit 79e18a9

Browse files
Merge pull request #223 from bcgov/test
Test
2 parents a6aecda + 93d92a8 commit 79e18a9

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

applications/Grants.AutoUI/cypress/e2e/loginByBCSCFlow.cy.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,17 @@ describe(
9696
});
9797

9898
context("Step 5: Terms of Use", () => {
99-
it("displays the Terms of Use page with accept checkbox unchecked", () => {
100-
termsOfUsePage.verifyPageLoaded();
101-
termsOfUsePage.acceptCheckbox.should("not.be.checked");
102-
});
103-
104-
it("accepts terms and clicks Continue", () => {
105-
termsOfUsePage.acceptAndContinue();
106-
cy.url().should("not.include", "/login/acceptTerms");
99+
// The app skips this page when the user has already accepted terms server-side.
100+
// Conditionally verify and accept only when the page is actually presented.
101+
it("accepts terms if presented, then proceeds", () => {
102+
cy.url().then((url) => {
103+
if (url.includes("acceptTerms")) {
104+
termsOfUsePage.verifyPageLoaded();
105+
termsOfUsePage.acceptCheckbox.should("not.be.checked");
106+
termsOfUsePage.acceptAndContinue();
107+
cy.url().should("not.include", "acceptTerms");
108+
}
109+
});
107110
});
108111
});
109112

0 commit comments

Comments
 (0)