README.md

May 9, 2026 · View on GitHub

Playwright Studio

Playwright Studio logo

Version CI License

The Playwright IDE that actually feels like an IDE.

Inline tag filters · multi-project picker · environment profiles · coverage heatmap ·
fixture Go-to-Definition · save-as-snippet · 338 typed snippets — and the rest of what you'd expect.

Preview of Playwright Studio inside VS Code


Why Playwright Studio?

If you already use Microsoft's official Playwright Test for VS Code, you have run / debug / inspect / codegen / trace. Playwright Studio adds the layer on top — the things you also want every day.

Playwright Test for VS Code (Microsoft)Playwright Studio
Run / Debug / Inspect from CodeLens
Codegen launcher
Trace Viewer & HTML Report shortcuts
Inline @tag filter lenses on each test
Multi-project picker (chromium, firefox, …)
Environment profile switcher (status bar)
Coverage heatmap — find untested code
Fixture Go-to-Definition + Hover
Save selected code as a reusable snippet
338 typed snippets (page, locator, assert, …)
Live results panel + gutter icons + diagnostics

You can run both extensions side-by-side — they don't conflict.


Features

CodeLens Test Runner

Open any Playwright spec file and get inline actions on every test and suite:

Run All   Debug All   Inspect All   $(tag) Run with Tag   $(layers) Run with Project
──────────────────────────────────────────────────────────────────────────────────────
Run       Debug       Inspect       @smoke  @regression
Run Suite Debug Suite Inspect Suite
  • Run / Debug / Inspect at the file, suite, and individual test level.
  • Run with Tag — filter by @tag found in test names, or enter a custom regex grep pattern.
  • Run with Project — pick one or more projects from your playwright.config.ts (e.g. chromium, firefox, webkit).
  • Per-test tag lenses appear automatically when your test name contains @tags.

Live Test Results Panel

After each run a Playwright Results tree appears in the Explorer sidebar:

  • Tests grouped by file with pass / fail counts.
  • Click any test node to jump directly to its source line.
  • Failed tests show their error message as a tooltip.
  • Tests with an attached trace file show an "Open Trace" action.

Result capture is on by default. The first time the extension activates against a workspace whose playwright.config.* is missing the json reporter, it offers a one-click "Add JSON reporter" button — the config is patched safely and the panel starts working. You can re-run the prompt any time via Command Palette → Playwright Studio: Set Up Result Capture (Add JSON Reporter).

Then just run tests through the extension (CodeLens, right-click menu, or Command Palette). See Troubleshooting if the panel stays empty.


Gutter Decorations & Failure Diagnostics

Pass/fail status is shown inline after every test run:

IconMeaning
🟢 Green circleTest passed
🔴 Red circleTest failed / timed out
⚫ Grey circleTest skipped
🟠 Orange circleTest flaky
  • Overview ruler in the scrollbar highlights failures and flaky tests at a glance.
  • Diagnostics (squiggles) appear on failed tests with the first line of the error message.
  • When a trace file is attached to the failure, the diagnostic code link opens the Trace Viewer directly.

Status Bar — Last Run Summary & Env Profile

Last run summary appears in the status bar after each run:

$(pass) 24 passed      ← click to open HTML report
$(error) 21 passed  3 failed

Environment profile switcher shows the active profile next to it:

$(server-environment) staging    ← click to switch profile

Configure profiles in settings:

"playwrightSnippets.envProfiles": {
  "staging":    { "BASE_URL": "https://staging.example.com" },
  "production": { "BASE_URL": "https://example.com" }
}

Switch profiles via the status bar or Playwright Studio: Switch Environment Profile from the Command Palette. The Playwright terminal is automatically recreated with the new environment.


Coverage Heatmap — Find Untested Code

Tests that have never been run (or not run within the configured threshold) are highlighted with a subtle amber background and an inline never run label.

  • Threshold is configurable via playwrightSnippets.heatmapThresholdDays (default: 7 days).
  • Hover over a highlighted test to see when it was last run.
  • Decorations update automatically after each test run.

Fixture Navigation — Go to Definition & Hover

Playwright fixtures are first-class citizens:

  • Ctrl+Click (Go to Definition) on any fixture name in a test callback jumps to where it is defined in your fixture file.
  • Hover over a fixture name shows which file and line it is defined on.
  • The fixture index is built automatically by scanning workspace files that use .extend(.

Save Selection as Snippet

Capture any code block as a personal snippet:

  1. Select code in the editor.
  2. Right-click → Playwright Studio: Save Selection as Snippet.
  3. Enter a prefix (the shortcut you'll type) and a name.
  4. The snippet is saved to playwright-custom.code-snippets in your VS Code user folder and is immediately available in all projects.

Trace Viewer & HTML Report

  • Show Trace Viewer — pick a .zip trace file via file dialog, or click the trace link from a failure diagnostic.
  • Show HTML Report — opens the Playwright HTML report, also clickable from the status bar summary.

Code Generation

  • Open Codegen — launches playwright codegen with an optional start URL. Record browser interactions and paste generated selectors straight into your test.

Command Palette Reference

CommandDescription
Playwright Studio: Run TestRun a single test (prompts if none selected)
Playwright Studio: Run All Tests in FileRun every test in the active file
Playwright Studio: Debug TestRun a test in debug mode
Playwright Studio: Debug All Tests in FileDebug all tests in the active file
Playwright Studio: Inspect Test (PWDEBUG=1)Open Playwright Inspector for a test
Playwright Studio: Inspect All Tests in FileInspect all tests in the active file
Playwright Studio: Debug Test with InspectorCombined debug + inspector
Playwright Studio: Run Test at CursorRun the test surrounding the cursor
Playwright Studio: Run Tests with Tag / Grep FilterFilter by @tag or regex pattern
Playwright Studio: Run Tests with Project SelectionPick Playwright browser projects
Playwright Studio: Switch Environment ProfileSwitch active env profile from the status bar
Playwright Studio: Open CodegenLaunch playwright codegen
Playwright Studio: Show Trace ViewerOpen a trace .zip file
Playwright Studio: Show HTML ReportOpen the Playwright HTML report
Playwright Studio: Save Selection as SnippetSave selected code as a reusable snippet
Playwright Studio: Set Up Result Capture (Add JSON Reporter)One-click patch to add ['json'] to your playwright.config reporter array

Keyboard Shortcuts

ShortcutCommand
Ctrl+Shift+PCtrl+Shift+RRun Test at Cursor
Ctrl+Shift+PCtrl+Shift+TRun Tests with Tag / Grep Filter

Right-Click Context Menu

Right-click anywhere in a test file for quick access to:

  • Run Test at Cursor
  • Run Tests with Tag / Grep Filter
  • Run Tests with Project Selection
  • Open Codegen
  • Save Selection as Snippet (only when code is selected)

Right-click a file in the Explorer sidebar for:

  • Run All Tests in File
  • Debug All Tests in File
  • Debug All Tests with Inspector
  • Run Tests with Project Selection

Quick Start

  1. Install the extension from the VS Code Marketplace.
  2. Install Playwright in your project: npm i -D @playwright/test.
  3. Open any .spec.ts, .test.ts, .spec.js, or .test.js file.
  4. Use the CodeLens above your first test to run it.

Or install from the terminal:

code --install-extension sumanthtps.playwright-test-code-snippets

Note: The extension writes its results JSON to per-workspace VS Code storage (%APPDATA%\Code\User\workspaceStorage\<hash>\sumanthtps.playwright-test-code-snippets\ on Windows; ~/Library/Application Support/Code/User/workspaceStorage/<hash>/... on macOS), so nothing lands in your repo and there's nothing to gitignore.


Configuration

All settings live under playwrightSnippets.*:

SettingDefaultDescription
playwrightSnippets.workingDirectory""Working directory for test runs (relative or absolute)
playwrightSnippets.testCommand"npx playwright test"Base command used to run tests
playwrightSnippets.reporter""Currently unused. The extension does not pass --reporter to Playwright; configure reporters in playwright.config.ts
playwrightSnippets.env{}Extra environment variables passed to every test run
playwrightSnippets.captureResultstrueSets PLAYWRIGHT_JSON_OUTPUT_NAME so the JSON reporter writes results that power gutter icons, the sidebar panel, status bar, and trace links. Requires ['json'] in your playwright.config reporter array — Playwright Studio will offer to add it automatically the first time it's missing
playwrightSnippets.envProfiles{}Named env profiles — each key is a profile name, value is a map of env vars
playwrightSnippets.heatmapThresholdDays7Days after which a test is highlighted as never/rarely run

Example settings.json

{
  "playwrightSnippets.workingDirectory": "e2e",
  "playwrightSnippets.testCommand": "npx playwright test",
  "playwrightSnippets.reporter": "list",
  "playwrightSnippets.captureResults": true,
  "playwrightSnippets.heatmapThresholdDays": 7,
  "playwrightSnippets.env": {
    "CI": "false"
  },
  "playwrightSnippets.envProfiles": {
    "staging": {
      "BASE_URL": "https://staging.example.com",
      "AUTH_TOKEN": "staging-token"
    },
    "production": {
      "BASE_URL": "https://example.com"
    }
  }
}

Troubleshooting

Playwright Results panel stays empty

The panel only populates when a Playwright run writes a JSON report to the extension's per-workspace storage directory. Walk this checklist top to bottom — each step depends on the previous one.

  1. Enable result capture. In your workspace .vscode/settings.json (or User settings):

    { "playwrightSnippets.captureResults": true }
    

    This makes the extension export PLAYWRIGHT_JSON_OUTPUT_NAME into the terminals it spawns.

  2. Add the json reporter to playwright.config.ts. The extension does not pass --reporter on the command line, so the JSON reporter must be present in your config:

    reporter: [
      ['list'],
      ['html', { open: 'never' }],
      ['json'], // required for the results panel
    ],
    

    Without this, no JSON file is ever written, no matter what env vars are set.

  3. Set workingDirectory if your playwright.config.ts is not at the workspace root. Common in monorepos. Example for a config at <workspace>/tests/playwright.config.ts:

    { "playwrightSnippets.workingDirectory": "tests" }
    
  4. Run tests via the extension, not a manual terminal. Use CodeLens (▶ Run Test), the editor right-click menu (Playwright Studio → Run Test at Cursor), or the Command Palette (Playwright Studio: Run Test). The terminal that opens must be named "Playwright" in the dropdown. A terminal you opened yourself with Ctrl+\`` will not have PLAYWRIGHT_JSON_OUTPUT_NAME` set, so capture won't happen.

  5. After changing settings, reload the window (Ctrl+Shift+PDeveloper: Reload Window) and kill any pre-existing "Playwright" terminal — its env vars were fixed at creation time.

  6. Verify the JSON file is being written. It lives at:

    • Windows: %APPDATA%\Code\User\workspaceStorage\<hash>\sumanthtps.playwright-test-code-snippets\playwright-studio-results.json
    • macOS: ~/Library/Application Support/Code/User/workspaceStorage/<hash>/sumanthtps.playwright-test-code-snippets/playwright-studio-results.json
    • Linux: ~/.config/Code/User/workspaceStorage/<hash>/sumanthtps.playwright-test-code-snippets/playwright-studio-results.json

    If the file is missing after a run, the json reporter or env var isn't reaching the test process — go back to steps 1–4. If the file exists but the panel is still empty, it's a refresh issue — the panel polls mtime every 1.5s, so toggling focus or running the test once more will pick it up.

Test run launches but reports "no tests found"

playwrightSnippets.workingDirectory is wrong. Playwright doesn't search up the directory tree for playwright.config.ts — set workingDirectory to the folder that actually contains it.

Wrong reporter ends up on the command line

The extension no longer passes --reporter at all. If you still see one in the spawned command, your installed extension version is older than 1.0.8 — reinstall the latest VSIX.


Snippets Reference

Prefix Families

PrefixCategory
p-importImports
p-t*Test structure
p-b-*Browser
p-bc-*BrowserContext
p-loc-*Locator
p-get-*Locator getBy
p-e-* / p-et*Assertions
p-wf*Wait actions
p-on-*Page events
p-route-*Network routing
p-clock-*Clock / time
p-trace-*Tracing
p-video-*Video recording
p-api-*API requests
p-net-*Network inspection
p-ws-*WebSocket
p-download-*Downloads

Imports

PrefixDescription
p-importimport { test, expect }
p-import-apiimport { test, expect, request }
p-i-pwrequire('playwright')
p-i-chromiumrequire Chromium
p-i-firefoxrequire Firefox
p-i-webkitrequire WebKit
p-i-devicesrequire devices

Test Structure

PrefixDescription
p-tdtest.describe()
p-ttest()
p-tstest.step()
p-ts-timeouttest.step() with timeout (v1.50+)
p-ts-skiptest.step.skip() (v1.50+)
p-tbetest.beforeEach()
p-taetest.afterEach()
p-tbatest.beforeAll()
p-taatest.afterAll()
p-tusetest.use()
p-tonlytest.only()
p-tskiptest.skip()
p-tskipctest.skip() conditional
p-tfailtest.fail()
p-tfail-onlytest.fail.only() (v1.49+)
p-tfixmetest.fixme()
p-tslowtest.slow()
p-t-timeouttest.setTimeout()
p-tinfotest.info()
p-textendtest.extend() — custom fixtures
p-tdotest.describe.only()
p-tdptest.describe.parallel()
p-tdstest.describe.serial()
p-td-configtest.describe.configure()

Browser

PrefixDescription
p-b-newContextbrowser.newContext()
p-b-newPagebrowser.newPage()
p-b-contextsbrowser.contexts()
p-b-closebrowser.close()
p-b-isConnectedbrowser.isConnected()
p-b-versionbrowser.version()
p-b-typebrowser.browserType().name()
p-b-on-disconnectedbrowser.on('disconnected')
p-b-tracing-startbrowser.startTracing()
p-b-tracing-stopbrowser.stopTracing()
p-l-chromiumLaunch Chromium
p-ls-chromiumLaunch Chromium Server
p-connect-chromiumConnect to Chromium
p-l-firefoxLaunch Firefox
p-ls-firefoxLaunch Firefox Server
p-connect-firefoxConnect to Firefox
p-l-webkitLaunch WebKit
p-ls-webkitLaunch WebKit Server
p-connect-webkitConnect to WebKit
p-bs-closebrowserServer.close()
p-bs-killbrowserServer.kill()
p-bs-on-closebrowserServer.on('close')

BrowserContext

PrefixDescription
p-context-newPagecontext.newPage()
p-context-pagescontext.pages()
p-bc-closecontext.close()
p-bc-cookiescontext.cookies()
p-bc-addcookiescontext.addCookies()
p-bc-clrcookiescontext.clearCookies()
p-bc-storagecontext.storageState() — save auth
p-bc-authnewContext({ storageState }) — reuse auth
p-bc-routecontext.route()
p-bc-routeharcontext.routeFromHAR()
p-bc-ws-routecontext.routeWebSocket() (v1.48+)
p-bc-unroutecontext.unroute()
p-bc-unroute-allcontext.unrouteAll()
p-bc-gpermcontext.grantPermissions()
p-bc-clrpermcontext.clearPermissions()
p-bc-setgeocontext.setGeolocation()
p-bc-offlinecontext.setOffline()
p-bc-sethdrscontext.setExtraHTTPHeaders()
p-bc-aiscontext.addInitScript()
p-bc-expfncontext.exposeFunction()
p-bc-expbindcontext.exposeBinding()
p-bc-sdtocontext.setDefaultTimeout()
p-bc-sdntocontext.setDefaultNavigationTimeout()
p-bc-wfecontext.waitForEvent()
p-bc-cdpcontext.newCDPSession() (Chromium)
p-bc-on-closecontext.on('close')
p-bc-on-pagecontext.on('page')
p-bc-on-weberrorcontext.on('weberror')

PrefixDescription
p-gotopage.goto()
p-reloadpage.reload()
p-goBackpage.goBack()
p-goFwdpage.goForward()
p-setcontentpage.setContent()
p-urlpage.url()
p-titlepage.title()
p-contentpage.content()
p-pausepage.pause() — debug
p-iclosedpage.isClosed()
p-ctxpage.context()
p-openerpage.opener()
p-closepage.close()
p-bringToFrontpage.bringToFront()

Page — Locating Elements

PrefixDescription
p-locatorpage.locator()
p-flpage.frameLocator()
p-framespage.frames()
p-framepage.frame()
p-mainframepage.mainFrame()
p-get-txtpage.getByText()
p-get-rpage.getByRole()
p-get-lpage.getByLabel()
p-get-tipage.getByTestId()
p-get-ppage.getByPlaceholder()
p-get-atxtpage.getByAltText()
p-get-titlepage.getByTitle()
p-$page.$()
p-$$page.$$()
p-$evalpage.$eval()
p-$$evalpage.$$eval()

Page — Actions

PrefixDescription
p-clkpage.click()
p-dbclkpage.dblclick()
p-clkipage.nth().click()
p-fillpage.fill()
p-typepage.type()
p-chkpage.check()
p-uchkpage.uncheck()
p-hoverpage.hover()
p-focuspage.focus()
p-presspage.press()
p-sopage.selectOption()
p-sifpage.setInputFiles()
p-dndpage.dragAndDrop()
p-svppage.setViewportSize()
p-emediapage.emulateMedia()

Page — State & Evaluation

PrefixDescription
p-isvpage.isVisible()
p-ishpage.isHidden()
p-iscpage.isChecked()
p-isenpage.isEnabled()
p-isdpage.isDisabled()
p-isedpage.isEditable()
p-getattrpage.getAttribute()
p-itxtpage.innerText()
p-countpage.count()
p-evalpage.evaluate()
p-evalhpage.evaluateHandle()
p-aispage.addInitScript()
p-addscriptpage.addScriptTag()
p-addstylepage.addStyleTag()
p-expfnpage.exposeFunction()
p-expbindpage.exposeBinding()
p-sdtopage.setDefaultTimeout()
p-sethdrspage.setExtraHTTPHeaders()
p-reqgcpage.requestGC() (v1.48+)

Page — Capture & Output

PrefixDescription
p-screenshot-fullFull page screenshot
p-screenshot-elementElement screenshot
p-pdfpage.pdf()

Page — Debug & Inspection (v1.56+)

PrefixDescription
p-console-msgspage.consoleMessages()
p-page-errorspage.pageErrors()
p-page-reqspage.requests()

Page — Routing

PrefixDescription
p-routepage.route()
p-routeharpage.routeFromHAR()
p-unroutepage.unrouteAll()
p-unroute-urlpage.unroute() — specific URL
p-ws-routepage.routeWebSocket() (v1.48+)
p-alhpage.addLocatorHandler() — overlay handler
p-rlhpage.removeLocatorHandler()
p-ralpage.removeAllListeners()

Locator Methods

PrefixDescription
p-loc-alllocator.all()
p-loc-aitlocator.allInnerTexts()
p-loc-atclocator.allTextContents()
p-loc-andlocator.and() — AND match
p-loc-orlocator.or() — OR match
p-loc-firstlocator.first()
p-loc-lastlocator.last()
p-loc-nthlocator.nth()
p-loc-sublocator.locator() — sub-locator
p-loc-clearlocator.clear()
p-loc-blurlocator.blur()
p-loc-taplocator.tap()
p-loc-presslocator.press()
p-loc-pseqlocator.pressSequentially()
p-loc-draglocator.dragTo()
p-loc-stxtlocator.selectText()
p-loc-sclocator.setChecked()
p-loc-sivlocator.scrollIntoViewIfNeeded()
p-loc-bboxlocator.boundingBox()
p-loc-ivallocator.inputValue()
p-loc-ihtmllocator.innerHTML()
p-loc-tclocator.textContent()
p-loc-wflocator.waitFor() — with state
p-loc-evallocator.evaluate()
p-loc-evalalllocator.evaluateAll()
p-loc-delocator.dispatchEvent()
p-loc-cflocator.contentFrame()
p-loc-filter-vislocator.filter({ visible: true }) (v1.51+)
p-locator-filterlocator.filter() — text/not
p-loc-describelocator.describe() (v1.53+)
p-loc-hllocator.highlight() — debug
p-loc-arialocator.ariaSnapshot()
p-loc-sslocator.screenshot()

Wait Actions

PrefixDescription
p-wflocator.waitFor()
p-loc-wflocator.waitFor({ state })
p-wfspage.waitForSelector()
p-wflspage.waitForLoadState()
p-wftpage.waitForTimeout()
p-wfepage.waitForEvent()
p-wffpage.waitForFunction()
p-wfnpage.waitForNavigation()
p-wfreqpage.waitForRequest()
p-wfrespage.waitForResponse()
p-wfurlpage.waitForURL()

Page Events

PrefixDescription
p-on-closepage.on('close')
p-on-consolepage.on('console')
p-on-crashpage.on('crash')
p-on-dialogpage.on('dialog')
p-on-domcontentloadedpage.on('domcontentloaded')
p-on-downloadpage.on('download')
p-on-filechooserpage.on('filechooser')
p-on-frameattachedpage.on('frameattached')
p-on-framedetachedpage.on('framedetached')
p-on-framenavigatedpage.on('framenavigated')
p-on-loadpage.on('load')
p-on-pageerrorpage.on('pageerror')
p-on-popuppage.on('popup')
p-on-requestpage.on('request')
p-on-requestfailedpage.on('requestfailed')
p-on-requestfinishedpage.on('requestfinished')
p-on-responsepage.on('response')
p-on-websocketpage.on('websocket')
p-on-workerpage.on('worker')

Assertions

State Assertions

PrefixDescription
p-etbvtoBeVisible()
p-etbhtoBeHidden()
p-etbetoBeEnabled()
p-etbdtoBeDisabled()
p-etbctoBeChecked()
p-e-attachedtoBeAttached()
p-e-emptytoBeEmpty()
p-e-focusedtoBeFocused()
p-e-viewporttoBeInViewport()
p-e-editabletoBeEditable()
p-e-oktoBeOK() — response status

Content Assertions

PrefixDescription
p-etbexpect().toBe()
p-ethtxttoHaveText()
p-etctxttoContainText()
p-ethttoHaveTitle()
p-ethURLtoHaveURL()
p-ethattrtoHaveAttribute()
p-ethctoHaveCount()
p-ethsstoHaveScreenshot()
p-e-valtoHaveValue()
p-e-valstoHaveValues() — multi-select
p-e-classtoHaveClass()
p-e-contclasstoContainClass() (v1.52+)
p-e-csstoHaveCSS()
p-e-idtoHaveId()
p-e-jsproptoHaveJSProperty()
p-e-roletoHaveRole()

Accessibility Assertions

PrefixDescription
p-e-accnametoHaveAccessibleName()
p-e-accdesctoHaveAccessibleDescription()
p-e-accerrmtoHaveAccessibleErrorMessage() (v1.50+)
p-e-ariatoMatchAriaSnapshot() (v1.49+)

Advanced Assertions

PrefixDescription
p-config-expectexpect.configure() — soft/timeout
p-e-pollexpect.poll() — polling
p-e-passexpect.toPass() — retry block
p-soft-assertSoft assertions block pattern

Network Routing

PrefixDescription
p-route-fulfillroute.fulfill() — mock response
p-route-abortroute.abort() — block request
p-route-continueroute.continue() — pass through with edits
p-route-fallbackroute.fallback() — next handler
p-route-fetchroute.fetch() — fetch + modify
p-route-modifyIntercept and modify JSON response pattern
p-net-reqInspect request (method, url, headers, body)
p-net-resInspect response (status, url, json)
p-net-assertWait for and assert an API response

WebSocket Routing

PrefixDescription
p-ws-routepage.routeWebSocket() (v1.48+)
p-bc-ws-routecontext.routeWebSocket() (v1.48+)
p-ws-mockFull WebSocket mock pattern
p-on-websocketpage.on('websocket')

Clock API (v1.45+)

PrefixDescription
p-clock-installpage.clock.install() — fake clock
p-clock-fixedpage.clock.setFixedTime()
p-clock-systimepage.clock.setSystemTime()
p-clock-ffpage.clock.fastForward()
p-clock-runpage.clock.runFor()
p-clock-pausepage.clock.pauseAt()
p-clock-resumepage.clock.resume()

Tracing

PrefixDescription
p-trace-startcontext.tracing.start()
p-trace-stopcontext.tracing.stop()
p-trace-chunkcontext.tracing.startChunk()
p-trace-stopchunkcontext.tracing.stopChunk()
p-trace-groupcontext.tracing.group() + groupEnd()
p-trace-fullFull tracing setup (beforeAll/afterAll)

Video Recording

PrefixDescription
p-video-ctxnewContext({ recordVideo })
p-video-pathpage.video().path()
p-video-savepage.video().saveAs()

Downloads & File Chooser

PrefixDescription
p-on-downloadpage.on('download') handler
p-download-fullWait + save download pattern
p-download-pathdownload.path()
p-download-savedownload.saveAs()
p-download-namedownload.suggestedFilename()
p-on-filechooserpage.on('filechooser') handler
p-filechooser-fullWait + set files pattern

API Testing

PrefixDescription
p-api-ctxrequest.newContext()
p-api-getrequest.get()
p-api-postrequest.post()
p-api-putrequest.put()
p-api-patchrequest.patch()
p-api-delrequest.delete()
p-api-headrequest.head()
p-api-fetchrequest.fetch() — custom method
p-api-storagerequest.storageState()
p-api-disposerequest.dispose()
p-req-getpage.request.get() — shares auth
p-req-postpage.request.post() — shares auth

Keyboard, Mouse & Touch

PrefixDescription
p-keyboard-presspage.keyboard.press()
p-keyboard-downpage.keyboard.down()
p-keyboard-uppage.keyboard.up()
p-keyboard-typepage.keyboard.type()
p-keyboard-insertTextpage.keyboard.insertText()
p-mouse-clkpage.mouse.click()
p-mouse-dbclkpage.mouse.dblclick()
p-mouse-downpage.mouse.down()
p-mouse-movepage.mouse.move()
p-mouse-uppage.mouse.up()
p-mouse-wheelpage.mouse.wheel()
p-touch-tappage.touchscreen.tap()

iFrame Handling

PrefixDescription
p-flpage.frameLocator()
p-fl-locframeLocator.locator()
p-fl-roleframeLocator.getByRole()
p-fl-nestedNested frameLocator chain
p-loc-cflocator.contentFrame()

Dialog Handling

PrefixDescription
p-on-dialogpage.on('dialog')
p-dialog-acceptAccept dialog pattern
p-dialog-dismissDismiss dialog pattern

Workers & Accessibility

PrefixDescription
p-on-workerpage.on('worker')
p-worker-evalworker.evaluate()
p-worker-urlworker.url()
p-acc-snappage.accessibility.snapshot()

Page Object Model (POM)

PrefixDescription
p-pampublic async method()
m-pomPOM class template
m-pomePOM class with extended class

Complete Patterns & Templates

PrefixDescription
p-sampleBasic Playwright test
p-testBlockComplete test block with describe
p-newPageHandle new tab / popup page
p-newPopupHandle popup window
p-dragdrop-sampleDrag and drop with mouse
p-saveHARRecord HAR file
p-auth-setupGlobal auth setup with storageState
p-route-modifyIntercept and modify API response
p-soft-assertSoft assertions block
p-trace-fullFull tracing setup
p-ws-mockMock WebSocket responses
p-download-fullWait and save file download
p-filechooser-fullWait and handle file chooser
p-tls-certTLS client certificate setup (v1.46+)
p-mobileMobile device emulation
p-configFull playwright.config.ts template


License

MIT