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


##########
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:
   Done - removed the hard-coded 30 so it now uses the configured 
grails.geb.timeouts.timeout (set to 30 in gradle/functional-test-config.gradle 
and increasable per test run). Pushed in 21670d3d86.



##########
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:
   Done - same fix here, dropped the hard-coded 30 so logout() uses the 
configured grails.geb.timeouts.timeout. Pushed in 21670d3d86.



-- 
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