This project contains automated UI tests using TypeScript and Playwright. The tests follow best practices in code style and design patterns to ensure maintainability and readability.
- Parallel Test Runs: Execute tests in parallel to save time and resources.
- Page Object Pattern: Encapsulate page interactions within classes to promote reuse and reduce code duplication.
- Page Elements Pattern: Manage UI elements efficiently to simplify test scripts.
- Node.js version 20 or higher.
To install the project dependencies, run the following command:
$ npm install
$ npx playwright install
To check the code style, run:
$ npm run lint
To debug specific tests, run:
$ npm run debug
To run all tests using Docker, follow these steps:
- Build the Docker image:
$ docker build -t juice-shop-ui-tests .
- Run the Docker container for macOS and Windows:
For Linux:
docker run \ -e "BASE_URL=http://host.docker.internal:3000" \ -e "USER_EMAIL=your_email@example.com" \ -e "USER_PASSWORD=your_password" \ juice-shop-ui-tests
docker run \ -e "BASE_URL=http://<HOST_IP>:3000" \ -e "USER_EMAIL=your_email@example.com" \ -e "USER_PASSWORD=your_password" \ juice-shop-ui-tests
Make sure to replace BASE_URL with the address of your local project, and provide the appropriate user email and password.