Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Playwright Test SnippetsNew to Visual Studio Code? Get it now.
Playwright Test Snippets

Playwright Test Snippets

Mark Skelton

|
24,705 installs
| (0) | Free
Useful snippets for the Playwright test runner.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Playwright Snippets

Build status Extension version Extension installs Semantic release

Playwright test snippets for VS Code.

Snippets

The following snippets are provided by this package. If you have ideas of other snippets that would be helpful, please open an issue.

Test blocks

pw-describe

test.describe('$1', () => {
  $0
})

pw-test

test('$1', async ({ page }) => {
  $0
})

pw-beforeEach

test.beforeEach(async ({ page }) => {
  $0
})

pw-afterEach

test.afterEach(async ({ page }) => {
  $0
})

pw-beforeAll

test.beforeAll(async ({ browser }) => {
  $0
})

pw-afterAll

test.afterAll(async ({ browser }) => {
  $0
})

pw-step

await test.step('$1', async () => {
  $0
})

pw-use

test.use({ $0 })

Lariat

Lariat is a Playwright page object framework that simplifies page object construction. We've included some useful Lariat snippets as part of this extension.

pw-collection

import Collection from 'lariat'

export class MyPage extends Collection {
  $0
}

pw-page-object

import { Page } from '@playwright/test'
import Collection from 'lariat'

export class MyPage extends Collection {
  constructor(page: Page) {
    super(page.locator('$1'))
  }

  $0
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft