Web Test Runner Playwright
Browser launcher for @web/test-runner
. Runs the browser using playwright.
Usage
If you are using @web/test-runner, you can run playwright using the --playwright
and --browsers
flags.
Customizing launcher options
If you want to customize the playwright launcher options, you can add the browser launcher in the config.
You can find all possible launch options in the official documentation
const { playwrightLauncher } = require('@web/test-runner-playwright');
module.exports = {
browwsers: [
playwrightLauncher({
product: 'chromium',
launchOptions: {
executablePath: '/path/to/executable',
headless: false,
args: ['--some-flag'],
},
}),
],
};
Testing multiple browsers
For each browser you can add a separate browser launcher
const { playwrightLauncher } = require('@web/test-runner-playwright');
module.exports = {
browwsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
],
};