Skip to content

Instantly share code, notes, and snippets.

@NoriSte
Created June 23, 2022 08:03
Show Gist options
  • Save NoriSte/393751393a8e163df2b68232c7efe29f to your computer and use it in GitHub Desktop.
Save NoriSte/393751393a8e163df2b68232c7efe29f to your computer and use it in GitHub Desktop.
Launch the cursor-highlighted Playwright in VSCode

Referring to this tweet, when I said that you have to run a Playwright test through the CLI, Denb, on the ItaliaJS Discord channel, shared this VSCode cuustom task with me that allows launching specifically the test the cursor is pointing.

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "testCurrentFileByLine",
"type": "shell",
"command": "npx playwright test --headed --workers=1 ${file}:${lineNumber}",
"group": "test",
"presentation": {
"reveal": "always",
"showReuseMessage": false
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment