UI automated tests for Portal
test coverage can be found here
Before running tests make sure that your Portal is running on localhost:3001 and was bootstraped with ([email protected]) admin user. Command to bootstrap:
./dev-portal -bootstrap [email protected] -pass=test123
To dockerize the framework we are using Selenium hub. This will install dependecies, run the driver and browser inside containers (no need for nodejs, npm or chrome to be installed locally). Just make sure that you have bootstraped portal and running on localhost:3001.
- Clone this repository
- Generate and export license (for Portal and dashboard) to env variables
export TYK_DB_LICENSEKEY=%license%
- Start dependencies. This will start Tyk stack and Selenium hub
make start-dependecies
- Build test framework image (this need to be done only once)
make build-framework
- Execute prerequisits (run only once, on clear Portal)
make execute-prerequisits
- Execute tests
make execute-tests
You can now edit the framework code (on your local) and just re-run execute-tests, no need of rebuilding the image. Results should be created in /result folder. To kill dockers with dependencies just run:
make stop-dependecies
If you just need a working instance of Portal connected with Tyk and Keycloak - start docker-compose (point 2 below) and make your Portal to use database saved in ci/portal.db file. Portal should now be connected to Tyk Dahsboard and be have DCR details set up.
Tests can be executed inside docker wdio service.
- Clone this repository
- Install framework dependencies
npm install
- Generate and export license (for Portal and dashboard) to env variables
export PORTAL_LICENSEKEY=%license%
export TYK_DB_LICENSEKEY=%license%
- Start docker-compose with Tyk stack (gateway, dashboard, redis, mongo) using single command
docker-compose -f ci/tyk_dashboard.yml up
- Start your Portal instance with empty database and admin user
./dev-portal --bootstrap [email protected] -pass=test123
- Execute prerequisits
npm run docker-prerequisits
After this you will have Portal filled with data needed for manual testing (provider, users, catalogues, etc.). 7. Execute tests
npm run docker-test
- Report will be generated in results/report/index.html
Tests will also work with Portal started as docker container. Just please make sure that admin user was created. If portal
- Tests also works with Portal started as docker container (please make sure that URL is provided and admin user was created)
- Tests are executed on chrome browser
- Tests are triggered as github action inside Portal repository
We can execute test with following variables [default values]:
- URL [https://localhost:3001/] - Portal UI url
- TYK_PRO_URL [https://localhost:3000/] - Tyk dashboard url
- TYK_DB_LICENSEKEY [] - Tyk dashboard license
Note: you can also use .env file to provide the variables
- Node.js
- Webdriverio
- Timeline reporter for reporting