-
Notifications
You must be signed in to change notification settings - Fork 3
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
Store element's found method #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this functionality needs to be implemented at a higher layer:
- There could be any number of ways to look up elements that don't fit within the
foundUsing
/foundUsingValue
model, for example asking for the currently focused element, or asking for descendants of an element. - This makes a child item (Element) know how to lookup itself, which is an inversion of layering as normally something else like a session or an ancestor element will provide a way to lookup the element.
- This adds extra state that is not represented in the webdriver protocol, and this project should remain as much as possible a direct mapping of that protocol.
I believe the intent is to replicate XCUITest
functionality, but webdriver is a lower-level protocol and it may be that we need an intermediate layer to achieve this if we can't currently do it with our Arc UI testing abstractions.
@@ -175,7 +175,7 @@ public class Session { | |||
return PollResult(value: elementId, success: elementId != nil) | |||
}.value | |||
|
|||
return elementId.map { Element(session: self, id: $0) } | |||
return elementId.map { Element(session: self, id: $0, foundUsing: using, foundUsingValue: value) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original query might also have had a startingAt
value, so immediately rerunning the query using foundUsing
and foundUsingValue
would not return the same result.
I agree this feels like the wrong solution. We've discussed implementing XCUITest as a layer on top of this, which is probably the right solution. |
Yes, this approach has holes, and will be abandoned. |
Store element's found method values, so it can be used to check if the element still exists. This allows a method like element.waitForNonExistence() to be implemented, to handle cases where the id may be reused by the Accessibility provider after an element is deleted.