Skip to content

Conversation

Castone22
Copy link
Contributor

@Castone22 Castone22 commented Nov 26, 2018

Attempts to reduce replication by checking if the element type is present within the xpath if it's provided, then passes that as a watir element, still supports manual overriding failing an auto detection.

Currently:

add_static_text(:mission_statement, element_type: :h2, xpath: '//section[@class="main-content"]//h2[@class="fancy-text"]')

Given the element type was actually provided in the xpath (h2[@class="fancy-text"]]), it makes sense for Oz to be able to infer it from the path, letting us do:

add_static_text(:mission_statement, xpath: '//section[@class="main-content"]//h2[@class="fancy-text"]')

@greenarrowdb
Copy link
Member

No description provided.

@Castone22
Copy link
Contributor Author

Allows oz to create attempt to infer the element type from an xpath if it is used.

@greenarrowdb
Copy link
Member

That's the 'what' but what is the 'why'?
:)

@Castone22
Copy link
Contributor Author

To reduce replication :)

@greenarrowdb
Copy link
Member

Of what? please provide a use case (yes I know we talked about this one, but I am trying to keep things clean) :)

@Castone22
Copy link
Contributor Author

Might make sense to make this also work for css selectors... though given they are less likely to specify the exact element type you're looking for, and that they have a less standard format than xpaths, might be a lot of work for very little gain.

@ThePROX
Copy link
Contributor

ThePROX commented Jul 2, 2019

What is the current status of this merge request? Are we going forward with this pattern, or does it require some discussion?

Backport changes from oz framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants