detox

Detox: how to test multiline TextInput

我怕爱的太早我们不能终老 提交于 2020-01-04 05:51:08
问题 I'm trying to use detox to test a form in my react-native app. One of the inputs in the form has multiline={true} . I am trying to run the following test: const inputElement = element(by.id('input_multiline')); await expect(inputElement).toBeVisible(); await inputElement.typeText('line1\n'); await inputElement.typeText('line2\n'); await inputElement.typeText('line3\n'); const submitElement = element(by.id('submit')); await submitElement.toBeVisible(); await submitElement.tap(); This test

Is it actually possible to make Detox/Jest tests pass with a React Native app running with Expo?

我们两清 提交于 2020-01-03 16:53:18
问题 I'm attempting to create an automated UI test suite for my React Native app with Expo. I have looked everywhere for good tutorials but when I get to the actual test writing portion, my tests never even run because of environment issues such as "Unexpected Identifier/Token" on import Icon from... or other stupid issues that I cannot find any tutorials on how to fix them. I literally have spent a week trying to resolve these issues. I am new to React Native and new to Jest/Detox/Expo Here's my

Followed Detox Mock Implementation but not working

非 Y 不嫁゛ 提交于 2020-01-02 07:06:30
问题 I am following the Detox documentation on the advance mocking with detox. I am doing so because I would like to mock up my api.js file which by default fetching data from a backend server. My fake api file which I named it api.e2e.js will just contain functions returning promised with json data. Unfortunately, the fake api does not kicks in. Below is my libraries used react-native 0.57.8 detox 9.1.2 I have tried to trigger the env variable through the metro and build command as well but with

Detox: iOS Simulator how to confirm alert message

扶醉桌前 提交于 2019-12-29 08:29:09
问题 I am using Alert from react-native. How do I get detox to press the "Log out" button on the alert message? I tried using await element(by.text('Log out')).tap(); But I get "Multiple elements were matched" error. Presumably it finds 3 elements with same label. The original button with label "Log out" used to trigger the alert message, the alert message title, and the alert message button I want detox to press. Error Trace: [ { "Description" : "Multiple elements were matched: ( "<UILabel

Detox Error: Timeout of 120000ms exceeded. For async tests and hooks

半城伤御伤魂 提交于 2019-12-25 00:23:15
问题 I'm trying to run some e2e tests in my react-native up I'm using Detox but I keep getting the following error 1) "before all" hook: Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. child_process.js:644 throw err; ^ Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts at checkExecSyncError (child_process.js:601:13) at Object.execSync (child_process.js:641:13) at runMocha (/Users/Almog/Full

Detox only testing Splash Screen

一世执手 提交于 2019-12-24 07:33:11
问题 I am running detox on my React-Native project and can only test the splash screen. The splash screen goes to a Login Screen but the detox code will not allow me to test this element. Test Code: describe('Splash', () => { beforeEach(async () => { await device.reloadReactNative(); }); it('should have splash screen', async () => { await expect(element(by.id('splash'))).toBeVisible(); await expect(element(by.id('login'))).toBeVisible(); }); }); Error given: ● Splash › should have splash screen

Detox only testing Splash Screen

那年仲夏 提交于 2019-12-24 07:32:14
问题 I am running detox on my React-Native project and can only test the splash screen. The splash screen goes to a Login Screen but the detox code will not allow me to test this element. Test Code: describe('Splash', () => { beforeEach(async () => { await device.reloadReactNative(); }); it('should have splash screen', async () => { await expect(element(by.id('splash'))).toBeVisible(); await expect(element(by.id('login'))).toBeVisible(); }); }); Error given: ● Splash › should have splash screen

Animated Button block the Detox

懵懂的女人 提交于 2019-12-12 09:45:29
问题 This is what I meant about the animating button. I let it have an ID, but it can't be located by the Detox somehow. Detox eliminates flakiness by automatically synchronizing your tests with the app. A test cannot continue to the next line if the app is busy. The test will only resume when the app becomes idle. Detox monitors your app very closely in order to know when it's idle. It tracks several asynchronous operations and waits until they complete. This includes: Keeping track of all

Error performing 'single click - At Coordinates

我与影子孤独终老i 提交于 2019-12-12 01:19:28
问题 I am doing detox test for react native android version 0.57. I am getting this error. Error is: Error: Error: Error performing 'single click - At Coordinates: 720, 1485 and precision: 16, 16' on view '(with tag value: is "create_team_button" and view has effective visibility=VISIBLE)' Code is it('should create team', async () => { await waitFor(element(by.id('create_team'))).toBeVisible().withTimeout(2000); await element(by.id('create_team')).typeText('mobile offize'); await waitFor(element

Detox does not handle universal links

自作多情 提交于 2019-12-11 15:35:06
问题 I've been trying to get iOS Universal Links to work with Detox using device.openURL from https://github.com/wix/Detox/blob/master/docs/APIRef.MockingOpenFromURL.md but it does not work. Sample of what I've tried: it('should work', async () => { await device.sendToHome(); await device.openURL({ url: 'https://name.page.link/somewhere, sourceApp: 'com.apple.MobileSMS' }); }); It never opens my app and after testing various things it seems detox only support deep links and not universal links. I