This is a playwright project implementing end-to-end tests for Open Educational Badges.
There are two ways to run this application:
dockerwithdocker compose
docker compose run nodenvm(recommended) ornodewith the version specified in.nvmrc- Run
nvm use && nvm installto install and use the correct version of node automatically
- Run
ghostscriptandgraphicsmagickfor converting QR codes in pdfs to images- e.g. via your systems package manager:
sudo apt install ghostscript graphicsmagick
- e.g. via your systems package manager:
First set up some credentials to be able to login into the platform. For this, clone the example and adjust the values as needed:
cp example.secret.js secret.jsYou may want to modify the URL of the platform in config.js (e.g. your local environment).
Before running the tests for the first time, make sure to install playwrights dependencies as well:
npx playwright installFinally, run the tests with
npx playwright testTo run a specific test, use
npx playwright <test>.spec.js
# E.g.:
npx playwright title.spec.jsAll tests create a screenshot of the last state before clean up. In addition, failed tests produce small video files that show the entire flow. You may access these from the playwright report, that is generated after a test run.
Open the report as follows:
npx playwright show-reportPlaywright also comes with a handy debugging interface, the Playwright Insepctor.
Start it by running npx playwright test --debug.