
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@web/test-runner-playwright
Advanced tools
Browser launcher for @web/test-runner
. Runs the browser using playwright.
If you are using @web/test-runner, you can run playwright using the --playwright
and --browsers
flags.
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 = {
browsers: [
playwrightLauncher({
// product can be chromium, webkit or firefox
product: 'chromium',
launchOptions: {
executablePath: '/path/to/executable',
headless: false,
args: ['--some-flag'],
},
}),
],
};
For each browser you can add a separate browser launcher
const { playwrightLauncher } = require('@web/test-runner-playwright');
module.exports = {
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
],
};
You can use a custom function to create the puppeteer Page
. You can use this for example to set up injecting scripts for environment variables or to expose functions to the browser to control the page.
const { playwrightLauncher } = require('@web/test-runner-playwright');
module.exports = {
browsers: [
playwrightLauncher({
async createPage({ browser, config }) {
const page = await browser.newPage();
// expose global variabels in the browser
page.addInitScript(() => {
window.__GLOBALS__ = { globalA: 'a', globalB: 'b' };
});
// expose a function in the browser, which calls a function on the
// playwright page in NodeJS
page.exposeFunction('playwrightScreenshot', () => {
page.screenshot();
});
return page;
},
}),
],
};
FAQs
Playwright browser launcher for Web Test Runner
The npm package @web/test-runner-playwright receives a total of 36,296 weekly downloads. As such, @web/test-runner-playwright popularity was classified as popular.
We found that @web/test-runner-playwright demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.