Xamarin UI Test incorrectly assumes menu is open

HectorMenesesHectorMeneses USMember ✭✭
edited October 30 in Xamarin.Forms

Hi,

I have an app with a WebView that uses a menu with slideoutjs (https://slideout.js.org/). Hamburger menu on top left corner.

In most of my tests, the menu opens just fine, the test clicks on a link on the menu, the webview navigates to the corresponding page in my webapp.
However, in some cases,

  • the menu does not open,
  • xamarin ui test thinks it did,
  • it also thinks that the link in the menu is available,
  • it "taps" on it
  • and then fails when it does not see an element that was expected in the next page.

Has anyone have seen this behavior before?

looking at slideoutjs it looks like the menu css uses z-index to make it visible... maybe xamarin ui test does not handle z-indexes correctly... would that be part of the reason why Xamarin UI test thinks the menu is visible when it is not?

Another interesting behavior is that in a REPL session when the menu is closed, I can get results for the menu but not for the panel (The panel contains all of the elements that are actually displayed at that moment )

app.Query(x => x.Class("HSRWebView").Css("#panel"))
Query for Class("HSRWebView").Css("#panel") gave 0 results.
[

]

app.Query(x => x.Class("HSRWebView").Css("#menu"))
Query for Class("HSRWebView").Css("#menu") gave 1 results.

BTW, I'm using my own renderer for the webview as you can see (HSRWebView).

Hopefully someone can give me some pointers on how to deal with this issue as I don't want to have false-positives when running my tests.

Thanks,

Hector

Sign In or Register to comment.