Skip to content

konturio/front-facing-api-tests

Repository files navigation

front-facing-api-tests

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.

Running api tests with Playwright

  1. Ensure Node.js and npm are installed on your system.
node -v
npm -v
  1. Install Playwright
npx playwright install
  1. 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, or dev.
  • <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.
  1. 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

Running specific tests

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

About

Autotests for front facing apis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published