Questions tagged [detox]

Gray box end-to-end testing and automation framework for mobile apps

From GitHub page:

High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it's running in a real device/simulator, interacting with it just like a real user.

The most difficult part of automated testing on mobile is the tip of the testing pyramid - E2E. The core problem with E2E tests is flakiness - tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing. That's where Detox comes into play.

Cross Platform: Write cross-platform tests in JavaScript. Currently supports iOS and Android.

Runs on Devices (not yet supported on iOS): Gain confidence to ship by testing your app on a device/simulator just like a real user.

Automatically Synchronized: Stops flakiness at the core by monitoring asynchronous operations in your app.

Made For CI: Execute your E2E tests on CI platforms like Travis without grief.

Test Runner Independent: Use Mocha, AVA, or any other JavaScript test runner you like.

Debuggable: Modern async-await API allows breakpoints in asynchronous tests to work as expected.

See the GitHub page for more information.

619 questions
5
votes
0 answers

TextInput label/id not getting picked up in detox

I am just setting up Detox and user error is possible... that being said, I think I'm doing this right. I have a TextInput element with both accessibilityLabel and testID set to email. However, detox cannot find UI element with by.id or by.label.…
Steph
  • 340
  • 5
  • 22
5
votes
1 answer

"ReferenceError: device is not defined" when using detox+Jest in React Native for android

App is working fine both in Android and iOS simulators. I am trying to setup Detox with Jest for end to end testing my react-native app. In simulator I can see some movement but app is not launched and I get following errors(apart from "device not…
Anupam
  • 7,966
  • 3
  • 41
  • 63
5
votes
1 answer

How to use Jest globalSetup with Detox

I want to use globalSetup and globalTeardown from Jest with Detox so that the detox setup only happens one time but Detox seems to fail if the init is not beforeAll. Any suggestions? Jest version :22.0.4 Detox Version:6.0.4 config: "globalSetup":…
Garima ren
  • 81
  • 4
5
votes
3 answers

detox: tap button only if exists

In my test, I would like to simulate a tap in the "cancelUpgrade" button only if it is displayed: it('should be in home menu', async () => { await waitFor(element(by.id('cancelUpgrade'))) .toBeVisible() .withTimeout(2000); await…
Paul
  • 1,290
  • 6
  • 24
  • 46
5
votes
1 answer

run react-native detox e2e tests on real devices

Is there a way to run detox e2e tests on real devices within a CI pipeline? My goal is to run the tests on AWS device farm or something similar. I read that it is possible to run the e2e tests on bitrise ci, but I guess they will be executed in the…
appsthatmatter
  • 6,347
  • 3
  • 36
  • 40
5
votes
4 answers

Detox _ Failed to type string because keyboard was not shown on screen

I'm trying to test my react-native app using detox, waiting for a text input to be visible and typing text in it. My spec JS file looks like this: describe('FiestTest', () => { beforeEach(async () => { await device.reloadReactNative() }) …
mhyousefi
  • 1,064
  • 2
  • 16
  • 30
4
votes
1 answer

Execution failed for task ':vision-camera-code-scanner:checkDebugAndroidTestAarMetadata'

So I have been at this for a while now, I recently tried to add Detox tests to android in my react native projects. I followed the official Detox tutorial and this…
Nir Yossef
  • 191
  • 1
  • 8
4
votes
1 answer

Detox react-native run multiple e2e files

I started to do several test with detox (in my react native project) in one file and I was wondering if it was possible to do it in several files? because when I tried in 2 different files, detox starts with the 2ND file and not the 1ST?? Here is my…
E.D
  • 831
  • 3
  • 16
  • 33
4
votes
2 answers

use a compatible library with a minSdk of at most 16

Hi I am trying to build detox to test my app. I am facing compatibility issue. My app runs with android versions 21 to 31. I get the below error when I run the command "yarn detox build -c android" Error: Task…
Developer404
  • 5,716
  • 16
  • 64
  • 102
4
votes
1 answer

Default AsyncStorage values in a Detox test

I'm wondering how to default AsyncStorage values in React Native for a Detox test. I have a welcome modal which shows when the user firsts login. We control whether to show the modal by storing an AsyncStorage value. Since our tests launch different…
Ryan
  • 41
  • 3
4
votes
1 answer

Is there a way to log found values in Detox?

I'm trying to debug some Detox tests, I've got some assertions like the following: await expect(eventScreenMatcher.component).toExist(); await expect(eventScreenMatcher.toggleButton).toExist(); await…
Ian
  • 33,605
  • 26
  • 118
  • 198
4
votes
2 answers

Detox Substring Match Using by.text

I'm trying to select an element by text, but the actual text changes because it has the current time stamp in it. Is there is way to select it without doing a substring search on getAttributes()? I can't use getAttributes because we will also be…
Satbir Kira
  • 792
  • 6
  • 21
4
votes
1 answer

How to run in a specific order many e2e files with Detox with Jest for a React Native app?

As stated I'm testing a React Native app with Detox (and Jest) and I'd like to have several e2e files with different purposes -e.g.: login, fill a form and so- and run them in a specific order (the log in e2e file should go first). Running them in…
Gabriel
  • 41
  • 3
4
votes
0 answers

Detox iOS dynamic link is null for `firebase.dynamicLinks().getInitialLink()`

I'm using Firebase Dynamic links as a Deep Link handler. And on iOS firebase.dynamicLinks().getInitialLink() constantly returns null. Code is simple: await device.launchApp({ newInstance: true, sourceApp: APP_ID, url:…
4
votes
4 answers

Detox: field CFBundleIdentifier not found inside Info.plist

I've got a ReactNative 0.63.2 project. It runs on the simulator, it runs on the physical device. Decided to get started with Detox now. When running the sample test, I run into this error: Error: field CFBundleIdentifier not found inside Info.plist…
Chrisissorry
  • 1,434
  • 2
  • 22
  • 43