mirror of
https://github.com/usebruno/bruno.git
synced 2025-08-12 13:38:01 +02:00
- 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
18 lines
596 B
TypeScript
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 };
|
|
};
|