Commit 25cd25fc authored by Michael Kozono's avatar Michael Kozono

Fix intermittent clone over SSH failure

We always clone over HTTP, so if the QA spec attempts to clone over SSH, we know it gathered the wrong repo URI.
parent 6c978c8f
...@@ -13,16 +13,18 @@ module QA ...@@ -13,16 +13,18 @@ module QA
visit current_url visit current_url
end end
def wait(css = '.application', time: 60) def wait(max: 60, time: 1, reload: true)
Time.now.tap do |start| start = Time.now
while Time.now - start < time
break if page.has_css?(css, wait: 5)
refresh while Time.now - start < max
end return true if yield
sleep(time)
refresh if reload
end end
yield if block_given? false
end end
def scroll_to(selector, text: nil) def scroll_to(selector, text: nil)
......
...@@ -10,12 +10,14 @@ module QA ...@@ -10,12 +10,14 @@ module QA
view 'app/views/devise/sessions/_new_base.html.haml' do view 'app/views/devise/sessions/_new_base.html.haml' do
element :login_field, 'text_field :login' element :login_field, 'text_field :login'
element :passowrd_field, 'password_field :password' element :password_field, 'password_field :password'
element :sign_in_button, 'submit "Sign in"' element :sign_in_button, 'submit "Sign in"'
end end
def initialize def initialize
wait('.application', time: 500) wait(max: 500) do
page.has_css?('.application')
end
end end
def sign_in_using_credentials def sign_in_using_credentials
......
...@@ -3,11 +3,9 @@ module QA ...@@ -3,11 +3,9 @@ module QA
module Project module Project
class Show < Page::Base class Show < Page::Base
view 'app/views/shared/_clone_panel.html.haml' do view 'app/views/shared/_clone_panel.html.haml' do
element :clone_holder, '.git-clone-holder'
element :clone_dropdown element :clone_dropdown
element :clone_options_dropdown, '.clone-options-dropdown' element :clone_options_dropdown, '.clone-options-dropdown'
end
view 'app/views/shared/_clone_panel.html.haml' do
element :project_repository_location, 'text_field_tag :project_clone' element :project_repository_location, 'text_field_tag :project_clone'
end end
...@@ -16,10 +14,15 @@ module QA ...@@ -16,10 +14,15 @@ module QA
end end
def choose_repository_clone_http def choose_repository_clone_http
click_element :clone_dropdown wait(reload: false) do
click_element :clone_dropdown
page.within('.clone-options-dropdown') do
click_link('HTTP')
end
page.within('.clone-options-dropdown') do # Ensure git clone textbox was updated to http URI
click_link('HTTP') page.has_css?('.git-clone-holder input#project_clone[value*="http"]')
end end
end end
......
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