Skip to content

feat: Replace Playwright anti-patterns with web-first assertions in dag-list#63559

Merged
choo121600 merged 20 commits into
apache:mainfrom
Crystora:feat/e2e-improve-playwright-patterns-dags-list
Mar 19, 2026
Merged

feat: Replace Playwright anti-patterns with web-first assertions in dag-list#63559
choo121600 merged 20 commits into
apache:mainfrom
Crystora:feat/e2e-improve-playwright-patterns-dags-list

Conversation

@Crystora

@Crystora Crystora commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Replace Playwright anti-patterns with web-first assertions in dags-list.spec.ts and DagsPage.ts to align with Playwright best practices. No test coverage or behavior changes.

  • Remove all waitForTimeout() calls - replaced with state-based waiting (expect().toBeVisible/Hidden/toHaveCount, waitForResponse)
  • Replace CSS :has-text() and locator("text=") with getByRole(), getByTestId(), and .filter({ hasText: })
  • Convert boolean-returning verify methods (verifyDagExists, verifyCardViewVisible, verifyTableViewVisible) to Promise<void> with web-first expect() assertions
  • Replace while loop + waitForTimeout polling in verifyDagRunStatus with expect.poll()
  • Fix broken needsReviewFilter selector (button:has-text("Needs Review")getByTestId("dags-needs-review-filter"))

closes: #63426

Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code, claude-sonnet-4-6)

Generated-by: Claude Code (claude-sonnet-4-6) following the guidelines

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 13, 2026
@Crystora

Copy link
Copy Markdown
Contributor Author

@choo121600 Please review this PR. Welcome to any feedback!

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like the static check is failing.
You might find the following guide helpful in resolving it :)

https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst

@Crystora Crystora requested a review from choo121600 March 14, 2026 08:16
@Crystora

Copy link
Copy Markdown
Contributor Author

@choo121600 Please re-run test again.

@Crystora

Copy link
Copy Markdown
Contributor Author

@choo121600 could you review and test again?

Comment thread airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts Outdated

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks good 👍
just one

Comment thread airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts Outdated
@Crystora

Copy link
Copy Markdown
Contributor Author

Thanks @choo121600 I updated! Please review again

@Crystora

Copy link
Copy Markdown
Contributor Author

@choo121600 These testings don't seem to relate to my code changes. I'd appreciate you review that log and give me feedbacks.

@choo121600

Copy link
Copy Markdown
Member

You can reproduce and debug this locally using the following command:

breeze testing ui-e2e-tests --test-pattern "dags-list.spec.ts" --browser webkit --workers 2

Comment thread airflow-core/src/airflow/ui/tests/e2e/pages/DagsPage.ts Outdated
@choo121600 choo121600 changed the title feat: Replace Playwright anti-patterns with web-first assertions in drag-list feat: Replace Playwright anti-patterns with web-first assertions in dag-list Mar 18, 2026
@Crystora

Crystora commented Mar 18, 2026

Copy link
Copy Markdown
Contributor Author

@choo121600 I updated. Please review the testing failure log. I think it doesn't seem to relate to my changes.

@Crystora Crystora requested a review from choo121600 March 19, 2026 04:33

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like the static check is failing.

@Crystora

Crystora commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

@choo121600 please review again. Testing passed. thanks

@choo121600 choo121600 merged commit 2337d80 into apache:main Mar 19, 2026
81 checks passed
@choo121600

Copy link
Copy Markdown
Member

Cool, Thanks 🎉

@Crystora Crystora deleted the feat/e2e-improve-playwright-patterns-dags-list branch March 19, 2026 12:25
fat-catTW pushed a commit to fat-catTW/airflow that referenced this pull request Mar 22, 2026
…ag-list (apache#63559)

* E2E: Replace Playwright anti-patterns with web-first assertions in dags-list

* fix: solve PROD Image test error

* fix: Fix remaining Playwright anti-patterns in DagsPage

* fix: fix lint error

* fix: Update stale breeze command output hash

* fix: Use getByRole for card/table view toggle buttons

* fix: Replace fragile state locator with data-testid and remove redundant .catch() wrappers

* fix: update

* fix: use data-testid and data-state assertions

* fix: solve testing error

* update

* update

* fix hook format
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
…ag-list (apache#63559)

* E2E: Replace Playwright anti-patterns with web-first assertions in dags-list

* fix: solve PROD Image test error

* fix: Fix remaining Playwright anti-patterns in DagsPage

* fix: fix lint error

* fix: Update stale breeze command output hash

* fix: Use getByRole for card/table view toggle buttons

* fix: Replace fragile state locator with data-testid and remove redundant .catch() wrappers

* fix: update

* fix: use data-testid and data-state assertions

* fix: solve testing error

* update

* update

* fix hook format
abhijeets25012-tech pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Apr 9, 2026
…ag-list (apache#63559)

* E2E: Replace Playwright anti-patterns with web-first assertions in dags-list

* fix: solve PROD Image test error

* fix: Fix remaining Playwright anti-patterns in DagsPage

* fix: fix lint error

* fix: Update stale breeze command output hash

* fix: Use getByRole for card/table view toggle buttons

* fix: Replace fragile state locator with data-testid and remove redundant .catch() wrappers

* fix: update

* fix: use data-testid and data-state assertions

* fix: solve testing error

* update

* update

* fix hook format
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.

E2E: Improve Playwright test patterns in dags-list.spec.ts

3 participants