Skip to content

Refactor E2E page objects with toPass resilience and simplify specs#64666

Open
choo121600 wants to merge 1 commit intoapache:mainfrom
choo121600:e2e/03-page-objects-simple-specs
Open

Refactor E2E page objects with toPass resilience and simplify specs#64666
choo121600 wants to merge 1 commit intoapache:mainfrom
choo121600:e2e/03-page-objects-simple-specs

Conversation

@choo121600
Copy link
Copy Markdown
Member

@choo121600 choo121600 commented Apr 3, 2026

Change

  • Refactor all page objects to adopt Playwright's toPass pattern for navigation and hydration checks, replacing fragile waitForSelector / waitForTimeout usage

    • makes assertions retryable and reduces flakiness caused by timing issues
  • Encapsulate UI interactions (filter menus, form fills, table waits) into page object methods, removing direct page access from specs

    • enforces a consistent POM pattern and improves test maintainability

related: #64024


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    claude

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Apr 3, 2026
@choo121600 choo121600 force-pushed the e2e/03-page-objects-simple-specs branch from 2b5655e to 8fe90da Compare April 3, 2026 09:54
@choo121600 choo121600 changed the title E2E: refactor page objects with toPass resilience and simplify specs Refactor E2E page objects with toPass resilience and simplify specs Apr 3, 2026
@choo121600 choo121600 force-pushed the e2e/03-page-objects-simple-specs branch from 8fe90da to 7e0063b Compare April 3, 2026 12:07
@choo121600
Copy link
Copy Markdown
Member Author

I'll leave this as a draft until the E2E CI is enabled.

@choo121600 choo121600 marked this pull request as draft April 4, 2026 15:21
@choo121600 choo121600 force-pushed the e2e/03-page-objects-simple-specs branch 2 times, most recently from 65b8da3 to 8c9589f Compare April 13, 2026 13:07
@choo121600 choo121600 force-pushed the e2e/03-page-objects-simple-specs branch from 8c9589f to d23cc81 Compare April 14, 2026 03:52
@choo121600 choo121600 marked this pull request as ready for review April 14, 2026 05:22
await expect(async () => {
await this.navigateTo("/assets");
await this.page.waitForURL(/.*assets/, { timeout: 10_000 });
}).toPass({ intervals: [2000], timeout: 60_000 });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need a fully minute?

*/
import { expect } from "@playwright/test";
import type { Page, Locator } from "@playwright/test";
import { waitForServerReady } from "tests/e2e/utils/health";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't need this anymore cause we instead waitUntil: "domcontentloaded". Is that right?

If so, can we just delete waitForServerReady entirely since we're no longer calling it anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants