File tree Expand file tree Collapse file tree
applications/Grants.AutoUI/cypress/e2e Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments