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
has_some_element? doesn't check for uniqueness #47
Comments
has_element_name?
doesn't check for uniqueness
SO what do we think about the following business questions.
My opinions
|
@luke-hill The problem I'm facing is the following:
The first time I noticed this issue, I was like |
So in solution we propose the following (For now in the 3.x branch).
|
@luke-hill sounds like a plan. I'll try to work on it anytime soon |
Issue to raise for SitePrism framework
supposed there is an element
some_element
defined asand code
Above example will raise an error if
li
element is not unique on the linesome_page.some_element
:Capybara::Ambiguous Exception: Ambiguous match, found N elements matching visible css "li"
This is happening in
site_prism/lib/site_prism/page.rb
Line 113 in 34a1ec9
count: 1
option forelement
.This issues can be seen in various places
there?(:some_element)
,all_there?
etc will also return true for above example. But will fail if you try to interact with elementEnvironment
Expected Behavior
has_some_element?
to return false (maybe with warning "found multiple elements")Actual Behavior
has_some_element?
returns true butsome_element
fails with above errorProposed workaround
The text was updated successfully, but these errors were encountered: