summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/settings/common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/project/settings/common.rb')
-rw-r--r--qa/qa/page/project/settings/common.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/qa/qa/page/project/settings/common.rb b/qa/qa/page/project/settings/common.rb
index c7955124ef3..319cb1045b6 100644
--- a/qa/qa/page/project/settings/common.rb
+++ b/qa/qa/page/project/settings/common.rb
@@ -17,7 +17,12 @@ module QA
def expand_section(name)
page.within('#content-body') do
page.within('section', text: name) do
- click_button 'Expand' unless first('button', text: 'Collapse')
+ # Because it is possible to click the button before the JS toggle code is bound
+ wait(reload: false) do
+ click_button 'Expand' unless first('button', text: 'Collapse')
+
+ page.has_content?('Collapse')
+ end
yield if block_given?
end