Commit efd4fbb6 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'ml-retry-check-element' into 'master'

Retry (un)checking an element

Closes #36682

See merge request gitlab-org/gitlab!20340
parents 33df3081 4bbbea40
...@@ -86,11 +86,19 @@ module QA ...@@ -86,11 +86,19 @@ module QA
end end
def check_element(name) def check_element(name)
retry_until(sleep_interval: 1) do
find_element(name).set(true) find_element(name).set(true)
find_element(name).checked?
end
end end
def uncheck_element(name) def uncheck_element(name)
retry_until(sleep_interval: 1) do
find_element(name).set(false) find_element(name).set(false)
!find_element(name).checked?
end
end end
# replace with (..., page = self.class) # replace with (..., page = self.class)
......
...@@ -59,6 +59,18 @@ module QA ...@@ -59,6 +59,18 @@ module QA
elements elements
end end
def check_element(name)
log("checking :#{name}")
super
end
def uncheck_element(name)
log("unchecking :#{name}")
super
end
def click_element(name, page = nil, **kwargs) def click_element(name, page = nil, **kwargs)
msg = ["clicking :#{name}"] msg = ["clicking :#{name}"]
msg << ", expecting to be at #{page.class}" if page msg << ", expecting to be at #{page.class}" if page
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment