This repository contains automated tests built using Playwright.
Before running the Playwright tests, ensure you have the following installed:
Follow these steps to install dependencies and run the Playwright tests.
git clone https://github.com/kawsar-95/automation-assignment.git
cd <repository-directory>
Run the following command to install the required dependencies:
npm install
Playwright comes with its own set of browsers. To install them, use:
npx playwright install
To run all Playwright tests, execute the following command:
npm test
To run a specific test, you can specify the file path like this:
npx playwright test tests/assignment.spec.js
Playwright generates a test report that you can view in your browser. After running the tests, open the HTML report using:
npx playwright show-report
You can run tests in headed mode (with the browser UI) for debugging:
npx playwright test --headed
To enable tracing for debugging purposes:
npx playwright test --trace on
After running tests with traces, open the trace viewer using:
npx playwright show-trace <trace-file>
.
├── .github/ # GitHub Actions workflows
│ └── workflows/
├── ManualTesting/ # Manual testing documents
├── node_modules/ # Node.js modules
├── pageobjects/ # Page Object Models
│ └── sauceDemoPage.js
├── playwright-report/ # Playwright test reports
├── test-results/ # Test results
├── tests/ # Test files
│ └── assignment.spec.js
│ └── assignment.spec.js-snapshots
├── utils/ # Utility files
├── .gitignore # Git ignore file
├── package.json # Node.js dependencies and scripts
├── playwright.config.js # Playwright configuration file
└── README.md # This file
- Prerequisites: Basic tools required to run the Playwright tests.
- Installation and Running Tests: Commands for setup, installation, and running tests.
- Running Specific Tests, Reports, and Debugging: Instructions to run specific tests, view reports, and debug.
- Folder Structure: Outline of your project structure to help navigate through files.
For more information on Playwright, visit the official documentation.