Autotests for front facing apis of Kontur products. Tests are written in TypeScript and use the Playwright framework. The tests run in the CI pipeline. Tests run in parallel to speed up the execution.
- Ensure Node.js and npm are installed on your system.
node -v
npm -v
- Install Playwright
npx playwright install
- Set up the environment variables
Create a .env.playwright.local
file in the root of the project with the following content:
EMAIL_PRO=<pro-test-email>
PASSWORD_PRO=<pro-test-password>
ENVIRONMENT=<env>
SLACK_BOT_USER_OAUTH_TOKEN=token
- is the environment where the tests will run. It can be
prod
,test
, ordev
. - <SLACK_BOT_USER_OAUTH_TOKEN> is the Slack bot user OAuth token for the channel you want to send the test results to.
- and are the credentials for a user with PRO rights.
- Run the api tests
npx playwright test
Add the --ui
flag to run the tests in debug mode, which opens Playwright's interactive UI for step-by-step execution and debugging:
npx playwright test --ui
To run a specific test, add the name of the test after the test
command. For example, to run the liveSensor.spec.ts
test, run:
npx playwright test liveSensor.spec.ts
To run a specific test group, add the @<tag>
info. For example, to run the guest
tests, run:
npx playwright test --grep @guest