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

   ### SUMMARY
   
   Migrates the Cypress dashboard **edit-mode** tests to Playwright as part of 
the ongoing Cypress → Playwright E2E migration.
   
   Ports the `Components` block of 
`cypress-base/cypress/e2e/dashboard/editmode.test.ts` — the drag-and-drop 
workflows that the upstream Cypress notes explicitly flagged as the one part of 
edit mode that genuinely needs E2E coverage (*"Chart drag/drop functionality 
requires true E2E testing"*):
   
   - **add a chart** to the dashboard via drag-and-drop
   - **remove an added chart** (drag in, then delete the component)
   - **add a markdown component** (drag in, edit the source in the Ace editor, 
commit, and resize)
   
   Key design points:
   
   - The dashboard grid uses **react-dnd with the HTML5 backend**, which 
listens for native `dragstart`/`dragenter`/`dragover`/`drop` events rather than 
the mouse events Playwright's built-in `dragTo()` produces. A new 
`helpers/dnd.ts` drives the drag with synthetic native events threaded through 
a single shared `DataTransfer` handle (mirroring the deprecated Cypress 
synthetic-drag helper).
   - Tests are **hermetic**: charts and dashboards are created from the 
`birth_names` dataset via the API and torn down by the existing `testAssets` 
fixture — no reliance on seeded example dashboards.
   - Reuses the existing framework: `DashboardPage` page object (extended with 
edit-mode helpers), the `testWithAssets` fixture, and the API helpers.
   
   **Not migrated (by design):** the 21 skipped `Color consistency` tests in 
the same Cypress file. They assert per-series colors by reading an 
`.nv-legend-symbol` SVG `fill` attribute that no longer exists — ECharts 
renders to a `<canvas>`, which is not DOM-inspectable, which is exactly why the 
upstream `FIXME` skipped them. That color-precedence logic is covered by 
Jest/RTL unit tests, so forcing it into E2E would be a component test posing as 
E2E.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — test-only change.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   # against a running Superset instance
   PLAYWRIGHT_BASE_URL=http://localhost:8088 PLAYWRIGHT_ADMIN_PASSWORD=admin \
     npx playwright test edit-mode-components --project=chromium
   ```
   
   All three tests pass; verified stable under parallel load (`--workers=3 
--repeat-each=3`, 9/9).
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   - [x] Test-only change (Cypress → Playwright E2E migration)
   


-- 
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