$ npm install --save-dev @tauk.com/tauk
Import the Tauk package in your test suite.
import Tauk from "@tauk.com/tauk"
Instantiate Tauk with your API TOKEN
and PROJECT ID
from the Tauk Web UI.
const tauk: Tauk = new Tauk("API-TOKEN", "PROJECT-ID");
If you want to exclude a test suite from analysis you can pass in the parameter{ excluded: true }
. For example:
const tauk: Tauk = new Tauk("API-TOKEN", "PROJECT-ID", { excluded: true } );
Provide Tauk with a reference to your driver object.
tauk.setDriver(driver);
Wrap your individual test cases in tauk.observe()
.
The first parameter is the test case name as a string. The second parameter is your test case function. For example:
await tauk.observe("Add new contact", async () => {
await (await driver.$(`android=${AndroidContacts.locators.firstNameTextField}`)).setValue("Tauk");
await (await driver.$(`android=${AndroidContacts.locators.lastNameTextField}`)).setValue("Samples");
await (await driver.$(AndroidContacts.locators.saveButton)).click();
});
Call tauk.upload()
before ending your driver session.
await tauk.upload();