-
-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Problem
In browser-driven E2E tests (Playwright, Cypress), I want a deterministic way to test UI states that are driven by async data fetching (loading, error, success). In Nuxt SSR applications, this is difficult to achieve reliably using network interception alone, since initial data is often hydrated from the SSR payload and may not trigger client-side requests.
Pinia Colada devtools already provide excellent controls for forcing these query states during development, but those controls are currently only accessible via the devtools UI. For E2E testing, interacting with the devtools UI directly is brittle and obscures test intent.
Feature request
Expose an opt-in, programmatic API that mirrors the existing Pinia Colada devtools actions and can be invoked headlessly from browser E2E tests.
Motivation
- Enables deterministic E2E testing of loading/error UI states
- Avoids reliance on network timing or interception, especially in SSR contexts
- Aligns E2E testing with existing developer workflows using Colada devtools
- Removes the need to automate clicks in the devtools UI
Conceptual API (illustrative)
// Mirrors the devtools UI actions
// API shape and exposure mechanism are open for discussion
coladaDevtools.actions.simulateLoading(['organizations'])
coladaDevtools.actions.simulateError(['organizations'])
coladaDevtools.actions.reset(['organizations'])
coladaDevtools.actions.invalidate(['organizations'])
coladaDevtools.actions.refetch(['organizations'])Exposure
If <PiniaColadaDevtools> are enabled, globalThis should be decorated with the global namespace.
Open Questions
- What do you think?
- What's a good namespace?
Metadata
Metadata
Assignees
Labels
Projects
Status