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

openURL API is broken #561

Closed
LeoNatan opened this issue Feb 5, 2018 · 0 comments
Closed

openURL API is broken #561

LeoNatan opened this issue Feb 5, 2018 · 0 comments

Comments

@LeoNatan
Copy link
Contributor

LeoNatan commented Feb 5, 2018

openURL API is broken—it does not wait for openURLDone response before continuing. This has broken Detox in master after the sync wrap of these commands. There may be more broken API with similar issue.

detox verb ws onOpen [object Object]
detox verb ws send: {"type":"login","params":{"sessionId":"test","role":"tester"},"messageId":0}
detox verb ws onMessage: {"type":"loginSuccess","params":{"sessionId":"test","role":"tester"},"messageId":0}
detox verb ws  
detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
detox verb ws onMessage: {"type":"ready","messageId":-1000,"params":{}}
detox verb ws  
  Deep Links
detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
detox verb ws onMessage: {"type":"ready","messageId":-1000,"params":{}}
detox verb ws  
detox verb ws send: {"type":"openURL","params":{"url":"detoxtesturlscheme://such-string"},"messageId":1}
detox verb ws send: {"type":"invoke","params":{"target":{"type":"Invocation","value":{"target":{"type":"EarlGrey","value":"instance"},"method":"detox_selectElementWithMatcher:","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"GREYMatchers"},"method":"detoxMatcherForText:","args":[{"type":"NSString","value":"detoxtesturlscheme://such-string"}]}}]}},"method":"assertWithMatcher:","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"GREYMatchers"},"method":"matcherForSufficientlyVisible","args":[]}}]},"messageId":2}
detox verb ws onMessage: {"type":"testFailed","messageId":2,"params":{"details":"Cannot find UI Element.\nException with Assertion: {\n  \"Assertion Criteria\" : \"assertWithMatcher:matcherForSufficientlyVisible(>=0.750000)\",\n  \"Element Matcher\" : \"(((((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('detoxtesturlscheme://such-string')) || (kindOfClass('RCTText') && an object with accessibilityLabel \"detoxtesturlscheme://such-string\")) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('detoxtesturlscheme://such-string')) || (kindOfClass('RCTText') && an object with accessibilityLabel \"detoxtesturlscheme://such-string\")) && kindOfClass('RCTScrollView'))))))\",\n  \"Recovery Suggestion\" : \"Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element.\"\n}\n\nError Trace: [\n  {\n    \"Description\" : \"Interaction cannot continue because the desired element was not found.\",\n    \"Error Domain\" : \"com.google.earlgrey.ElementInteractionErrorDomain\",\n    \"Error Code\" : \"0\",\n    \"File Name\" : \"GREYElementInteraction.m\",\n    \"Function Name\" : \"-[GREYElementInteraction matchedElementsWithTimeout:error:]\",\n    \"Line\" : \"124\"\n  }\n]"}}
detox verb ws  
    1) device.openURL({url: url}) should trigger handling of deep links in app when app is in foreground

detox verb ws send: {"type":"cleanup","params":{"stopRunner":false},"messageId":3}
detox verb ws onMessage: {"type":"openURLDone","messageId":1,"params":{}}
detox verb ws  
detox verb ws onMessage: {"type":"cleanupDone","messageId":3,"params":{}}
detox verb ws  

  0 passing (77ms)
  1 failing

  1) Deep Links
       device.openURL({url: url}) should trigger handling of deep links in app when app is in foreground:
     Error: Error: Cannot find UI Element.
Exception with Assertion: {
  "Assertion Criteria" : "assertWithMatcher:matcherForSufficientlyVisible(>=0.750000)",
  "Element Matcher" : "(((((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('detoxtesturlscheme://such-string')) || (kindOfClass('RCTText') && an object with accessibilityLabel "detoxtesturlscheme://such-string")) && !(kindOfClass('RCTScrollView'))) || (kindOfClass('UIScrollView') && ((kindOfClass('UIView') || respondsToSelector(accessibilityContainer)) && ancestorThatMatches(((((kindOfClass('UILabel') || kindOfClass('UITextField') || kindOfClass('UITextView')) && hasText('detoxtesturlscheme://such-string')) || (kindOfClass('RCTText') && an object with accessibilityLabel "detoxtesturlscheme://such-string")) && kindOfClass('RCTScrollView'))))))",
  "Recovery Suggestion" : "Check if the element exists in the UI hierarchy printed below. If it exists, adjust the matcher so that it accurately matches element."
}

Error Trace: [
  {
    "Description" : "Interaction cannot continue because the desired element was not found.",
    "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code" : "0",
    "File Name" : "GREYElementInteraction.m",
    "Function Name" : "-[GREYElementInteraction matchedElementsWithTimeout:error:]",
    "Line" : "124"
  }
]
      at Client.execute (/Users/lnatan/Desktop/Code/Detox/detox/src/client/Client.js:66:13)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)



child_process.js:644
    throw err;
    ^

Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.none --loglevel verbose     
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at runMocha (/Users/lnatan/Desktop/Code/Detox/detox/local-cli/detox-test.js:72:6)
    at Object.<anonymous> (/Users/lnatan/Desktop/Code/Detox/detox/local-cli/detox-test.js:50:5)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)

Notice how invoke is called directly after openURL.

@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