Need to run many scenarios at one instance without relaunching the browser. How to do it?
helpers: { Playwright: { browser: 'chromium', url: '***', show: true, keepBrowserState: true, // This ensures cookies and session are maintained across scenarios restart: false, // Prevents browser from restarting after each scenario keepCookies: true, } }
I have given restart as 'false' but still the browser is getting relaunched after every scenario
hey @FathimaAfshan, have you found out the answer? I have the same issue
Pls try with restart:‘keep’ @FathimaAfshan @tomaszHut42
hey @FathimaAfshan, indeed I fixed it for myself using restart:‘keep’ (and keepBrowserState and keepCookies set to true as well). Additionally, my issue was I used I.amOnPage('/') in the Background section, which caused the browser to reload (not close the window, but reload the page, which also broke my test workflow). The best results gave me config as aforementioned and setting a flag in Before hook:
let pageLoaded = false;
Before(({ I }) => {
if (!pageLoaded) {
I.amOnPage('/');
pageLoaded = true;
}
});
This issue is stale because it has been open for 90 days with no activity.