reporter
Send test run reports to your testomat.io project. Get the API key from testomat.
You can refer sample tests from example folder of this repo. This is a basic example. If you need something full fledged you can refer this example repo
Add @testomatio/reporter
package to your project:
npm i @testomatio/reporter --save
codeceptJS
Make sure you load all your tests using check-test.
Add plugin to codecept conf
plugins: {
testomatio: {
enabled: true,
require: '@testomatio/reporter/lib/adapter/codecept',
apiKey: process.env.API_KEY || 'API_KEY',
}
}
Note: Get the API_KEY from your testomat console
Normal run : Run the test with codecept command npx codeceptjs run
Worker : If you are using worker use the following command start-test-run -c 'npx codeceptjs run-workers 2 --verbose'
Mocha
Load the test using using check-test
if not done already. Get the test id from testomat account and add it to your mocha test like in this example
run the following command from you project folder
mocha --reporter ./node_modules/testomat-reporter/lib/adapter/mocha.js --reporter-options apiKey=API_KEY
Jest
Load the test using using check-test
. Add the test id to your tests like in this example
Add the following line to jest.config.js
reporters: ['default', ['../../lib/adapter/jest.js', { apiKey: API_KEY }]],
Run your tests.
Cucumber
Load you test using check-cucumber
Run cucumber test with this formatter and API key in environment in TESTOMATIO
TESTOMATIO=api_key ./node_modules/.bin/cucumber-js --format ./node_modules/@testomatio/reporter/lib/adapter/cucumber.js