This repository holds a minimal set-up, required to launch Suitest JS API e2e tests with Mocha test runner.
Demo set-up is targeting test/
folder in this repo. Dummy test example would run on any HTML-based app,
so you can use your own app for testing.
- Copy
.suitestrc.dist
file as.suitestrc
and fill in it's contents with your values according to documentation. .suitestrc.base.json, .suitestrc.json, .suitestrc.parallel.json - are example of defining configuration files for running single or several devices. - In terminal run
yarn
ornpm i
. - Run
yarn start
ornpm run start
for run tests on single device oryarn parallel
ornpm run parallel
for run tests for several devices. - In order to debug your test, run
yarn debug
ornpm run debug
and connect debugger tolocalhost:9121
. More info on debugging can be found in our docs.
In watchMeTests
folder you can find some Suitest tests written for
WatchMe app (every Suitest account has this app by default). Those tests
rely on some elements from Suitest "Element repository" and configuration
where base url set to https://watchme.suite.st/hbbtv.html
- HbbTv
configuration in WatchMe app. So make sure you properly adjusted .suitestrc
file
and then you can launch them with npm run start:watchMe
or
npm run parallel:watchMe
.
There are few examples of how Suitest can be used with different reporters.
Example script: parallel:watchMe:junit
Also possible to add [hash]
to file name or path to prevent overriding results.
Results can be viewed by running npx xunit-viewer --results=./reports/junit --server
Example script: parallel:watchMe:xunit
Directory for reports should exists otherwise it throws error.
Results can be viewed by running npx xunit-viewer --results=./reports/xunit --server
Example script: parallel:watchMe:mochawesome
Generates html and json reports.
Example script: parallel:watchMe:tap
- Add Slack reporter to the project:
npm i -D mocha-ci-slack-reporter
-
For running mocha with mocha-ci-slack-reporter you need to specify it as an reporter and required reporter options:
- username - can be specified any name
- channel - Slack channel where messages will be sends
- url - Incoming Webhooks url from your Slack application (for generating Incoming Webhooks url you can go through this guide). Slack Incoming Webhooks url can be looks like https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX. Note: Incoming Webhooks url contains secret about your Slack application - dont use it in public sources
- testTitle - title for the report message, device id can be putted there by using SUITEST_CHILD_PROCESS environment variable
-
Examples scripts:
parallel:slack-reporter
,parallel:slack-reporter:win