Skip to content

Commit 7a6556c

Browse files
rubenvdlindeConduction Release Bot
andauthored
test(e2e): seed the walkthrough marker so the tour cannot intercept clicks (#793)
@conduction/nextcloud-vue 2.22.x made the product walkthrough actually open. A `placement: "center"` welcome step used to be parked in `_pendingAutoTour` and never shown; the library now correctly starts it on any route. Its `cn-walkthrough__dim--full` layer is a `role="dialog" aria-modal="true"` overlay, so every spec that clicks behind it times out, and `getByRole('dialog').first()` resolves to the dim layer rather than the modal under test. The marker is per USER, not per test, so leaving it unseeded also makes the suite order-dependent: whichever spec runs first wears the tour. Seeds the same marker dossiq's global-setup already seeds, with a sentinel above any real app version so the tour composes to an empty step set. Co-authored-by: Conduction Release Bot <release-bot@conduction.nl>
1 parent f813345 commit 7a6556c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

tests/e2e/global-setup.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,40 @@ export default async function globalSetup(config: FullConfig): Promise<void> {
6565
}
6666

6767
// Persist cookies + localStorage for test reuse
68+
/*
69+
* Suppress the product walkthrough (ADR-043) for automated runs, the way
70+
* dossiq's global-setup already does.
71+
*
72+
* This became load-bearing with @conduction/nextcloud-vue 2.22.x. A
73+
* `placement: "center"` welcome step used to be parked in `_pendingAutoTour`
74+
* and never opened; the library now correctly starts it on any route, so the
75+
* tour actually appears — and its `cn-walkthrough__dim--full` layer is a
76+
* `role="dialog" aria-modal="true"` overlay that intercepts every click
77+
* behind it. Specs that had never had to account for a tour started timing
78+
* out, and `getByRole('dialog').first()` began resolving to the dim layer
79+
* instead of the modal under test.
80+
*
81+
* The marker is per USER, not per test, so without it the suite is also
82+
* order-dependent: whichever spec runs first wears the tour and the rest
83+
* inherit a dismissed one.
84+
*
85+
* The sentinel is higher than any real app version, so every step's
86+
* `sinceVersion` sorts below it and the tour composes to an empty step set
87+
* rather than merely starting dismissed. The page is already on the instance
88+
* origin after login, which is the origin storageState persists.
89+
*/
90+
try {
91+
await page.evaluate(() => {
92+
try {
93+
window.localStorage.setItem('cn-walkthrough-seen:stackiq', '999.0.0')
94+
} catch (e) {
95+
// localStorage unavailable — specs fall back to dismissing by hand.
96+
}
97+
})
98+
} catch {
99+
// Never fail setup over an optional convenience.
100+
}
101+
68102
await context.storageState({ path: STORAGE_STATE })
69103
await browser.close()
70104
}

0 commit comments

Comments
 (0)