diff options
-rw-r--r-- | app/assets/javascripts/lazy_loader.js | 1 | ||||
-rw-r--r-- | qa/qa/page/label/index.rb | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/lazy_loader.js b/app/assets/javascripts/lazy_loader.js index ee01a73a6e8..66f25b622e0 100644 --- a/app/assets/javascripts/lazy_loader.js +++ b/app/assets/javascripts/lazy_loader.js @@ -163,6 +163,7 @@ export default class LazyLoader { img.removeAttribute('data-src'); img.classList.remove('lazy'); img.classList.add('js-lazy-loaded'); + img.classList.add('qa-js-lazy-loaded'); } } } diff --git a/qa/qa/page/label/index.rb b/qa/qa/page/label/index.rb index 4eb07a51a81..9344371a0b6 100644 --- a/qa/qa/page/label/index.rb +++ b/qa/qa/page/label/index.rb @@ -10,12 +10,16 @@ module QA element :label_svg end + view 'app/assets/javascripts/lazy_loader.js' do + element :js_lazy_loaded + end + def go_to_new_label # The 'labels.svg' takes a fraction of a second to load after which the "New label" button shifts up a bit - # This can cause webdriver to miss the hit so we wait for the svg to load (implicitly with has_css?) + # This can cause webdriver to miss the hit so we wait for the svg to load (implicitly with has_element?) # before clicking the button. within_element(:label_svg) do - has_css?('.js-lazy-loaded') + has_element?(:js_lazy_loaded) end click_element :label_create_new |