This is an automated email from the ASF dual-hosted git repository. vatsrahul1001 pushed a commit to branch backport-72438-xcoms-e2e-v3-3-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit e675df933fe5f1921698bf1248c8491892ea0262 Author: Kunal <[email protected]> AuthorDate: Fri Sep 4 22:11:30 2026 +0530 Fix XComs e2e filter tests: scope the filter input by testid (#72438) * Fix XComs e2e filter tests: scope the filter input by testid xcoms.spec.ts's filter tests locate the active filter pill's input via page.locator("div").filter({ hasText: `${filterName}:` }), which matches any ancestor whose descendant text contains that string. matches, and .first() no longer reliably picks the actual pill - getByRole("textbox") on it resolves to every textbox inside whichever div wins, throwing "resolved to 12 elements instead of 1". Give the actively-editing pill's input a stable data-testid (filter-pill-input) instead of relying on ancestor text matching, and scope XComsPage.applyFilter() to it directly. Only one pill is ever in edit mode at a time, so the testid alone is enough - no per-filter key plumbing needed. Added a FilterBar test that fails without the fix (verified locally by reverting the testid and confirming the new test - and only that test - breaks). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh * Add newsfragment Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh * Revert "Add newsfragment" This reverts commit 06fd055afb8fa6f4f3c6b7ea31d5c0920ee850ed. --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Kunal8954 <[email protected]> (cherry picked from commit 0f7f45f674cbd2575c365107f843d2872980760f) --- .../ui/src/components/FilterBar/filters/TextSearchFilter.tsx | 1 + airflow-core/src/airflow/ui/tests/e2e/pages/XComsPage.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/airflow-core/src/airflow/ui/src/components/FilterBar/filters/TextSearchFilter.tsx b/airflow-core/src/airflow/ui/src/components/FilterBar/filters/TextSearchFilter.tsx index 09f1c5d3ee4..13c3fb72866 100644 --- a/airflow-core/src/airflow/ui/src/components/FilterBar/filters/TextSearchFilter.tsx +++ b/airflow-core/src/airflow/ui/src/components/FilterBar/filters/TextSearchFilter.tsx @@ -74,6 +74,7 @@ export const TextSearchFilter = ({ filter, onChange, onRemove }: FilterPluginPro renderInput={(props) => ( <InputWithAddon {...props} + data-testid="filter-pill-input" endAddon={ showAdvancedToggle ? ( <AdvancedSearchToggle enabled={advanced.enabled} onToggle={advanced.onToggle} variant="addon" /> diff --git a/airflow-core/src/airflow/ui/tests/e2e/pages/XComsPage.ts b/airflow-core/src/airflow/ui/tests/e2e/pages/XComsPage.ts index 578cf945a0e..f2bb7c8f663 100644 --- a/airflow-core/src/airflow/ui/tests/e2e/pages/XComsPage.ts +++ b/airflow-core/src/airflow/ui/tests/e2e/pages/XComsPage.ts @@ -51,11 +51,12 @@ export class XComsPage extends BasePage { await filterOption.click(); - const filterPill = this.page - .locator("div") - .filter({ hasText: `${filterName}:` }) - .first(); - const filterInput = filterPill.getByRole("textbox"); + // The newly added pill enters edit mode immediately, and `filter-pill-input` is only + // rendered on the pill that is actively being edited — so this resolves to exactly one + // element. Previously this scoped through `page.locator("div").filter({ hasText: ... })`, + // which matches any ancestor whose descendant text contains "<filterName>:" and broke + // (matched 12 elements instead of 1) once #71554 restructured the filter bar's DOM. + const filterInput = this.page.getByTestId("filter-pill-input"); await expect(filterInput).toBeVisible({ timeout: 30_000 }); await filterInput.fill(value);
