Files
bruno/playwright/electron.ts
ramki-bruno 577d54b432 Added Playwright test for bruno-testbench, few sanity tests and improvements
- Trace will capture snapshots now
- Added ability to add init Electron user-data, preferences and other
  app settings.
- Improved test Fixtures
  - Use tempdir for Electron user-data
  - Ability to reuse app instance for a given init user-data by placing
    them in a folder(`pageWithUserData` Fixture)
  - Ability to create tests with fresh user-data(`newPage` Fixture)
- Improved logging
- Improved the env vars to customize the Electron user-data-path
2025-05-30 13:57:44 +05:30

18 lines
596 B
TypeScript

const path = require('path');
const { _electron: electron } = require('playwright');
const electronAppPath = path.join(__dirname, '../packages/bruno-electron');
exports.startApp = async () => {
const app = await electron.launch({ args: [electronAppPath] });
const context = await app.context();
app.process().stdout.on('data', (data) => {
process.stdout.write(data.toString().replace(/^(?=.)/gm, '[Electron] |'));
});
app.process().stderr.on('data', (error) => {
process.stderr.write(error.toString().replace(/^(?=.)/gm, '[Electron] |'));
});
return { app, context };
};