jamesfredley opened a new pull request, #15410:
URL: https://github.com/apache/grails-core/pull/15410

   ## Summary
   
   Extends the Page Object pattern from #15394 to all remaining Geb functional 
tests across the repository, eliminating flaky bare `title == 'X'` assertions 
that fail intermittently due to race conditions between `driver.get()` and page 
title availability.
   
   ## Changes
   
   **28 new Page Object classes** created across 8 subprojects following the 
exact convention from #15394:
   - `static String pageTitle` - page title constant
   - `static url` - relative URL path
   - `static at = { title == pageTitle }` - at-check closure
   - `static content` - only when needed (e.g., form elements)
   
   **24 spec files refactored:**
   - `go('/url')` replaced with `to(PageObject)` for initial navigation
   - Bare `title == 'X'` in `then:` blocks replaced with `at(PageObject)`
   - `waitFor { title == PageObject.pageTitle }` used only for post-click async 
transitions
   - `go()` + `waitFor` retained for special cases (context paths, interceptor 
routing, parameterized URLs)
   
   **Subprojects affected:** app1, app2, app3, exploded, geb, hibernate5, 
mongodb (base + hibernate5), namespaces, scaffolding-fields, grails-geb 
(template)
   
   ## Special Cases
   
   - **app2/NotFoundHandlerSpec**: Same URL returns different pages based on 
interceptor - kept `go()` with `waitFor` and Page Object `pageTitle` references
   - **namespaces/ContextPathSpec**: Context path navigation doesn't map to 
Page Object URLs - kept `go()` with `waitFor`
   - **grails-geb template**: Code generation template can't reference 
project-specific Page Objects - uses `waitFor` directly
   - **geb subproject specs**: Already used `to(PageObject)` correctly - 
reverted unnecessary `waitFor` additions
   - **grails-data-neo4j**: Not in current build, uses old `GebSpec` - skipped
   
   ## Verification
   
   - `./gradlew codeStyle` passes (all CodeNarc checks clean)
   - All new Page Object files include Apache license headers
   - No wildcard imports added
   - Follows existing 4-space indentation and code conventions


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