# detox-applitools-testing

> Utility to integrate applitools screenshot testing in your detox tests

Latest version **1.3.0** (published 2022-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install detox-applitools-testing
pnpm add detox-applitools-testing
yarn add detox-applitools-testing
bun add detox-applitools-testing
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2022-11-15 |
| First published | 2019-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Gytis Vinclovas |
| Maintainers | gongreg, wix.mobile, overengineered, yaroslavs, emilisb |
| Keywords | applitools, detox, screenshot, testing |

## Links

- npm: https://www.npmjs.com/package/detox-applitools-testing
- Repository: https://github.com/wix-incubator/detox-applitools-testing
- Homepage: https://github.com/wix-incubator/detox-applitools-testing#readme
- Issues: https://github.com/wix-incubator/detox-applitools-testing/issues
- npm.io page: https://npm.io/package/detox-applitools-testing

## Dependencies (2)

- [@applitools/eyes-common](https://npm.io/package/@applitools/eyes-common.md) ^3.24.0
- [@applitools/eyes-images](https://npm.io/package/@applitools/eyes-images.md) 4.21.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2022-11-15
- 1.2.3-alpha.0 (next) — 2022-01-14
- 2.2.0 — 2022-11-15
- 2.1.0 — 2022-01-24
- 2.0.2 — 2021-06-10
- 1.2.2 — 2021-06-10
- 1.2.1 — 2021-06-10
- 2.0.1 — 2021-06-10
- 1.2.0 — 2021-05-21
- 2.0.0 — 2021-05-20
- 2.0.0-alpha.4 — 2021-05-20
- 2.0.0-alpha.3 — 2021-04-08
- 2.0.0-alpha.2 — 2021-04-08
- 2.0.0-alpha.1 — 2021-03-26
- 1.1.2 — 2020-08-12
- … 8 more at https://npm.io/package/detox-applitools-testing/versions

## README

<h1 align="center">Detox Applitools Testing</h1>
<p>
  <img alt="Version" src="https://img.shields.io/badge/version-1.2.0-blue.svg?cacheSeconds=2592000" />
  <a href="https://github.com/wix/detox-applitools-testing#readme">
    <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" target="_blank" />
  </a>
  <a href="https://github.com/wix/detox-applitools-testing/graphs/commit-activity">
    <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" target="_blank" />
  </a>
  <a href="https://github.com/wix/detox-applitools-testing/blob/master/LICENSE">
    <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" target="_blank" />
  </a>
</p>

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

## Install

```sh
npm install detox-applitools-testing
```
## Setup

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

```javascript
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](https://jestjs.io/docs/en/configuration#extraglobals-arraystring)
```javascript
"extraGlobals": ["Math"],
```

## Usage

To use screenshot testing inside your tests:

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

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

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

});
```

## testScreenshot
```javascript
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!<br />Feel free to check [issues page](https://github.com/wix/detox-applitools-testing/issues).

## 📝 License

This project is [MIT](https://github.com/wix/detox-applitools-testing/blob/master/LICENSE) licensed.

---
_Source: https://npm.io/package/detox-applitools-testing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
