Files
bruno/playwright/index.ts
ramki-bruno aa911f88f2 Playwright Codegen and CI setup
- Improved the Codegen setup
  - Removed the app-launch related boilerplate from tests
  - Enable recording mode by default
  - Option to provide the test file name to save the recording
- Added GitHub workflow to run Playwright tests with Electron in
  Headless mode(mocking display using `xvfb`).
2025-05-12 20:35:05 +05:30

24 lines
634 B
TypeScript

import { test as baseTest, ElectronApplication, Page } from '@playwright/test';
const { startApp } = require('./electron.ts');
export const test = baseTest.extend<{ page: Page }, { electronApp: ElectronApplication }>({
electronApp: [
async ({}, use) => {
const { app: electronApp, context } = await startApp();
await use(electronApp);
await context.close();
await electronApp.close();
},
{ scope: 'worker' }
],
page: async ({ electronApp }, use) => {
const page = await electronApp.firstWindow();
await use(page);
await page.reload();
}
});
export * from '@playwright/test'