Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6f0a727e
Commit
6f0a727e
authored
7 years ago
by
Vitaliy @blackst0ne Klachkov
Browse files
Options
Download
Email Patches
Plain Diff
Replace the 'project/builds/summary.feature' spinach test with an rspec analog
parent
5d3f7b13
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
73 deletions
+74
-73
changelogs/unreleased/replace_project_builds_summary-feature.yml
...ogs/unreleased/replace_project_builds_summary-feature.yml
+5
-0
features/project/builds/summary.feature
features/project/builds/summary.feature
+0
-30
features/steps/project/builds/summary.rb
features/steps/project/builds/summary.rb
+0
-43
spec/features/projects/jobs/user_browses_job_spec.rb
spec/features/projects/jobs/user_browses_job_spec.rb
+37
-0
spec/features/projects/jobs/user_browses_jobs_spec.rb
spec/features/projects/jobs/user_browses_jobs_spec.rb
+32
-0
No files found.
changelogs/unreleased/replace_project_builds_summary-feature.yml
0 → 100644
View file @
6f0a727e
---
title
:
Replace the 'project/builds/summary.feature' spinach test with an rspec analog
merge_request
:
14177
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
This diff is collapsed.
Click to expand it.
features/project/builds/summary.feature
deleted
100644 → 0
View file @
5d3f7b13
Feature
:
Project Builds Summary
Background
:
Given
I sign in as a user
And
I own a project
And
project has CI enabled
And
project has coverage enabled
And
project has a recent build
@javascript
Scenario
:
I
browse build details page
When
I visit recent build details page
Then
I see details of a build
And
I see build trace
@javascript
Scenario
:
I
browse project builds page
When
I visit project builds page
Then
I see coverage
Then
I see button to CI Lint
@javascript
Scenario
:
I
erase a build
Given
recent build is successful
And
recent build has a build trace
When
I visit recent build details page
And
I click erase build button
Then
recent build has been erased
And
recent build summary does not have artifacts widget
And
recent build summary contains information saying that build has been erased
And
the build count cache is updated
This diff is collapsed.
Click to expand it.
features/steps/project/builds/summary.rb
deleted
100644 → 0
View file @
5d3f7b13
class
Spinach::Features::ProjectBuildsSummary
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedBuilds
include
RepoHelpers
step
'I see coverage'
do
page
.
within
(
'td.coverage'
)
do
expect
(
page
).
to
have_content
"99.9%"
end
end
step
'I see button to CI Lint'
do
page
.
within
(
'.nav-controls'
)
do
ci_lint_tool_link
=
page
.
find_link
(
'CI lint'
)
expect
(
ci_lint_tool_link
[
:href
]).
to
end_with
(
ci_lint_path
)
end
end
step
'I click erase build button'
do
click_link
'Erase'
end
step
'recent build has been erased'
do
expect
(
@build
).
not_to
have_trace
expect
(
@build
.
artifacts_file
.
exists?
).
to
be_falsy
expect
(
@build
.
artifacts_metadata
.
exists?
).
to
be_falsy
end
step
'recent build summary does not have artifacts widget'
do
expect
(
page
).
to
have_no_css
(
'.artifacts'
)
end
step
'recent build summary contains information saying that build has been erased'
do
page
.
within
(
'.erased'
)
do
expect
(
page
).
to
have_content
'Job has been erased'
end
end
step
'the build count cache is updated'
do
expect
(
@build
.
project
.
running_or_pending_build_count
).
to
eq
@build
.
project
.
builds
.
running_or_pending
.
count
(
:all
)
end
end
This diff is collapsed.
Click to expand it.
spec/features/projects/jobs/user_browses_job_spec.rb
0 → 100644
View file @
6f0a727e
require
'spec_helper'
describe
'User browses a job'
,
:js
do
let!
(
:build
)
{
create
(
:ci_build
,
:coverage
,
pipeline:
pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
sha
,
ref:
'master'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_master
(
user
)
project
.
enable_ci
build
.
success
build
.
trace
.
set
(
'job trace'
)
sign_in
(
user
)
visit
(
project_job_path
(
project
,
build
))
end
it
'erases the job log'
do
expect
(
page
).
to
have_content
(
"Job #
#{
build
.
id
}
"
)
expect
(
page
).
to
have_css
(
'#build-trace'
)
click_link
(
'Erase'
)
expect
(
build
).
not_to
have_trace
expect
(
build
.
artifacts_file
.
exists?
).
to
be_falsy
expect
(
build
.
artifacts_metadata
.
exists?
).
to
be_falsy
expect
(
page
).
to
have_no_css
(
'.artifacts'
)
page
.
within
(
'.erased'
)
do
expect
(
page
).
to
have_content
(
'Job has been erased'
)
end
expect
(
build
.
project
.
running_or_pending_build_count
).
to
eq
(
build
.
project
.
builds
.
running_or_pending
.
count
(
:all
))
end
end
This diff is collapsed.
Click to expand it.
spec/features/projects/jobs/user_browses_jobs_spec.rb
0 → 100644
View file @
6f0a727e
require
'spec_helper'
describe
'User browses jobs'
do
let!
(
:build
)
{
create
(
:ci_build
,
:coverage
,
pipeline:
pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
sha
,
ref:
'master'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_master
(
user
)
project
.
enable_ci
project
.
update_attribute
(
:build_coverage_regex
,
/Coverage (\d+)%/
)
sign_in
(
user
)
visit
(
project_jobs_path
(
project
))
end
it
'shows the coverage'
do
page
.
within
(
'td.coverage'
)
do
expect
(
page
).
to
have_content
(
'99.9%'
)
end
end
it
'shows the "CI Lint" button'
do
page
.
within
(
'.nav-controls'
)
do
ci_lint_tool_link
=
page
.
find_link
(
'CI lint'
)
expect
(
ci_lint_tool_link
[
:href
]).
to
end_with
(
ci_lint_path
)
end
end
end
This diff is collapsed.
Click to expand it.
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