detox

How can I controle React-Native webview in Detox?

一曲冷凌霜 提交于 2019-12-11 11:55:58
问题 I can't find a way to control the React-Native Webview at https://github.com/wix/detox. and There is another question, Do you know how to press the Back button in React-Navigatoin? If you give the correct answer, you are a nice guy. 回答1: You cannot interact RN webView with detox, platform limitations from iOS, Android. Refer to these. https://github.com/wix/detox/issues/136#issuecomment-306591554 https://github.com/wix/detox/issues/334#issuecomment-335802212 To press Back button in iOS:

Finding a TabNavigator tab item with detox in React Native

血红的双手。 提交于 2019-12-11 02:32:45
问题 I'm using react-navigation in my React Native project that I'm setting up automated testing for using Detox. Unfortunately, I don't see anything in the docs about how to tell detox to find (and then of course tap) the Tab of a Tab Navigator. I tried looking through component tree using react-devtools, but couldn't figure out which element represented the tab button itself. I also tried finding the element by it's text like so: await element(by.text('My Tab Button')).tap(); but that through a

before all“ hook: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure ”done()" is called; if returning a Promise, ensure it resolves

狂风中的少年 提交于 2019-12-11 02:03:44
问题 My package.json id define below and I am using e2e pattern and not define any test file. My test case come under e2e and contain test text so that mocha can read it { "name": "appOfCard", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "watch:test": "npm run test -- --watch", "clean-cache": "watchman watch-del-all", "svg-transform": "msvgc -f ./src/shared-ui/Icon/svg/$SVG.svg -o ./src/shared-ui/Icon/native/ --react-native", "

Detox - Enter on Numpad

两盒软妹~` 提交于 2019-12-10 18:56:00
问题 I wonder how to enter the number using native keyboard and then enter it in just like typeText on a normal string on Detox using "\n" // await typeText('${screen_id}_screen_question_${question_id}_answer_input_', '\n'); How can I achieve this with number? Whenever I do the typeText ('n') it will give me GREYKeyboard: No known SHIFT key was found in the hierarchy. . In my assumption, because the numpad key doesn't have Enter key. But still not sure why it look for a Shift key. Thanks 回答1: Use

Detox, multiple elements were matched for button in transition

孤者浪人 提交于 2019-12-10 14:53:02
问题 I am using detox e2e for creating test cases for my react-native application. Long story short, I have a button inside of my component's render function and that button transitions from left to right. I have given a unique test id to that button. Inside my test case i'm expecting that button to appear using its test id. But when I run "detox test", the test fails and error says that the multiple elements were matched against that test id. Code for my test file is : describe('Login flow', () =

E2E: Select an image from a UIImagePickerController with Wix Detox

爱⌒轻易说出口 提交于 2019-12-10 14:42:41
问题 Description I need to write an e2e test that in some point it has to select an image in UIImagePickerController, I tried to use element(by.type('UIImagePickerController')). tapAtPoint() with no use. I need a way to select an image. I have found a way to do it with native tests. Also mocking isn't an option for me since I use a higher version that the one react-native-repackeger needs. Steps to Reproduce Use with any application that uses image picker Try to use element(by.type(

How to tell Detox is running tests?

China☆狼群 提交于 2019-12-10 02:52:15
问题 I'm using Detox to run end to end tests in my React Native project. I'm also using pretender.js to mock my API requests and I'm struggling to find a way to know if the app is currently in "testing" mode. I was passing an env variable down (and using babel-transform-inline-environment-variables ) to tell if I should mock the requests but that breaks shim.js in our release builds. Is there any way to tell Detox launched the app & is running tests from within the JS? Ideally I'm looking for some

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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 03:47:02
问题 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() }) it('Login to a test account', async () => { // LoginPage: entering phone number moving to next page await expect(element(by.id('LoginPage-phoneInput'))).toBeVisible() await element(by.id('LoginPage-phoneInput')).typeText('<someNumber>') }) }) And the error I

Animated Button block the Detox

烂漫一生 提交于 2019-12-05 12:54:09
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 network requests that are currently in-flight and waiting until they complete Keeping track of pending

How to tell Detox is running tests?

老子叫甜甜 提交于 2019-12-05 02:40:11
I'm using Detox to run end to end tests in my React Native project. I'm also using pretender.js to mock my API requests and I'm struggling to find a way to know if the app is currently in "testing" mode. I was passing an env variable down (and using babel-transform-inline-environment-variables ) to tell if I should mock the requests but that breaks shim.js in our release builds. Is there any way to tell Detox launched the app & is running tests from within the JS? Ideally I'm looking for some sort of variable set at test time or something passed down from the command line ( TESTING=true react