Detox icon indicating copy to clipboard operation
Detox copied to clipboard

Discrepancies in Android web-view testing compared to iOS

Open asafkorem opened this issue 1 year ago • 3 comments

Objective: Update the Android WebView API to match iOS functionality, focusing on passing the iOS-only tests (:ios:).

Our testing suite has identified gaps in Android's WebView API compared to iOS.

Issues found:

  • [ ] atIndex for web-views matching is not implemented.
  • [ ] toExist expectation not throwing error on failure.
  • [ ] href & hrefContains matching is broken.
  • [ ] replaceText & clearText in content-editable elements not supported.
  • [ ] getCurrentUrl is throwing error.
  • [ ] CORS issues workaround (disableWebKitSecurity)

asafkorem avatar Mar 12 '24 07:03 asafkorem

I'm considering migrating all JS actions and expectations, as implemented on the iOS end, to a common JS infrastructure that builds the code for the invocation (expectation/action), with the native layer only injecting it into the WebView (instead of using Espresso's APIs for web-view testing). This way, we'll implement all functions from one place, ensuring consistent behavior.

I'd like to hear what you think @d4vidi @gosha212 @noomorph

asafkorem avatar Mar 12 '24 07:03 asafkorem

Yarik suggested to check regarding iframes support (on espresso and on custom JS implementation)

asafkorem avatar Mar 12 '24 09:03 asafkorem

@asafkorem I think it's going to be worth it to at least try to reimplement and see whether the outcome is on par. If there's any added value provided by Espresso, that could uncover it, helping us put things in a better perspective.

d4vidi avatar Mar 24 '24 10:03 d4vidi