[Feature] Allow to set launchPersistentContext in playwright.config file
See original GitHub issueOn one of our projects, we need to run tests with extensions. To launch extensions, we have to set browserType.launchPersistentContext
in the beforeAll
section of each test.
It would be convenient to set launchPersistentContext
in a playwright.config
file, for instance:
use: {
launchPersistentContext: {
userDataDir: '/tmp/test-user-data-dir',
args: [
`--disable-extensions-except=${path.join(__dirname, './my-extension')}`,
`--load-extension=${path.join(__dirname, './my-extension')}`
]
}
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:74
- Comments:9 (1 by maintainers)
Top Results From Across the Web
BrowserType | Playwright - CukeTest
BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a typical example of using...
Read more >Use launchPersistentContext in Playwright Internal With ...
Learn how to use launchPersistentContext function in Playwright Internal framework for your next JavaScript automation project with LambdaTest Automation ...
Read more >Releases - CodeceptJS
Update codecept.conf.js to get intellisense when writing config file: ... set timeout for every test in suite to 10 secs Feature('tests with timeout', ......
Read more >Playwright for - Go Packages
Package playwright is a library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web ...
Read more >How to load a chrome extension in playwright - Petros Kyriakou
This will create a playwright.config.js (or .ts) file and a few ... So make sure testDir in playwright.config.js(or .ts) is set to your ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@schmkr Extension should be unpacked. Here is an example:
Yesterday, I also started an attempt to use Playwright Test for writing E2E tests for a Chrome Extension. But because the browser (by default) is launched in incognito, extensions don’t work.
It would be very helpful if it was made possible to define the browser(s) to launch with a persistent context. And/or in a more generic way, if it was possible to add a way to use a (factory) function that returns a browser instance upon invoking. Something like:
@serembon I would be interested in how you set the
browserType.launchPersistentContext
in thebeforeAll
section of each test. Could you show an example?