Closed Castone22 closed 5 years ago
No description provided.
@Castone22 show a couple of examples of this being used
Added some examples in the last commit, and defaulted add_element to use a core_element unless you specify an element type (since often times the core-element's logic is enough validation for the presence of a structural element, they usually make pretty good parents)
@greenarrowdb Something else to think about here. Often times when using parents, we don't need a selector beyond the element type, see create_account_with_parents_page.rb:15
Current implementation forces us to use one, and setting parent as a valid selector type would cause us to try to pass it to watir if i'm understanding how we pass selectors to watir.
I wanted to capture our discussion last night. Is this just waiting on a naming convention alteration or is there a substantive change that was needed before accepting this change?
Something @greenarrowdb brought up in discussion was that add_element kind of looks like a default thing, what he doesn't want to happen is that we end up with a situation where someone takes one look at the add element lines and tries to create a bunch of custom logic around them to support something like a text box instead of just using add_text_box. We'll want to think of a way to mitigate this.
For now we can merge it in current state i'd say, but we'll want to add an issue to deprecate using add_element and replace it with something like add_parent_element or add_generic_element
Current behavior: Providing multiple selectors to an element creation method eg
Will cause it to pick the last defined selector within @@locator_elements (with no failure message making the fact that it did this very unclear)
Post Behavior: All selectors will be considered when selecting an element.
The purpose of this change is to reduce how often we have to rely on xpath selectors, as it's quite easy to write brittle and unreadable ones.