Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c08beb50
Commit
c08beb50
authored
Mar 06, 2019
by
João Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use sleep in feature specs
parent
34d837b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
25 deletions
+8
-25
spec/features/projects/clusters/applications_spec.rb
spec/features/projects/clusters/applications_spec.rb
+8
-25
No files found.
spec/features/projects/clusters/applications_spec.rb
View file @
c08beb50
...
...
@@ -31,6 +31,8 @@ describe 'Clusters Applications', :js do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
it
'user can install applications'
do
wait_for_requests
page
.
within
(
'.js-cluster-application-row-helm'
)
do
expect
(
page
.
find
(
:css
,
'.js-cluster-application-install-button'
)[
'disabled'
]).
to
be_nil
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button'
,
exact_text:
'Install'
)
...
...
@@ -44,6 +46,8 @@ describe 'Clusters Applications', :js do
page
.
within
(
'.js-cluster-application-row-helm'
)
do
page
.
find
(
:css
,
'.js-cluster-application-install-button'
).
click
end
wait_for_requests
end
it
'they see status transition'
do
...
...
@@ -52,8 +56,6 @@ describe 'Clusters Applications', :js do
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'
)
wait_until_app_created!
(
'helm'
)
Clusters
::
Cluster
.
last
.
application_helm
.
make_installing!
# FE starts polling and update the buttons to "Installing"
...
...
@@ -113,7 +115,7 @@ describe 'Clusters Applications', :js do
click_button
'Install'
wait_
until_app_created!
(
'knative'
)
wait_
for_requests
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button'
,
exact_text:
'Installing'
)
...
...
@@ -143,7 +145,7 @@ describe 'Clusters Applications', :js do
click_button
'Save changes'
wait_
until_app_updated!
(
cluster
.
application_knative
)
wait_
for_requests
expect
(
domainname_form_value
).
to
eq
(
'new.domain.example.org'
)
end
...
...
@@ -202,6 +204,8 @@ describe 'Clusters Applications', :js do
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
wait_for_requests
end
end
...
...
@@ -238,25 +242,4 @@ describe 'Clusters Applications', :js do
end
end
end
def
wait_until_app_created!
(
app
)
retries
=
0
while
Clusters
::
Cluster
.
last
.
send
(
"application_
#{
app
}
"
).
nil?
raise
"Timed out waiting for
#{
app
}
application to be created in DB"
if
(
retries
+=
1
)
>
3
sleep
(
1
)
end
end
def
wait_until_app_updated!
(
app
)
retries
=
0
updated_at
=
app
.
updated_at
while
updated_at
==
app
.
reload
.
updated_at
raise
"Timed out waiting for
#{
app
}
application to be created in DB"
if
(
retries
+=
1
)
>
3
sleep
(
1
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment