kobenguyent / codeceptjs-applitoolshelper

MIT License
4 stars 5 forks source link

Donate with PayPal "Buy Me A Coffee"

Acceptance Tests Publish npm Package

NPM

codeceptjs-applitoolshelper

Integration of Applitools with CodeceptJS.

The codeceptjs-applitoolshelper is a CodeceptJS helper designed to publish test results on Applitools after test execution.

Installation

npm i codeceptjs-applitoolshelper --save
npm i webdriverio@5 --save

Configuration

Add the helper to codecept.conf.ts:

helpers: {
  Playwright: {
    // ... Playwright configuration
  },
  ApplitoolsHelper: {
    require: 'codeceptjs-applitoolshelper', 
    apiKey: 'YOUR_API_KEY',
    debug: true // enable verbose log
    // ... other configuration options
  },
}
Key Description
apiKey (Required) API key found under the user menu on the right-hand side of the test manager toolbar.
windowSize (Optional) Window size, e.g., 1440x700. If not provided, the default 1920x600 is used. The window size follows this precedence: ApplitoolsHelper, Webdriver.
appName (Optional) Desired application name. If not provided, the default 'Application Under Test' is used.
batchInfo (Optional) Desired batch info. If not provided, the default 'Visual Tests with the Classic Runner' is used.
debug (Optional) Enable verbose log.

Usage Example

const { I } = inject();

Feature('Applitools functionality');

Scenario('Check home page @test', async () => {
    I.amOnPage('https://applitools.com/helloworld');
    await I.eyeCheck({ pageName: 'Homepage' });
});

Scenario('Check a CTA button on home page @test', async () => {
    const targetElement = 'div.section.button-section > button';
    I.amOnPage('https://applitools.com/helloworld');
    await I.eyeCheck({ pageName: 'CTA button', element: targetElement });
});

// Additional scenarios...

Test Results

Example Repo

Explore the functionalities with the example repository.