✨ feat: add video tour functionality with helpers, configuration, and homepage walkthrough
This commit is contained in:
29
video-tours/tours/fixtures.ts
Normal file
29
video-tours/tours/fixtures.ts
Normal 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"
|
||||
Reference in New Issue
Block a user