summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-03-01 11:59:44 +1100
committerDylan Griffith <dyl.griffith@gmail.com>2018-03-01 12:01:50 +1100
commitebac9c81ad1e859afe73482dd6f112b141cf9ede (patch)
tree4313a10dcc532b44ab7d2218976d025b6e5382c1
parent0f00ee1640b529f1bfc3b8658ba76bfe620a3d03 (diff)
downloadgitlab-ce-ebac9c81ad1e859afe73482dd6f112b141cf9ede.tar.gz
Fix feature spec Clusters Applications (#17052)42643-persist-external-ip-of-ingress-controller-gke
We need to actually wait for the "Install" button to be enabled before clicking it otherwise we have a race condition where it sometimes works. Also change the `expect(page.find(...))` to `expect(page).to have_css` as this is prefered to avoid race conditions
-rw-r--r--spec/features/projects/clusters/applications_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/features/projects/clusters/applications_spec.rb b/spec/features/projects/clusters/applications_spec.rb
index f09533aa349..7b2c57aa652 100644
--- a/spec/features/projects/clusters/applications_spec.rb
+++ b/spec/features/projects/clusters/applications_spec.rb
@@ -78,6 +78,7 @@ feature 'Clusters Applications', :js do
create(:clusters_applications_helm, :installed, cluster: cluster)
page.within('.js-cluster-application-row-ingress') do
+ expect(page).to have_css('.js-cluster-application-install-button:not([disabled])')
page.find(:css, '.js-cluster-application-install-button').click
end
end
@@ -85,20 +86,20 @@ feature 'Clusters Applications', :js do
it 'he sees status transition' do
page.within('.js-cluster-application-row-ingress') do
# FE sends request and gets the response, then the buttons is "Install"
- expect(page.find(:css, '.js-cluster-application-install-button')['disabled']).to eq('true')
+ expect(page).to have_css('.js-cluster-application-install-button[disabled]')
expect(page).to have_css('.js-cluster-application-install-button', exact_text: 'Install')
Clusters::Cluster.last.application_ingress.make_installing!
# FE starts polling and update the buttons to "Installing"
- expect(page.find(:css, '.js-cluster-application-install-button')['disabled']).to eq('true')
expect(page).to have_css('.js-cluster-application-install-button', exact_text: 'Installing')
+ expect(page).to have_css('.js-cluster-application-install-button[disabled]')
# The application becomes installed but we keep waiting for external IP address
Clusters::Cluster.last.application_ingress.make_installed!
- expect(page.find(:css, '.js-cluster-application-install-button')['disabled']).to eq('true')
expect(page).to have_css('.js-cluster-application-install-button', exact_text: 'Installed')
+ expect(page).to have_css('.js-cluster-application-install-button[disabled]')
expect(page).to have_selector('.js-no-ip-message')
expect(page.find('.js-ip-address').value).to eq('?')