jdaugherty commented on code in PR #15793:
URL: https://github.com/apache/grails-core/pull/15793#discussion_r3567069615


##########
grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/pages/LogoutPage.groovy:
##########
@@ -29,6 +29,9 @@ class LogoutPage extends NavigationPage {
     }
 
     void logout() {
-        clickAndWaitForNavigation(logoutButton)
+        logoutButton.click()
+        // Wait for a definitive logged-out signal: the confirm page is 
replaced and the login
+        // form is present again, not merely a transient title change.
+        waitFor(30) { title != pageTitle && !$('input', name: 
'username').empty }

Review Comment:
   We need to remove the hard coded 30, we set these on the test run and 
increase them as necessary



##########
grails-test-examples/scaffolding/src/integrationTest/groovy/com/example/pages/LoginPage.groovy:
##########
@@ -33,6 +33,9 @@ class LoginPage extends NavigationPage {
     void login(String username = '[email protected]', String password = 
'letmein') {
         this.username = username
         this.password = password
-        clickAndWaitForNavigation(loginButton)
+        loginButton.click()
+        // Wait for a definitive authenticated signal: the login page must be 
fully replaced
+        // (title changed AND the login form is gone), not merely a transient 
title change.
+        waitFor(30) { title != pageTitle && $('input', name: 'username').empty 
}

Review Comment:
   We need to remove the hard coded 30, we set these on the test run and 
increase them as necessary



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to