From d74b3cc1867c92a84515397d08c70a2632417636 Mon Sep 17 00:00:00 2001 From: Sanad Liaquat Date: Fri, 18 Jan 2019 18:37:30 +0500 Subject: Add comments explaining the wait --- qa/qa/page/label/index.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qa/qa/page/label/index.rb b/qa/qa/page/label/index.rb index effe8ca0372..4eb07a51a81 100644 --- a/qa/qa/page/label/index.rb +++ b/qa/qa/page/label/index.rb @@ -11,10 +11,11 @@ module QA end def go_to_new_label - wait(reload: false) do - within_element(:label_svg) do - has_css?('.js-lazy-loaded') - end + # 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?) + # before clicking the button. + within_element(:label_svg) do + has_css?('.js-lazy-loaded') end click_element :label_create_new -- cgit v1.2.1