UNPKG

@netanelh2/playwright-framework

Version:

A robust Playwright TypeScript testing framework with Page Object Model, smart locators, and utilities

35 lines 1.08 kB
import { test as base } from '@playwright/test'; /** * Base test fixtures that provide consistent browser context and page management. * Users can extend this in their projects to add their specific page objects. * * @example * ```typescript * // In user's project * import { test as baseTest } from '@netanelh2/playwright-framework/fixtures' * import { MainPage } from '../pages/MainPage' * import { LoginPage } from '../pages/LoginPage' * * export const test = baseTest.extend({ * mainPage: async ({page}, use) => { * await use(new MainPage(page)) * }, * loginPage: async ({page}, use) => { * await use(new LoginPage(page)) * }, * }) * ``` */ export const test = base.extend({ context: async ({ browser }, use) => { const context = await browser.newContext(); await use(context); await context.close(); }, page: async ({ context }, use) => { const page = await context.newPage(); await use(page); }, }); export { expect } from '@playwright/test'; //# sourceMappingURL=testSetup.js.map