gabrnavarro opened a new pull request, #63144:
URL: https://github.com/apache/airflow/pull/63144

   ## What changed
   
   Refactored `BasePage.ts` to replace a manual/synchronous URL check with a 
Playwright web-first assertion.
   
   In `isLoggedIn()`, the fallback path previously used 
`this.page.url().includes("/login")` — a synchronous snapshot of the URL that 
can be flaky. This is now replaced with 
`expect(this.page).not.toHaveURL(/\/login/)`, which is a web-first assertion 
that automatically retries until the condition is met or times out.
   
   ## Why
   
   Aligns with Playwright best practices per the checklist in the issue:
   - **Manual assertions → web-first assertions**: replaced synchronous 
`page.url()` check with `expect(page).not.toHaveURL()`.
   
   The other checklist items (`page.waitForFunction()`, 
`page.waitForTimeout()`, `waitForLoadState("networkidle")`, `page.evaluate()`, 
CSS `:has-text()`) were not present in `BasePage.ts`, so no changes were needed 
for those.
   
   Fixes #63038
   
   ## Testing
   
   - Verified the change is type-safe via TypeScript compilation (no new 
errors).
   - The logic is behaviorally equivalent: returns `true` if the welcome 
heading is visible or if the URL does not contain `/login`, and `false` 
otherwise.
   - `expect(page).not.toHaveURL(/\/login/)` is a standard Playwright web-first 
assertion that retries, making the check more reliable than the previous 
synchronous URL snapshot.
   


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