- The playwright is a Node.js library to automate Chromium, Firefox, and WebKit with a single API. Playwright is built to enable cross-browser web testing.
- Playwright by Microsoft did start as a fork of Puppeteer Puppeteer is a node library to automate the chromium browsers with the JavaScript API
- Clone the repository
- open the project
- From the terminal install all the dependencies using 'npm i'
Ensure Node.js is installed on your system. You can download and install it from nodejs.org.
node -v npm -v
mkdir my-playwright-project cd my-playwright-project npm init -y
npm install @playwright/test
npx playwright install
npx playwright test Run Playwright Tests
npx playwright test npx playwright test --ui
- npx playwright show-report
- npx playwright test --project=chromium
- tests_expidite_assist: This folder contains all the test cases for Expedite Assist.
- Test 1 Register New User.spec.ts: Tests for new user registration.
- Test 1a Register Existing User.spec.ts: Validates registration of an existing user.
- Test 2 Login Validation.spec.ts: Tests for successful login and verification of credentials.
- Test 2a Login With Incorrect Cred.spec.ts: Tests login failure due to incorrect credentials.
- Test 3 Create Ticket.spec.ts: Automates the process of creating a support ticket.
- Test 4 Create Case.spec.ts: Tests the case management system, ensuring cases are created and tracked correctly.
Cross-Browser Support: The scripts are designed to execute across multiple browsers (Chromium, Firefox, Webkit).
-
Test Scenarios:
- New user registration.
- Validation of existing user registration.
- Login with correct and incorrect credentials. Creation of support tickets and cases.
-
Screen Capture: Screenshots and videos are captured on test failure to aid debugging.
-
Custom Test Data: Use of structured test data for reusability in the test-data folder
-
CI/CD Integration: GitHub Actions setup for continuous integration on Windows Runner
- This project uses GitHub Actions to run the tests on every push or pull request. The workflow is defined in .github/workflows/playwright.yml.
- The Playwright tests will be automatically executed in a Windows environment via GitHub Actions. You can manually trigger the action by pushing changes or creating a pull request.
- The CI workflow is defined in the playwright.yml file. It uses Windows runners to execute the tests across multiple browsers.
- Node js -> v.14 or above
- VS Code
- Playwright Vs Code Extension
- For further usage and configuration, check the official documentation: Playwright Documentation