Skip to content

Instantly share code, notes, and snippets.

@sahmeepee
Created June 20, 2021 18:05
Show Gist options
  • Save sahmeepee/501ff2f13a82c585d5aece653b8f47f8 to your computer and use it in GitHub Desktop.
Save sahmeepee/501ff2f13a82c585d5aece653b8f47f8 to your computer and use it in GitHub Desktop.
VSCode setup for Playwright Test Runner - allows debug of current file
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch all tests 3 browsers",
"request": "launch",
"runtimeArgs": [
"run-script",
"tests3x"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"name": "Launch all tests",
"request": "launch",
"runtimeArgs": [
"run-script",
"test"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"name": "Launch this test",
"request": "launch",
"runtimeArgs": [
"exec",
"playwright",
"test",
// When launched via run-script, any backslashes in args get doubled, breaking
// matching of directory paths in Windows.
// To match on filename only use "${fileBasename}"
"${relativeFile}"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
}
]
}
{
"name": "yourprojectname",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"tests3x": "npm exec playwright -- test --config=playwright-3x.config.js",
"test": "npm exec playwright -- test"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.12.2",
"playwright": "^1.12.2"
}
}
@sahmeepee
Copy link
Author

playwright-3x.config.js would include a 3 browser setup, i.e. 3 elements inside "projects: []"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment