Commit 099613f4 authored by Sanad Liaquat's avatar Sanad Liaquat

Add qa element

parent d74b3cc1
...@@ -163,6 +163,7 @@ export default class LazyLoader { ...@@ -163,6 +163,7 @@ export default class LazyLoader {
img.removeAttribute('data-src'); img.removeAttribute('data-src');
img.classList.remove('lazy'); img.classList.remove('lazy');
img.classList.add('js-lazy-loaded'); img.classList.add('js-lazy-loaded');
img.classList.add('qa-js-lazy-loaded');
} }
} }
} }
...@@ -10,12 +10,16 @@ module QA ...@@ -10,12 +10,16 @@ module QA
element :label_svg element :label_svg
end end
view 'app/assets/javascripts/lazy_loader.js' do
element :js_lazy_loaded
end
def go_to_new_label 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 # 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. # before clicking the button.
within_element(:label_svg) do within_element(:label_svg) do
has_css?('.js-lazy-loaded') has_element?(:js_lazy_loaded)
end end
click_element :label_create_new click_element :label_create_new
......
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