Skip to content

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

Open
tysoncung wants to merge 1 commit intoapache:mainfrom
tysoncung:fix/63964-improve-playwright-task-logs
Open

fix(ui/e2e): improve Playwright test patterns in task-logs.spec.ts#63990
tysoncung wants to merge 1 commit intoapache:mainfrom
tysoncung:fix/63964-improve-playwright-task-logs

Conversation

@tysoncung
Copy link

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
Copy link

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

1 participant