Added Playwright-codegen setup

This commit is contained in:
ramki-bruno
2025-04-01 17:39:28 +05:30
committed by Anoop M D
parent cd3c66cb14
commit 4c1d3b4f3a
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
const path = require('path');
const timer = require('node:timers/promises');
const { _electron: electron } = require('playwright');
const electronAppPath = path.join(__dirname, '../packages/bruno-electron');
(async () => {
const browser = await electron.launch({ args: [electronAppPath] });
const context = await browser.context();
await context.route('**/*', (route) => route.continue());
while (true) {
if(browser.windows().length) break;
await timer.setTimeout(200);
}
await browser.windows()[0].pause();
})();