Detox Applitools Testing
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',
appName: 'Your app Name',
batchId: 'Unique batch number, can simply be uuid.v4()',
serverUrl: 'applitools server url',
branchName: 'YourBranchName',
parentBranchName: 'YourParentBranchName',
});
});
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,
screenshotPath: 'YOUR_PATH',
});
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.