Description: Porpuse of this project is setting up the Playwright and its infrastructure.
Prerequisites:
- Node.js and npm (or yarn) installed
- Playwright installed:
npm install playwright
Installation:
- Clone the repository
- Navigate to project directory:
cd playwright-project - Install dependencies:
npm install
Commands: After installation complete, start testing using one of the following commands:
- Run tests in interactive UI mode, with a built-in watch mode :
npm run ui - Run tetst in headless:
npx playwright test - Run tests in headed browsers :
npx playwright --headed - Run in debug mode with Playwright Inspector:
npx playwright debug - See your test result with following command :
npx playwright test-result
Project Structure:
playwright-project/
├── package.json
├── tests/
│ ├── pom/
│ │ ├── pricePages.js
│ │ └── ...
│ └── testData
│ ├── pricePage/
│ │ ├──price.spec.ts
│ └── ...
├── .gitignore
└── README.md
...
We use a mix of Husky, ESLint and Prettier within our repository to help enforce consistent coding practices. Husky is a tool that will install a pre-commit hook to run the linter any time before you attempt to make a commit. This replaces the old pre-commit hook that was used before. to install the pre-commit hook you will need to run