Skip to content

Improve Playwright test patterns in dag-tasks.spec.ts#63445

Merged
choo121600 merged 2 commits into
apache:mainfrom
Daedalus-Icarus:fix/improve-playwright-dag-tasks-patterns
Mar 20, 2026
Merged

Improve Playwright test patterns in dag-tasks.spec.ts#63445
choo121600 merged 2 commits into
apache:mainfrom
Daedalus-Icarus:fix/improve-playwright-dag-tasks-patterns

Conversation

@Daedalus-Icarus

Copy link
Copy Markdown
Contributor

Improve Playwright test patterns in dag-tasks.spec.ts

Replace anti-patterns in DagsPage.ts and dag-tasks.spec.ts with
Playwright best practices:

  • Replace CSS :has-text() selectors with getByRole() user-facing locators
  • Replace page.locator('[data-testid="..."]') with page.getByTestId("...")
  • Replace page.waitForTimeout() with state-based waits
  • Replace locator("a") with getByRole("link")
  • Replace locator('div[role="listbox/option"]') with getByRole()
  • Replace .waitFor({ state: "visible" }) with expect().toBeVisible()
  • Replace .dispatchEvent("click") with .click()
  • Replace locator("table") / locator("th") with getByRole("table") / getByRole("columnheader")

This PR focuses on improving test patterns only. It does not change test
coverage or behavior.

Part of #63036.
closes: #63425


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

  • 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 Mar 12, 2026
@Daedalus-Icarus

Copy link
Copy Markdown
Contributor Author

Hi @choo121600, could you please review this PR and let me know if you have any feedback?

@Daedalus-Icarus

Copy link
Copy Markdown
Contributor Author

@choo121600 Is it okay if I pick up more issues?

@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 CI is failing. Could you take a look?

@choo121600

Copy link
Copy Markdown
Member

You can also run and debug the tests locally using the files here:
https://github.com/apache/airflow/tree/main/airflow-core/src/airflow/ui/tests/e2e

@Daedalus-Icarus

Copy link
Copy Markdown
Contributor Author

@choo121600 I saw that #63559 was merged and it already addresses the pages/DagsPage.ts pattern, so I removed my changes in that file and kept only the change in specs/dag-tasks.spec.ts
Please review this PR

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

Nice, LGTM!
Thanks ;)

@choo121600 choo121600 merged commit 07c3d07 into apache:main Mar 20, 2026
81 checks passed
fat-catTW pushed a commit to fat-catTW/airflow that referenced this pull request Mar 22, 2026
… dag-tasks (apache#63445)

Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
… dag-tasks (apache#63445)

Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
abhijeets25012-tech pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Apr 9, 2026
… dag-tasks (apache#63445)

Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
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 dag-tasks.spec.ts

2 participants