From ad05cb523dcc59caed3079d704acf813188162b2 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Tue, 24 Jul 2018 16:05:12 +0100 Subject: [PATCH] Fix race condition in auto devops QA spec: ensure we wait for Install button to appear --- qa/qa/page/project/operations/kubernetes/show.rb | 1 + spec/features/projects/clusters/applications_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/qa/page/project/operations/kubernetes/show.rb b/qa/qa/page/project/operations/kubernetes/show.rb index 4923304133e..e831edeb89e 100644 --- a/qa/qa/page/project/operations/kubernetes/show.rb +++ b/qa/qa/page/project/operations/kubernetes/show.rb @@ -16,6 +16,7 @@ module QA def install!(application_name) within(".js-cluster-application-row-#{application_name}") do + page.has_button?('Install', wait: 30) click_on 'Install' end end diff --git a/spec/features/projects/clusters/applications_spec.rb b/spec/features/projects/clusters/applications_spec.rb index 99c6b450633..0b319c46b6d 100644 --- a/spec/features/projects/clusters/applications_spec.rb +++ b/spec/features/projects/clusters/applications_spec.rb @@ -121,8 +121,9 @@ describe 'Clusters Applications', :js do def wait_until_helm_created! retries = 0 - while Clusters::Cluster.last.application_helm.nil? do + while Clusters::Cluster.last.application_helm.nil? raise "Timed out waiting for helm application to be created in DB" if (retries += 1) > 3 + sleep(1) end end