Work In Progress
A repo for writing Playwright tests against the Restful Booker Platform (RBP).
- Online hosted version of RBP being used as my
staging
environment. - RBP Postman Collections
The tests contained within are for learning more about the test framework. As such some code examples may be incomplete, bad examples, poor practice, or just plain broken.
- Install Playwright and its dependencies
- TDLR: Install Node and Playwright
- Install Docker Desktop
- Build the application with
docker-compose
- To speed things up for me, I've pushed tagged versions of the images I've built to my own Docker Hub profile. These are used in
docker-compose.yml
. - You can use these images to build and run the application
docker-compose up -d
- Shut down when you're finished
docker-compose down --remove-orphans
- To speed things up for me, I've pushed tagged versions of the images I've built to my own Docker Hub profile. These are used in
Alternatively
build the Restful Booker images locally yourself- Once you've built it all once it'll spin up again more quickly
- You can build and run via Docker, after that initial build (Docker image relies on built artifacts)
- Bring up the containers
cd [path to your local RBP repo] && docker-compose up -d
- Shut down when you're finished
docker-compose down --remove-orphans
- Bring up the containers
- Github Action manually disabled. If you fork this project it will run automatically.
- To upgrade Playwright run
npm install -D @playwright/test@latest
- Test run files are available on the local machine when using
docker-compose
via a mountedvolume
. The volume also applies test file updates in subsequent runs without the need to rebuild theplaywright
test image.
Tests can be run locally or via docker-compose
. The default setup uses docker-compose
. To run tests from your local machine directly, will need to update the env vars in tests/utils/environment-base-urls.ts
first.
- Make sure the env is up and running.
- To run some tests against your local env use
docker-compose run playwright npm run test:dev:all
- Tests can be run from your local machine with
npm run test:dev:all
We may want to run the tests from our local machine or via docker-compose
. The difference here being we do not control the staging env as it is hosted online.
- To run tests from your local machine against "staging" env use
npm run test:staging:all
- To run tests using
docker-compose
against "staging" usedocker-compose run playwright npm run test:dev:all
TBD