You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ra...@apache.org on 2026/09/24 15:23:05 UTC
(airflow) branch v3-3-test updated: Fix XComs e2e filter tests: scope the filter input by testid (#72438) (#73666)
This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-3-test by this push:
new ce22fe618d4 Fix XComs e2e filter tests: scope the filter input by testid (#72438) (#73666)
ce22fe618d4 is described below
commit ce22fe618d4379fcd63bf102a7b123fb7ece0ec5
Author: Rahul Vats <43...@users.noreply.github.com>
AuthorDate: Thu Sep 24 20:52:57 2026 +0530
Fix XComs e2e filter tests: scope the filter input by testid (#72438) (#73666)
* 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).
Claude-Session: https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh
* Add newsfragment
Claude-Session: https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh
* Revert "Add newsfragment"
This reverts commit 06fd055afb8fa6f4f3c6b7ea31d5c0920ee850ed.
---------
(cherry picked from commit 0f7f45f674cbd2575c365107f843d2872980760f)
Co-authored-by: Kunal <ku...@gmail.com>
Co-authored-by: Claude <no...@anthropic.com>
Co-authored-by: Kunal8954 <yo...@example.com>
---
.../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);