Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find alert element #890

Closed
brunobar79 opened this issue Aug 18, 2018 · 1 comment
Closed

Unable to find alert element #890

brunobar79 opened this issue Aug 18, 2018 · 1 comment

Comments

@brunobar79
Copy link
Contributor

brunobar79 commented Aug 18, 2018

Description

I've been trying out Detox lately and everything is working so far except for the fact that I haven't been able to get an Alert element or its button. For example:

screen shot 2018-08-17 at 8 52 10 pm

I've tried the following combinations:

  • by.label('Error')
  • by.type('_UIAlertControllerActionView')
  • by.text('Error')
  • by.label('OK')

and even by label and type as it's mentioned here

Steps to Reproduce

  • create a new project using react-native init
  • Follow the setup instructions in the website
  • Add a button that triggers an Alert component onPress
  • Try to get access that element using detox

I always get the error
"Timeout - Async callback was not invoked within the 120000ms specified by jest.setTimeout."

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 8.1.6
  • React Native: 0.56.0
  • Node: v9.9.0
  • Device: iPhone X (simulator)
  • Xcode: 9.4
  • macOS: High Sierra

Device and verbose Detox logs

' FAIL  e2e/create-password.spec.js (128.452s)
  Create Password
    ✕ should validate that the passwords match (120779ms)

  ● Create Password › should validate that the passwords match

    Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.

      22 | 	// });
      23 |
    > 24 | 	it('should validate that the passwords match', async () => {
         | 	 ^
      25 | 		element(by.id('input-password')).tap()
      26 | 		element(by.id('input-password')).typeText('foo');
      27 | 		element(by.id('input-password-confirm')).typeText('bar\n');

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.<anonymous> (e2e/create-password.spec.js:24:3)
      at Object.<anonymous> (e2e/create-password.spec.js:3:1)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        128.686s, estimated 129s'

@brunobar79
Copy link
Contributor Author

I removed "await" before the tap action and it worked

@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant