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

Stuck in "Waiting for window's root view controller's view to appear." #660

Closed
BenBach opened this issue Apr 5, 2018 · 4 comments
Closed

Comments

@BenBach
Copy link

BenBach commented Apr 5, 2018

Description

Detox gets stuck waiting for an element to appear. The element is visible only the screen and the testID ist set.

When running --debug-synchronization 3000 it shows App State: undefined

Steps to Reproduce

  1. Waiting for an element to be visible

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.3
  • React Native: 0.53.0
  • Node: 8.6.0
  • Device: iPhone 7 Simulator (iOS 11)
  • Xcode: 9.2
  • macOS: 10.12.6

Device and verbose Detox logs

If just running with --debug-synchronization

endless loop of:

...
detox info Sync App State: undefined 
detox info Sync Dispatch Queue: com.apple.main-thread
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread

If just running with --debug-synchronization --loglevel verbose

...
detox verb ws
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread
detox verb ws send: {"type":"currentStatus","params":{},"messageId":7}
detox verb ws onMessage: {"type":"currentStatusResult","messageId":7,"params":{"state":"busy","resources":[{"name":"App State","info":{"elements":["<UIViewController: 0x7fb5aa410b20>"],"appState":"Waiting for window's root view controller's view to appear."}},{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x117bb6dc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x117bb8300], width = 0x1, state = 0x001ffe9e00000400, dirty, max qos 6, in-flight = 0, thread = 0x403 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":7}}
detox verb ws
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread
detox verb ws send: {"type":"currentStatus","params":{},"messageId":8}
detox verb ws onMessage: {"type":"currentStatusResult","messageId":8,"params":{"state":"busy","resources":[{"name":"App State","info":{"elements":["<UIViewController: 0x7fb5aa410b20>"],"appState":"Waiting for window's root view controller's view to appear."}},{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x117bb6dc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x117bb8300], width = 0x1, state = 0x001ffe9e00000400, dirty, max qos 6, in-flight = 0, thread = 0x403 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":8}}
detox verb ws
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread
detox verb ws send: {"type":"currentStatus","params":{},"messageId":9}
detox verb ws onMessage: {"type":"currentStatusResult","messageId":9,"params":{"state":"busy","resources":[{"name":"App State","info":{"elements":["<UIViewController: 0x7fb5aa410b20>"],"appState":"Waiting for window's root view controller's view to appear."}},{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x117bb6dc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x117bb8300], width = 0x1, state = 0x001ffe9e00000400, dirty, max qos 6, in-flight = 0, thread = 0x403 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":9}}
detox verb ws
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread
detox verb ws send: {"type":"currentStatus","params":{},"messageId":10}
detox verb ws onMessage: {"type":"currentStatusResult","messageId":10,"params":{"state":"busy","resources":[{"name":"App State","info":{"elements":["<UIViewController: 0x7fb5aa410b20>"],"appState":"Waiting for window's root view controller's view to appear."}},{"name":"Dispatch Queue","info":{"queue":"<OS_dispatch_queue_main: com.apple.main-thread[0x117bb6dc0] = { xref = -2147483648, ref = -2147483648, sref = 1, target = com.apple.root.default-qos.overcommit[0x117bb8300], width = 0x1, state = 0x001ffe9e00000400, dirty, max qos 6, in-flight = 0, thread = 0x403 }>","prettyPrint":"com.apple.main-thread"}}],"messageId":10}}
detox verb ws
detox info Sync App State: undefined
detox info Sync Dispatch Queue: com.apple.main-thread

I am not sure if App State: undefined is a bug that is why I posted it here in addition to stackoverflow

thank you very much in advance

@LeoNatan
Copy link
Contributor

LeoNatan commented Apr 5, 2018

It's a bug in the Detox printer. We already have an issue on the topic of bad printing (#560).
The actual message is revealed in the verbose log:

Waiting for window's root view controller's view to appear.

Something is ill-defined in your app—I'd guess in how it is being started in the native part.

I'm tempted to close as "stack overflow", but let's see.

@LeoNatan LeoNatan changed the title Sync App State: undefined Stuck in "Waiting for window's root view controller's view to appear." Apr 5, 2018
@LeoNatan
Copy link
Contributor

LeoNatan commented Apr 5, 2018

I see you already have a question on Stack Overflow.

@support
Copy link

support bot commented Apr 5, 2018

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

@wildseansy
Copy link

I'm seeing the same thing, but only when having a .tap and reloadReactNative after the test. More details here: #691

@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants