Skip to content

UI e2e: xcoms.spec.ts filter tests broken #72433

Closed

Description

@ccoliu

Under which category would you file this issue?

Airflow Core

Apache Airflow version

3.3.1

What happened and how to reproduce it?

Description

tests/e2e/specs/xcoms.spec.ts → verify filtering by key pattern and verify filtering by Dag display name fail deterministically on main in Chromium, Firefox, and WebKit. All 4 retry attempts fail with a Playwright strict-mode violation.

This is blocking unrelated PRs' CI (e.g. #72425), since the failure reproduces on main regardless of what the PR changes.

Root cause

airflow-core/src/airflow/ui/tests/e2e/pages/XComsPage.ts, applyFilter():

const filterPill = this.page
  .locator("div")
  .filter({ hasText: `${filterName}:` })
  .first();
const filterInput = filterPill.getByRole("textbox");

await expect(filterInput).toBeVisible({ timeout: 30_000 });

Playwright's hasText filter matches on an element's full rendered text content, including all descendants. Since .filter() matches every div containing the substring "Key:" (or "Dag ID:") anywhere in its subtree, .first() in DOM order now resolves to a large ancestor wrapper rather than the small filter-pill div — so getByRole("textbox") inside it matches every textbox on the page instead of just the filter input.

This appears to have been introduced by #71554 ("UI: Consolidate table controls into a header row above the table", commit 5999abe), which restructured the table-controls DOM so more ancestor divs now contain the filter label text.

Reproduction

Failing run (PR #72425, based on current main):

Chromium: https://github.com/apache/airflow/actions/runs/33610282179/job/100195299938
Firefox: https://github.com/apache/airflow/actions/runs/33610282179/job/100195299429
WebKit: https://github.com/apache/airflow/actions/runs/33610282179/job/100195299536

Playwright error (Chromium):

[chromium] › tests/e2e/specs/xcoms.spec.ts:57:3 › XComs Page › verify filtering by Dag display name
Error: strict mode violation: locator resolved to 12 elements instead of 1
XComsPage.ts:59 getByRole("textbox")

What you think should happen instead?

The filter-pill lookup should be scoped to a specific container (e.g. a data-testid on the pill added in #71554's new header row) instead of page.locator("div").filter({ hasText }), so it can't match arbitrary ancestor wrappers that happen to contain the same text.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Sep 2, 2026
  2. added
    area:UI
    and removed
    needs-triage
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:UIkind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions