1.3.0 • Published 1 year ago

detox-applitools-testing v1.3.0

Weekly downloads
9
License
MIT
Repository
github
Last release
1 year ago

This is a helper project which allows you to add screeshot tests for your Detox tests using Applitools.

Install

npm install detox-applitools-testing

Setup

Inside your Detox entry (usually index.js file in e2e/index.js) add following lines:

import {setup} from 'detox-applitools-testing';

before(async () => {
  ...
  setup({
    apiKey: 'EYES_API_KEY', //Your key from applitools,
    appName: 'Your app Name',
    batchId: 'Unique batch number, can simply be uuid.v4()',
    serverUrl: 'applitools server url', //Optional, leave empty if not using custom server
    branchName: 'YourBranchName', //Optional, run tests in specific branch. Learn more: https://help.applitools.com/hc/en-us/articles/360007528631-Branches
    parentBranchName: 'YourParentBranchName', //Optional, compare tests against a specific baseline in a different branch. Learn more: https://help.applitools.com/hc/en-us/articles/360007528631-Branches 
  });
});

If you are using Jest, add this option to your Jest config to have faster global lookups (results in faster screenshot comparisons). Read more

"extraGlobals": ["Math"],

Usage

To use screenshot testing inside your tests:

import {testScreenshot} from 'detox-applitools-testing';

describe('...', await () => {

  it('...', () => {
    ...
    await testScreenshot('Unique test case');
  });

});

testScreenshot

await testScreenshot('NAME_OF_TEST', {
  ignoredTopHeight : 44, // Optional, pixels from top to ignore
  screenshotPath: 'YOUR_PATH', // Optional, by default screenshot is taken by Detox
});

By default testScreenshot cuts off top bar of the screenshot to hide the clock. You can disable it by using: testScreenshot('TEST_ID', {ignoredTopHeight: 0})

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

📝 License

This project is MIT licensed.

1.3.0

1 year ago

2.2.0

1 year ago

1.2.3-alpha.0

2 years ago

2.1.0

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.2.0

3 years ago

2.0.0-alpha.4

3 years ago

2.0.0

3 years ago

2.0.0-alpha.3

3 years ago

2.0.0-alpha.2

3 years ago

2.0.0-alpha.1

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago