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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4110e5bd
Commit
4110e5bd
authored
Feb 13, 2020
by
Dan Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor CiBadgeLink and project show page
Define methods for each status Spec should wait for each pipeline
parent
8bb85704
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
15 deletions
+32
-15
qa/qa/page/component/ci_badge_link.rb
qa/qa/page/component/ci_badge_link.rb
+16
-7
qa/qa/page/project/job/show.rb
qa/qa/page/project/job/show.rb
+1
-1
qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb
..._ui/4_verify/pipeline/create_and_process_pipeline_spec.rb
+14
-6
qa/qa/specs/features/ee/browser_ui/6_release/multi-project_pipelines_spec.rb
...s/ee/browser_ui/6_release/multi-project_pipelines_spec.rb
+1
-1
No files found.
qa/qa/page/component/ci_badge_link.rb
View file @
4110e5bd
...
...
@@ -5,7 +5,22 @@ module QA
module
Component
module
CiBadgeLink
COMPLETED_STATUSES
=
%w[passed failed canceled blocked skipped manual]
.
freeze
# excludes created, pending, running
PASSED_STATUS
=
'passed'
.
freeze
INCOMPLETE_STATUSES
=
%w[pending created running]
.
freeze
# e.g. def passed?(timeout: nil); status_badge == 'passed'; end
COMPLETED_STATUSES
.
map
do
|
status
|
define_method
"
#{
status
}
?"
do
|
timeout:
nil
|
timeout
?
completed?
(
timeout:
timeout
)
:
completed?
status_badge
==
status
end
end
# e.g. def pending?; status_badge == 'pending'; end
INCOMPLETE_STATUSES
.
map
do
|
status
|
define_method
"
#{
status
}
?"
do
status_badge
==
status
end
end
def
self
.
included
(
base
)
base
.
view
'app/assets/javascripts/vue_shared/components/ci_badge_link.vue'
do
...
...
@@ -17,12 +32,6 @@ module QA
find_element
(
:status_badge
).
text
end
def
successful?
(
timeout:
60
)
raise
"Timed out waiting for the status to be a valid completed state"
unless
completed?
(
timeout:
timeout
)
status_badge
==
PASSED_STATUS
end
private
def
completed?
(
timeout:
60
)
...
...
qa/qa/page/project/job/show.rb
View file @
4110e5bd
...
...
@@ -21,7 +21,7 @@ module QA::Page
raise
"Timed out waiting for the build trace to load"
unless
loaded?
raise
"Timed out waiting for the status to be a valid completed state"
unless
completed?
(
timeout:
timeout
)
status_badge
==
PASSED_STATUS
passed?
end
# Reminder: You may wish to wait for a particular job status before checking output
...
...
qa/qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb
View file @
4110e5bd
...
...
@@ -68,12 +68,20 @@ module QA
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:click_on_latest_pipeline
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
expect
(
pipeline
).
to
be_running
(
wait:
max_wait
)
expect
(
pipeline
).
to
have_build
(
'test-success'
,
status: :success
,
wait:
max_wait
)
expect
(
pipeline
).
to
have_build
(
'test-failure'
,
status: :failed
,
wait:
max_wait
)
expect
(
pipeline
).
to
have_build
(
'test-tags'
,
status: :pending
,
wait:
max_wait
)
expect
(
pipeline
).
to
have_build
(
'test-artifacts'
,
status: :success
,
wait:
max_wait
)
{
'test-success'
:
:passed
,
'test-failure'
:
:failed
,
'test-tags'
:
:pending
,
'test-artifacts'
:
:passed
}.
each
do
|
job
,
status
|
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
job
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
public_send
(
"be_
#{
status
}
"
)
show
.
click_element
(
:pipeline_path
,
Page
::
Project
::
Pipeline
::
Show
)
end
end
end
end
...
...
qa/qa/specs/features/ee/browser_ui/6_release/multi-project_pipelines_spec.rb
View file @
4110e5bd
...
...
@@ -85,7 +85,7 @@ module QA
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
be_
successful
expect
(
show
).
to
be_
passed
expect
(
show
).
to
have_no_job
(
"downstream_job"
)
show
.
click_linked_job
(
downstream_project_name
)
...
...
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