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
ededa488
Commit
ededa488
authored
Jan 23, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assert on pipeline jobs statuses in CI/CD QA tests
parent
2fe5d932
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
4 deletions
+75
-4
qa/qa.rb
qa/qa.rb
+5
-0
qa/qa/page/menu/side.rb
qa/qa/page/menu/side.rb
+7
-1
qa/qa/page/project/pipeline/index.rb
qa/qa/page/project/pipeline/index.rb
+13
-0
qa/qa/page/project/pipeline/show.rb
qa/qa/page/project/pipeline/show.rb
+23
-0
qa/qa/specs/features/project/pipelines_spec.rb
qa/qa/specs/features/project/pipelines_spec.rb
+27
-3
No files found.
qa/qa.rb
View file @
ededa488
...
...
@@ -109,6 +109,11 @@ module QA
autoload
:DeployKeys
,
'qa/page/project/settings/deploy_keys'
autoload
:Runners
,
'qa/page/project/settings/runners'
end
module
Pipeline
autoload
:Index
,
'qa/page/project/pipeline/index'
autoload
:Show
,
'qa/page/project/pipeline/show'
end
end
module
Admin
...
...
qa/qa/page/menu/side.rb
View file @
ededa488
...
...
@@ -5,7 +5,7 @@ module QA
view
'app/views/layouts/nav/sidebar/_project.html.haml'
do
element
:settings_item
element
:repository_link
,
"title: 'Repository'"
element
:
repository
_link
,
"title: 'CI / CD'"
element
:
pipelines_settings
_link
,
"title: 'CI / CD'"
element
:top_level_items
,
'.sidebar-top-level-items'
end
...
...
@@ -25,6 +25,12 @@ module QA
end
end
def
click_ci_cd_pipelines
within_sidebar
do
click_link
(
'CI / CD'
)
end
end
private
def
hover_settings
...
...
qa/qa/page/project/pipeline/index.rb
0 → 100644
View file @
ededa488
module
QA::Page
module
Project::Pipeline
class
Index
<
QA
::
Page
::
Base
view
'app/assets/javascripts/pipelines/components/pipeline_url.vue'
do
element
:pipeline_link
,
'class="js-pipeline-url-link"'
end
def
go_to_latest_pipeline
first
(
'.js-pipeline-url-link'
).
click
end
end
end
end
qa/qa/page/project/pipeline/show.rb
0 → 100644
View file @
ededa488
module
QA::Page
module
Project::Pipeline
class
Show
<
QA
::
Page
::
Base
view
'app/assets/javascripts/vue_shared/components/header_ci_component.vue'
do
element
:pipeline_header
,
/header class.*ci-header-container.*/
end
def
running?
within
(
'.ci-header-container'
)
do
return
page
.
has_content?
(
'running'
)
end
end
def
has_build?
(
name
,
status: :success
)
within
(
'.pipeline-graph'
)
do
within
(
'.ci-job-component'
,
text:
name
)
do
return
has_selector?
(
".ci-status-icon-
#{
status
}
"
)
end
end
end
end
end
end
qa/qa/specs/features/project/pipelines_spec.rb
View file @
ededa488
...
...
@@ -44,13 +44,13 @@ module QA
push
.
file_name
=
'.gitlab-ci.yml'
push
.
commit_message
=
'Add .gitlab-ci.yml'
push
.
file_content
=
<<~
EOF
echo-success-test
:
test-success
:
tags:
- qa
- test
script: echo 'OK'
echo-failure-test
:
test-failure
:
tags:
- qa
- test
...
...
@@ -58,7 +58,13 @@ module QA
- echo 'FAILURE'
- exit 1
echo-artifacts-test:
test-tags:
tags:
- qa
- docker
script: echo 'NOOP'
test-artifacts:
tags:
- qa
- test
...
...
@@ -72,6 +78,24 @@ module QA
Page
::
Project
::
Show
.
act
{
wait_for_push
}
expect
(
page
).
to
have_content
(
'Add .gitlab-ci.yml'
)
Page
::
Menu
::
Side
.
act
{
click_ci_cd_pipelines
}
expect
(
page
).
to
have_content
(
'All 1'
)
expect
(
page
).
to
have_content
(
'Add .gitlab-ci.yml'
)
puts
'Waiting for the runner to process the pipeline'
sleep
15
# Runner should process all jobs within 15 seconds.
Page
::
Project
::
Pipeline
::
Index
.
act
{
go_to_latest_pipeline
}
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
expect
(
pipeline
).
to
be_running
expect
(
pipeline
).
to
have_build
(
'test-success'
,
status: :success
)
expect
(
pipeline
).
to
have_build
(
'test-failure'
,
status: :failed
)
expect
(
pipeline
).
to
have_build
(
'test-tags'
,
status: :pending
)
expect
(
pipeline
).
to
have_build
(
'test-artifacts'
,
status: :failed
)
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