The repository contains playwright automated tests of Restful-booker which is a CRUD Web API that comes with authentication features that was created for training purposes. The API documentation is available at https://restful-booker.herokuapp.com/apidoc/index.html.
- JavaScript
- Node - Version used -> 20. (It is required for dependency installation)
- NPM - Version used -> 10.
- /tests - Main location for API tests.
- playwright.config.js - Playwright configuration file that contains settings for the test environment.
- .env.template - User data should be hidden, but the application was created for training purposes. Secrets are available on the documentation so I do not hide them in this repository, but .env file was added to .gitignore file as should. After removing ".template" from the file name, you can run the tests.
- /.github/workflows/pipeline.yml - File that contains Continuous Integration/Continuous Deployment (CI/CD) configuration.
- /test-results - Folder contains test results obtained using the Playwright Trace Viewer tool. The test results report is saved in zip format and only retained in case of failure. The file is named "trace.zip", to view the report, drop the file on https://trace.playwright.dev/. The folder is also saved in pipeline. By opening workflow run in the artifacts section you can download the result of failed tests from the pipeline run.
To run the tests, follow these steps:
- Install dependencies:
npm install
- Install playwright browsers:
npx playwright install
- remove .template from the file name .env.template. It defines the secrets needed to log in.
cp .env.template .env
- To runs all e2e tests:
npm run tests