Skip to content

fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts#63990

Merged
choo121600 merged 2 commits into
apache:mainfrom
tysoncung:fix/63964-improve-playwright-task-logs
Mar 24, 2026
Merged

fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts#63990
choo121600 merged 2 commits into
apache:mainfrom
tysoncung:fix/63964-improve-playwright-task-logs

Conversation

@tysoncung

Copy link
Copy Markdown
Contributor

Problem

task-logs.spec.ts uses page.locator('[data-testid="..."]') instead of Playwright's built-in getByTestId() method, which is the recommended approach per Playwright best practices.

The spec is also currently in the testIgnore list.

Solution

Changes in task-logs.spec.ts:

  • Replace page.locator('[data-testid="..."]') with page.getByTestId() (6 occurrences)
  • Replace page.locator('[data-testid^="virtualized-item-"]') with page.getByTestId(/^virtualized-item-/) regex pattern

Changes in playwright.config.ts:

  • Remove task-logs.spec.ts from testIgnore list

Files Changed

  • airflow-core/src/airflow/ui/tests/e2e/specs/task-logs.spec.ts
  • airflow-core/src/airflow/ui/playwright.config.ts

Checklist

  • page.waitForFunction() with DOM queries → N/A (not present)
  • page.waitForTimeout() → N/A (not present)
  • waitForLoadState("networkidle") → N/A (not present)
  • Manual assertions → N/A (already uses web-first assertions)
  • page.evaluate() for DOM manipulation → N/A (not present)
  • CSS :has-text() → N/A (not present)
  • Remove from ignore spec list ✅

Part of #63036
Closes #63964

…pache#63964)

Replace Playwright anti-patterns with best practices in task-logs spec.

Changes in task-logs.spec.ts:
- Replace locator('[data-testid="..."]') with getByTestId() (6 occurrences)
- Replace locator('[data-testid^="virtualized-item-"]') with
  getByTestId(/^virtualized-item-/) regex pattern

Changes in playwright.config.ts:
- Remove task-logs.spec.ts from testIgnore list

closes apache#63964
@boring-cyborg

boring-cyborg Bot commented Mar 20, 2026

Copy link
Copy Markdown

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

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

The current CI failure doesn’t seem related to your changes. I’ll rerun it :)

@choo121600 choo121600 closed this Mar 22, 2026
@choo121600 choo121600 reopened this Mar 22, 2026
@eladkal

eladkal commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@choo121600 is this PR ready to be merged?

@choo121600

Copy link
Copy Markdown
Member

@choo121600 is this PR ready to be merged?

Oops, I missed this pr 😅
Thanks! This looks good to merge.

@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, this looks good 👍
However, due to another issue with this part, I’ll keep it disabled for now.
Thanks for the contribution!

Comment thread airflow-core/src/airflow/ui/playwright.config.ts
@choo121600 choo121600 merged commit cb2c5e6 into apache:main Mar 24, 2026
3 checks passed
@boring-cyborg

boring-cyborg Bot commented Mar 24, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

vatsrahul1001 pushed a commit that referenced this pull request Mar 25, 2026
…63990)

* fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts (#63964)

Replace Playwright anti-patterns with best practices in task-logs spec.

Changes in task-logs.spec.ts:
- Replace locator('[data-testid="..."]') with getByTestId() (6 occurrences)
- Replace locator('[data-testid^="virtualized-item-"]') with
  getByTestId(/^virtualized-item-/) regex pattern

Changes in playwright.config.ts:
- Remove task-logs.spec.ts from testIgnore list

closes #63964

* Update airflow-core/src/airflow/ui/playwright.config.ts

---------

Co-authored-by: Tyson Cung <tysoncung@example.com>
Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Mar 30, 2026
…pache#63990)

* fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts (apache#63964)

Replace Playwright anti-patterns with best practices in task-logs spec.

Changes in task-logs.spec.ts:
- Replace locator('[data-testid="..."]') with getByTestId() (6 occurrences)
- Replace locator('[data-testid^="virtualized-item-"]') with
  getByTestId(/^virtualized-item-/) regex pattern

Changes in playwright.config.ts:
- Remove task-logs.spec.ts from testIgnore list

closes apache#63964

* Update airflow-core/src/airflow/ui/playwright.config.ts

---------

Co-authored-by: Tyson Cung <tysoncung@example.com>
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
…pache#63990)

* fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts (apache#63964)

Replace Playwright anti-patterns with best practices in task-logs spec.

Changes in task-logs.spec.ts:
- Replace locator('[data-testid="..."]') with getByTestId() (6 occurrences)
- Replace locator('[data-testid^="virtualized-item-"]') with
  getByTestId(/^virtualized-item-/) regex pattern

Changes in playwright.config.ts:
- Remove task-logs.spec.ts from testIgnore list

closes apache#63964

* Update airflow-core/src/airflow/ui/playwright.config.ts

---------

Co-authored-by: Tyson Cung <tysoncung@example.com>
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
…pache#63990)

* fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts (apache#63964)

Replace Playwright anti-patterns with best practices in task-logs spec.

Changes in task-logs.spec.ts:
- Replace locator('[data-testid="..."]') with getByTestId() (6 occurrences)
- Replace locator('[data-testid^="virtualized-item-"]') with
  getByTestId(/^virtualized-item-/) regex pattern

Changes in playwright.config.ts:
- Remove task-logs.spec.ts from testIgnore list

closes apache#63964

* Update airflow-core/src/airflow/ui/playwright.config.ts

---------

Co-authored-by: Tyson Cung <tysoncung@example.com>
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 specs/task-logs.spec.ts

3 participants