sadpandajoe opened a new pull request, #41435:
URL: https://github.com/apache/superset/pull/41435

   ### SUMMARY
   
   Migrates the Cypress "nativefilter url param key" suite 
(`cypress-base/.../dashboard/key_value.test.ts`) to the existing Playwright 
framework, as part of the ongoing Cypress → Playwright migration.
   
   When a dashboard with native filters loads, the filter bar publishes its 
data mask to the server-side `filter_state` key-value store and stamps the 
returned key into the URL as `native_filters_key`. This is genuinely full-stack 
(the key is minted by a real server round-trip and persisted server-side), so 
it stays an E2E test — but it is strengthened from the original's URL-sniffing 
into a round-trip assertion:
   
   - A `POST /api/v1/dashboard/<id>/filter_state` mints the key, and that key 
lands in the URL.
   - The key resolves server-side: `GET 
/api/v1/dashboard/<id>/filter_state/<key>` returns the stored data mask (200). 
A client-only token would not resolve.
   - Reloading reuses the same resolvable key for the session/tab.
   
   The dashboard is built **hermetically** (one native filter + one chart on 
`birth_names`), replacing the original's dependency on the seeded 
`world_health` dashboard, whose example charts are flaky under load.
   
   **Correction to the original suite:** its second case ("should have 
different key when page reloads") was non-functional — it compared 
`native_filters_key` against an `initialFilterKey` variable that was declared 
but never assigned, so it asserted against `undefined` and always passed 
vacuously. The real backend contract (`CreateFilterStateCommand`) reuses the 
existing key for a given `(session, tab, dashboard)` via a contextual cache, so 
this migration asserts the **true** behaviour (reuse) rather than the bug it 
inherited.
   
   Also adds reusable `DashboardPage.getNativeFiltersKey()` / 
`waitForNativeFiltersKey()` page-object helpers.
   
   ### BEFORE/AFTER
   
   N/A — test-only change.
   
   ### TESTING INSTRUCTIONS
   
   From `superset-frontend/`, against a running stack:
   
   ```
   PLAYWRIGHT_BASE_URL=http://localhost:<port> PLAYWRIGHT_ADMIN_PASSWORD=<pw> \
     npx playwright test --project=chromium 
dashboard/dashboard-native-filter-url-key.spec.ts
   ```
   
   Passes locally (3/3 with `--repeat-each=3`).
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to