feat: add video tour functionality with helpers, configuration, and homepage walkthrough

This commit is contained in:
2026-02-26 02:42:16 +00:00
parent 20eaa50935
commit e8fd38e98a
8 changed files with 295 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
import { test as base, type Page } from "@playwright/test"
import { injectVisibleCursor } from "../helpers"
/**
* Extended test fixtures for video tours.
*
* - `tourPage`: A page with visible cursor overlay, ready for recording.
*
* Add project-specific setup (cookie consent, modals, etc.) here.
*/
type TourFixtures = {
tourPage: Page
}
export const tour = base.extend<TourFixtures>({
tourPage: async ({ page }, use) => {
// Inject visible cursor (must be before first goto)
await injectVisibleCursor(page)
// Override navigation to always use domcontentloaded (BrowserSync keeps WS open)
const origGoto = page.goto.bind(page)
page.goto = ((url: string, opts?: any) =>
origGoto(url, { waitUntil: "domcontentloaded", ...opts })) as typeof page.goto
await use(page)
},
})
export { expect } from "@playwright/test"