CodeceptJS Applitools helper to integrate the applitool
codeceptjs-applitoolshelper is a CodeceptJS helper which can publish tests results on Applitools after the tests execution.
NPM package: https://www.npmjs.com/package/codeceptjs-applitoolshelper
npm i codeceptjs-applitoolshelper --save
npm i webdriverio@5 --save
This helper should be added in codecept.json/codecept.conf.js
Example:
...
helpers: {
WebDriver: {
url: 'https://applitools.com/helloworld',
browser: 'chrome',
desiredCapabilities: {
chromeOptions: {
args: [ '--headless', '--disable-extensions', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage']
}
},
windowSize: '1920x600',
smartWait: 5000,
timeouts: {
'script': 60000,
'page load': 10000
},
},
ApplitoolsHelper: {
require: 'codeceptjs-applitoolshelper',
applitoolsKey: 'YOUR_API_KEY'
}
},
...
To use this helper you need to provide the following info:
applitoolsKey
(Required): You can find your API key under the user menu located at the right hand side of the test manager toolbarwindowSize
(Optional): the windows size as for instance1440x700
, if not provided, the default1920x600
will be used. The windowSize will follow this precedence: ApplitoolsHelper, Webdriver.appName
(Optional): you can either provide your desired application name, if not provided, the default 'Application Under Test' will be used.
An example how to use this helper
const { I } = inject();
Feature('Applitools functionality');
Scenario('Check home page @test', async () => {
I.amOnPage('https://applitools.com/helloworld');
await I.eyeCheck('Homepage');
});
// Provide the second param to gather multiple tests
// more info could be found here https://help.applitools.com/hc/en-us/articles/360006914772-Batching
Scenario('Check home page @test', async () => {
I.amOnPage('https://applitools.com/helloworld');
await I.eyeCheck('Homepage', 'Layout');
});
// Provide the third param to set the match level
// more info could be found here https://help.applitools.com/hc/en-us/articles/360007188591-Match-Levels
Scenario('Check home page @test', async () => {
I.amOnPage('https://applitools.com/helloworld');
await I.eyeCheck('Homepage', 'Homepage', 'Layout');
});
For your reference, you can check out this repo: https://github.com/PeterNgTr/applitools-example