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
Léo-Paul Géneau
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
...
@@ -31,6 +31,8 @@ describe 'Clusters Applications', :js do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
it
'user can install applications'
do
it
'user can install applications'
do
wait_for_requests
page
.
within
(
'.js-cluster-application-row-helm'
)
do
page
.
within
(
'.js-cluster-application-row-helm'
)
do
expect
(
page
.
find
(
:css
,
'.js-cluster-application-install-button'
)[
'disabled'
]).
to
be_nil
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'
)
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button'
,
exact_text:
'Install'
)
...
@@ -44,6 +46,8 @@ describe 'Clusters Applications', :js do
...
@@ -44,6 +46,8 @@ describe 'Clusters Applications', :js do
page
.
within
(
'.js-cluster-application-row-helm'
)
do
page
.
within
(
'.js-cluster-application-row-helm'
)
do
page
.
find
(
:css
,
'.js-cluster-application-install-button'
).
click
page
.
find
(
:css
,
'.js-cluster-application-install-button'
).
click
end
end
wait_for_requests
end
end
it
'they see status transition'
do
it
'they see status transition'
do
...
@@ -52,8 +56,6 @@ describe 'Clusters Applications', :js 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
.
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'
,
exact_text:
'Installing'
)
wait_until_app_created!
(
'helm'
)
Clusters
::
Cluster
.
last
.
application_helm
.
make_installing!
Clusters
::
Cluster
.
last
.
application_helm
.
make_installing!
# FE starts polling and update the buttons to "Installing"
# FE starts polling and update the buttons to "Installing"
...
@@ -113,7 +115,7 @@ describe 'Clusters Applications', :js do
...
@@ -113,7 +115,7 @@ describe 'Clusters Applications', :js do
click_button
'Install'
click_button
'Install'
wait_
until_app_created!
(
'knative'
)
wait_
for_requests
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button'
,
exact_text:
'Installing'
)
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button'
,
exact_text:
'Installing'
)
...
@@ -143,7 +145,7 @@ describe 'Clusters Applications', :js do
...
@@ -143,7 +145,7 @@ describe 'Clusters Applications', :js do
click_button
'Save changes'
click_button
'Save changes'
wait_
until_app_updated!
(
cluster
.
application_knative
)
wait_
for_requests
expect
(
domainname_form_value
).
to
eq
(
'new.domain.example.org'
)
expect
(
domainname_form_value
).
to
eq
(
'new.domain.example.org'
)
end
end
...
@@ -202,6 +204,8 @@ describe 'Clusters Applications', :js do
...
@@ -202,6 +204,8 @@ describe 'Clusters Applications', :js do
page
.
within
(
'.js-cluster-application-row-ingress'
)
do
page
.
within
(
'.js-cluster-application-row-ingress'
)
do
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button:not([disabled])'
)
expect
(
page
).
to
have_css
(
'.js-cluster-application-install-button:not([disabled])'
)
page
.
find
(
:css
,
'.js-cluster-application-install-button'
).
click
page
.
find
(
:css
,
'.js-cluster-application-install-button'
).
click
wait_for_requests
end
end
end
end
...
@@ -238,25 +242,4 @@ describe 'Clusters Applications', :js do
...
@@ -238,25 +242,4 @@ describe 'Clusters Applications', :js do
end
end
end
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
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