summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2019-01-21 12:26:06 +0000
committerFatih Acet <acetfatih@gmail.com>2019-01-21 12:26:06 +0000
commit466a77517bde33614deb6f1d5583147c3b76b713 (patch)
tree6b00e68da144cdf17bf23fc111129302f8aee75f
parent10d421be3fea1c6b69d773aeba3c08dfa1da38d0 (diff)
parent099613f41248f5c6d7ae5f6dfdb7a753e64c30cd (diff)
downloadgitlab-ce-466a77517bde33614deb6f1d5583147c3b76b713.tar.gz
Merge branch 'qa-nightly-59-fix-new-label-button-hit-miss' into 'master'
Fixes "New label" button hit miss Closes gitlab-org/quality/nightly#59 See merge request gitlab-org/gitlab-ce!24487
-rw-r--r--app/assets/javascripts/lazy_loader.js1
-rw-r--r--app/views/shared/empty_states/_labels.html.haml2
-rw-r--r--qa/qa/page/label/index.rb15
3 files changed, 17 insertions, 1 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/app/views/shared/empty_states/_labels.html.haml b/app/views/shared/empty_states/_labels.html.haml
index bee26cd8312..a739103641e 100644
--- a/app/views/shared/empty_states/_labels.html.haml
+++ b/app/views/shared/empty_states/_labels.html.haml
@@ -1,6 +1,6 @@
.row.empty-state.labels
.col-12
- .svg-content
+ .svg-content.qa-label-svg
= image_tag 'illustrations/labels.svg'
.col-12
.text-content
diff --git a/qa/qa/page/label/index.rb b/qa/qa/page/label/index.rb
index 323acd57743..9344371a0b6 100644
--- a/qa/qa/page/label/index.rb
+++ b/qa/qa/page/label/index.rb
@@ -6,7 +6,22 @@ module QA
element :label_create_new
end
+ view 'app/views/shared/empty_states/_labels.html.haml' do
+ 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_element?)
+ # before clicking the button.
+ within_element(:label_svg) do
+ has_element?(:js_lazy_loaded)
+ end
+
click_element :label_create_new
end
end