Code Monkey home page Code Monkey logo

playwright-sample-visual-testing's Introduction

General info

This is sample project presenting Playwright Visual Testing. Design patters, such as POM or builders etc, were not implemented, to focus on simple visual testing.

More info: https://playwright.dev/docs/test-snapshots

Steps to run project locally

  1. Install packages (before first run):

    npm i
    npx playwright install
    
  2. Run all tests by:

    npm run all
    

Additional Tools

Reports

All reports are generated into directory playwright-report. Additional files are generated into directory test-results.

Visual comparisons

Run all tests for Visual comparisons with:

npm run vt

Update screenshots with:

npm run vt-update

More: https://playwright.dev/docs/test-snapshots

Codegen

To use codegen:

npx playwright codegen [PAGE_ADDRESS]

More: https://playwright.dev/docs/codegen

Trace Viewer

Playwright Trace Viewer is a GUI tool that helps exploring recorded Playwright traces after the script ran.

To use it:

  1. run test with trace set to ON - in config : trace: 'on'

  2. after test run check where it was created (check outputDir in your config file),

  3. run command with proper path to zip file:

    npx playwright show-trace trace.zip
    

More: https://playwright.dev/docs/trace-viewer

Using custom config

To use custom config file:

npx playwright test --config=config/playwright.config.ts

playwright-sample-visual-testing's People

Contributors

jaktestowac avatar freudenberger avatar

Stargazers

 avatar Pogo avatar  avatar  avatar Emily Miller avatar Paweł Wojciechowski avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.