Skip to content

test(dashboard): migrate native filter cross-filter/dependency E2E to Playwright - #41458

Draft
sadpandajoe wants to merge 1 commit into
masterfrom
dashboard-pw-nativefilters
Draft

test(dashboard): migrate native filter cross-filter/dependency E2E to Playwright#41458
sadpandajoe wants to merge 1 commit into
masterfrom
dashboard-pw-nativefilters

Conversation

@sadpandajoe

Copy link
Copy Markdown
Member

SUMMARY

Migrates the native-filter cross-filter / dependency E2E coverage from the deprecated Cypress suite to the Playwright framework. As with the other dashboard migrations in this series, only true end-to-end behaviours (API-created resources rendered in a real browser, asserting real backend round-trips) are migrated. Coverage that is purely client-side modal state is relocated to the React Testing Library component suite, and a small amount of removal-trigger coverage is intentionally narrowed (see ledger).

Filter dependencies are configured through the dashboard API (cascadeParentIds in native_filter_configuration) and the tests then drive only the filter bar in the browser. This keeps the tests true E2E while avoiding the deprecated native-filter configuration modal entirely.

Migrated E2E tests (5)

  1. Dependent filter narrows its options to the selected parent — selecting a region narrows the dependent country filter's options to exactly the countries in that region.
  2. Dependent filter auto-selects the first item when its parent changes (defaultToFirstItem).
  3. Filter depending on two parents narrows by both selections.
  4. Applying a value filter re-queries the target chart — asserts the chart's POST /api/v1/chart/data count drops after the filter is applied.
  5. Default filter value is respected after a reload — revives a previously it.skip-ped Cypress case.

MIGRATION LEDGER

Every Cypress case from the source files is classified below.

Bucket 1 — Migrated to Playwright E2E (5): the five tests above (dependent narrowing, auto-first-item, two-parent dependency, apply-value re-query, default-after-reload).

Bucket 2 — Relocated to component suite, no round-trip lost: config-modal mechanics that assert client-side state only — add/reorder filters in the config modal, bi-directional dependency prevention (cycle check), numerical range display modes, filter tooltips, undo / restore / cancel, the filter-has-default checkbox, sidebar expand/retract, edit pop-up. These never hit the backend; they are better and faster as RTL component tests.

Bucket 3 — Scope-narrowed, round-trip coverage dropped (2): stop filtering when a filter is removed and remove parent filters. These do assert a backend round-trip (chart re-queries after a filter is removed), but their only trigger is deleting a filter through the deprecated config modal this migration avoids. There is no filter-bar path to reproduce them as true E2E, and under RTL the backend is mocked so the round-trip assertion would be lost. They are therefore a deliberate scope reduction, flagged here for objection — if we'd rather keep them, the alternative is a modal-delete helper that drives the deprecated UI.

Covered elsewhere: add a new filter is exercised by the add-filter migration in the sibling PR in this series.

Upstream-skipped: time-range and column-filter cases were already it.skip in the Cypress sources and are not revived here.

BEFORE/AFTER

Before: native-filter dependency coverage lived in the deprecated Cypress suite. After: true E2E dependency coverage runs in Playwright; client-side modal coverage is tracked for the RTL component suite.

TESTING INSTRUCTIONS

cd superset-frontend
npx playwright test playwright/tests/dashboard/native-filters.spec.ts

ADDITIONAL INFORMATION

  • Has associated issue
  • Required feature flags: n/a (native filters are GA)
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.20%. Comparing base (894c019) to head (84cc88f).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41458      +/-   ##
==========================================
- Coverage   65.25%   65.20%   -0.05%     
==========================================
  Files        2793     2791       -2     
  Lines      157249   156853     -396     
  Branches    35945    35885      -60     
==========================================
- Hits       102610   102279     -331     
+ Misses      52663    52620      -43     
+ Partials     1976     1954      -22     
Flag Coverage Δ
javascript 71.13% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sadpandajoe
sadpandajoe force-pushed the dashboard-pw-nativefilters branch from e70576c to b5aa0f8 Compare June 26, 2026 19:21
@netlify

netlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 84cc88f
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a6104b23368d200080100ad
😎 Deploy Preview https://deploy-preview-41458--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sadpandajoe
sadpandajoe force-pushed the dashboard-pw-nativefilters branch 2 times, most recently from f74a343 to 982028d Compare July 7, 2026 14:11
… Playwright

Migrate the backend-round-trip behaviours from the deprecated Cypress
nativeFilters specs to Playwright. Filter dependencies are configured via the
dashboard's native_filter_configuration (cascadeParentIds) and driven through
the filter bar only, so no deprecated native-filter edit modal is touched.

Covers: dependent filter option narrowing, default-to-first-item resolution,
a filter depending on two parents, value filters re-querying target charts,
and default values persisting across a reload.

Modal-only flows (config-modal create/delete/reorder, bi-directional
dependency prevention, numerical range display modes, tooltips, undo/cancel)
assert client-side state with no backend round-trip and are left to the React
Testing Library component suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sadpandajoe
sadpandajoe force-pushed the dashboard-pw-nativefilters branch from 982028d to 84cc88f Compare July 22, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant