/twr-playwright-demo-mtc

Playwright flow with and without pom and github actions

Primary LanguageTypeScriptMIT LicenseMIT

Playwright demo for MTC

Hi 👋🏽!

Tests at https://www.saucedemo.com/ using Playwright for the MTC 2023. With and without pom and github actions.

By Renata Andrade

If you find it useful, consider leaving a ⭐️ for this repo.

Happy Testing 🎭!

🪜 Dependecies

  • Playwright v1.35.0
  • dotenv v16.1.4
  • Node v20.3.0
  • npm v9.6.7
  • VSCode 1.78.2 (Universal)

Pre requirements:

💡 Fork and clone the project

  1. Copy the project URL https://github.com/raptatinha/twr-playwright-demo-mtc.git;
  2. Fork the project following the GitHub instructions - (use the parameter --clone=true);
  3. Access the forked project cd twr-playwright-demo-mtc

🧬 Setup and Install

  1. Set up the environment variables.

    1.1. Create the following file in the project root folder:

    • .env

    1.2. Copy the content of .env.example into the newly created file.
    1.3. Update the PASSWORD (you can check the password here: https://www.saucedemo.com/).

  2. On your terminal, type:

    2.1. npm i

🚀 Run

All the commands are in the package.json.

  • Run tests without POM: npm run test-ui
  • Run tests without POM on chrome only: npm run test-ui-c
  • Run tests with POM: npm run test-ui-pom

📊 Report

npx playwright show-report Report in GitActions

🌀 Pipeline

Using GitHub Actions. Check playwright.yml


💡 Share on LinkedIn something interesting you've learned! Don't forget to tag me Renata Andrade.

💜 If you have questions, feel free to post them on github.

Happy Testing 🎭