Skip to content

TykTechnologies/portal-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portal-test

UI automated tests for Portal

test coverage can be found here

Running tests in docker

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.

  1. Clone this repository
  2. Generate and export license (for Portal and dashboard) to env variables
export TYK_DB_LICENSEKEY=%license%
  1. Start dependencies. This will start Tyk stack and Selenium hub
make start-dependecies
  1. Build test framework image (this need to be done only once)
make build-framework
  1. Execute prerequisits (run only once, on clear Portal)
make execute-prerequisits
  1. 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

Prerequisits for manual testing

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.

How to run tests locally (not using Selenium hub)

Tests can be executed inside docker wdio service.

  1. Clone this repository
  2. Install framework dependencies
npm install
  1. Generate and export license (for Portal and dashboard) to env variables
export PORTAL_LICENSEKEY=%license%
export TYK_DB_LICENSEKEY=%license%
  1. Start docker-compose with Tyk stack (gateway, dashboard, redis, mongo) using single command
docker-compose -f ci/tyk_dashboard.yml up
  1. Start your Portal instance with empty database and admin user
./dev-portal  --bootstrap [email protected] -pass=test123
  1. 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
  1. 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

Notes

  • 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

Configuration

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

Tooling:

  1. Node.js
  2. Webdriverio
  3. Timeline reporter for reporting

About

UI automated tests for Portal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages