Stablized tests: Organization select in user create modal is stale.
This commit is contained in:
parent
295844c72e
commit
f1296f6500
1 changed files with 13 additions and 5 deletions
|
@ -2748,12 +2748,20 @@ wait untill text in selector disabppears
|
||||||
element = instance.find_elements(css: '.modal input.searchableSelect-main')[0]
|
element = instance.find_elements(css: '.modal input.searchableSelect-main')[0]
|
||||||
element.clear
|
element.clear
|
||||||
element.send_keys(data[:organization])
|
element.send_keys(data[:organization])
|
||||||
|
|
||||||
|
begin
|
||||||
|
retries ||= 0
|
||||||
target = nil
|
target = nil
|
||||||
until target
|
until target
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
target = instance.find_elements(css: ".modal li[title='#{data[:organization]}']")[0]
|
target = instance.find_elements(css: ".modal li[title='#{data[:organization]}']")[0]
|
||||||
end
|
end
|
||||||
target.click()
|
target.click()
|
||||||
|
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
||||||
|
sleep retries
|
||||||
|
retries += 1
|
||||||
|
retry if retries < 3
|
||||||
|
end
|
||||||
end
|
end
|
||||||
check(
|
check(
|
||||||
browser: instance,
|
browser: instance,
|
||||||
|
|
Loading…
Reference in a new issue