fsprojects / Canopy.Mobile

Canopy testing framework for mobile apps
https://fsprojects.github.io/Canopy.Mobile/
MIT License
14 stars 12 forks source link

First go at suggestion plausible selectors on find failure, References #19 #29

Closed lefthandedgoat closed 7 years ago

lefthandedgoat commented 7 years ago

This is my first go at it but I think it works pretty well.

I made a couple of adjustments.

the private findElementsBy now takes a By and a String selector, and does the toBy inside of it, so that we can preserve the original selector.

On timeout, it will take the selector or By and find all the elements, and given the text, tag name, and resourceId build up a bunch of possible selectors (including the pseudo selectors we made up) and then run the distance algo on them.

t:Animation -> tv:Animation tv:Animatio -> tv:Animation

etc

Please review and test it locally and tell me what you think!

forki commented 7 years ago

this is great!