Skip to content

Playwright workshop

Somkiat Puisungnoen edited this page Oct 8, 2025 · 7 revisions

Playwright workshop

Step 1 :: Install

$npm init playwright@latest 

Generate folder ./cypress

  • tests/
  • playwright.config.js/ts

Step 2 :: Run test

$npx playwright test

Run with UI mode

$npx playwright test --ui

Step 3 :: Config file playwright.config.js/ts

3.1 Reporting

reporter: [ ['junit', { outputFile: './report/results.xml', open: 'never' }] ],

3.2 Test-id attribute and enable recording VDO

use: {
    video: 'on',
    testIdAttribute: 'data-testid',
  },

Step 4 :: Generate test script with Recorder

$npx playwright codegen <target system>

Step 5 :: Write your test case

References

Clone this wiki locally