Skip to content

E2E: Improve Playwright test patterns in task-logs.spec.ts#63971

Closed
Uday-Choudhary wants to merge 2 commits intoapache:mainfrom
Uday-Choudhary:fix/e2e-task-logs-playwright-patterns
Closed

E2E: Improve Playwright test patterns in task-logs.spec.ts#63971
Uday-Choudhary wants to merge 2 commits intoapache:mainfrom
Uday-Choudhary:fix/e2e-task-logs-playwright-patterns

Conversation

@Uday-Choudhary
Copy link
Copy Markdown

Improve Playwright test patterns in specs/task-logs.spec.ts and related page objects to align with Playwright Best Practices.

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

Changes included in this PR:

  • State-based waiting: Removed waitForLoadState("networkidle") in verifyStateFiltering (TaskInstancesPage.ts), relying instead on native expect().toBeVisible() checks for specific UI rendering.
  • Web-first assertions: Converted manual assertions like expect(await rows.count()).toBeGreaterThan(0) to the recommended web-first assertion: await expect(rows).not.toHaveCount(0) in TaskInstancesPage.ts.
  • Flaky check fix: Fixed the "flaky check" in task-logs.spec.ts by explicitly ensuring that logItems.first() has rendered and is visible before running regex checks against the content of the virtualizedList component.
  • Enable Spec: Removed task-logs.spec.ts from the testIgnore array in playwright.config.ts.

closes: #63964
related: #63036

@boring-cyborg
Copy link
Copy Markdown

boring-cyborg bot commented Mar 20, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 20, 2026
Copy link
Copy Markdown
Member

@choo121600 choo121600 left a comment

Choose a reason for hiding this comment

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

Thanks for your first contribution!
It looks like the static check is failing. Could you take a look?

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

Replace anti-patterns with Playwright best practices:
- page.locator('[data-testid="..."]') → page.getByTestId(...)
- .waitFor({ state: "visible" }) → expect(...).toBeVisible()
- waitForLoadState("networkidle") → state-based locator waiting
- Manual count assertions → web-first expect(...).not.toHaveCount(0)
- Remove task-logs.spec.ts from testIgnore list

Closes apache#63964
@Uday-Choudhary Uday-Choudhary force-pushed the fix/e2e-task-logs-playwright-patterns branch from 0b9d243 to 36f23b7 Compare March 20, 2026 13:28
@Uday-Choudhary Uday-Choudhary deleted the fix/e2e-task-logs-playwright-patterns branch March 20, 2026 13:33
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 specs/task-logs.spec.ts

2 participants