Simplify selector finding
This commit is contained in:
parent
9579887857
commit
4aa71967a9
|
@ -21,11 +21,7 @@ def has_attribute?(name, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_first(search)
|
def find_first(search)
|
||||||
omatch = Capybara.match
|
find(search, match: :first)
|
||||||
Capybara.match = :first
|
|
||||||
result = find(search)
|
|
||||||
Capybara.match = omatch
|
|
||||||
result
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_input(name, additional_search = '', type = '')
|
def find_input(name, additional_search = '', type = '')
|
||||||
|
@ -113,8 +109,8 @@ module DontFindable
|
||||||
end
|
end
|
||||||
|
|
||||||
def dont_find(search)
|
def dont_find(search)
|
||||||
dont_find_wrap(search) do
|
if !has_no_selector?(search)
|
||||||
find(search)
|
raise Capybara::ElementFound.new(search)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue