BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
092c5601
Commit
092c5601
authored
Feb 16, 2018
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move spinach project network graph tests to RSpec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
parent
049d2cc4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
129 deletions
+75
-129
network_graph.feature
features/project/network_graph.feature
+0
-46
network_graph_spec.rb
spec/features/projects/network_graph_spec.rb
+75
-83
No files found.
features/project/network_graph.feature
deleted
100644 → 0
View file @
049d2cc4
Feature
:
Project Network Graph
Background
:
Given
I sign in as a user
And
I own project
"Shop"
And
I visit project
"Shop"
network page
@javascript
Scenario
:
I
should see project network
Then
page should have network graph
And
page should select
"master"
in select box
And
page should have
"master"
on graph
@javascript
Scenario
:
I
should see project network with 'test' branch
When
I visit project network page on branch 'test'
Then
page should have 'test' on graph
@javascript
Scenario
:
I
should switch
"branch"
and
"tag"
When
I switch ref to
"feature"
Then
page should select
"feature"
in select box
And
page should have
"feature"
on graph
When
I switch ref to
"v1.0.0"
Then
page should select
"v1.0.0"
in select box
And
page should have
"v1.0.0"
on graph
@javascript
Scenario
:
I
should looking for a commit by SHA
When
I looking for a commit by SHA of
"v1.0.0"
Then
page should have network graph
And
page should select
"master"
in select box
And
page should have
"v1.0.0"
on graph
@javascript
Scenario
:
I
should filter selected tag
When
I switch ref to
"v1.0.0"
Then
page should have
"v1.0.0"
in title
Then
page should have content not containing
"v1.0.0"
When
click
"Show only selected branch"
checkbox
Then
page should only have content from
"v1.0.0"
When
click
"Show only selected branch"
checkbox
Then
page should have content not containing
"v1.0.0"
Scenario
:
I
should fail to look for a commit
When
I look for a commit by
";"
Then
I should see non-existent git revision error message
features/steps/project/network_graph
.rb
→
spec/features/projects/network_graph_spec
.rb
View file @
092c5601
class
Spinach
::
Features
::
ProjectNetworkGraph
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedProject
require
'spec_helper'
step
'page should have network graph'
do
expect
(
page
).
to
have_selector
".network-graph"
end
describe
'Project Network Graph'
,
:js
do
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
:project
,
:repository
,
namespace:
user
.
namespace
}
When
'I visit project "Shop" network page'
do
# Stub Graph max_size to speed up test (10 commits vs. 650)
Network
::
Graph
.
stub
(
max_count:
10
)
before
do
sign_in
(
user
)
@project
=
Project
.
find_by
(
name:
"Shop"
)
visit
project_network_path
(
@project
,
"master"
)
# Stub Graph max_size to speed up test (10 commits vs. 650
)
allow
(
Network
::
Graph
).
to
receive
(
:max_count
).
and_return
(
10
)
end
step
"I visit project network page on branch 'test'"
do
visit
project_network_path
(
@project
,
"'test'"
)
end
context
'when branch is master'
do
def
switch_ref_to
(
ref_name
)
first
(
'.js-project-refs-dropdown'
).
click
step
'page should select "master" in select box'
do
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
"master"
end
page
.
within
'.project-refs-form'
do
click_link
ref_name
end
end
step
'page should select "v1.0.0" in select box'
do
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
"v1.0.0"
end
def
click_show_only_selected_branch_checkbox
find
(
'#filter_ref'
).
click
end
step
'page should have "master" on graph'
do
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'master'
before
do
visit
project_network_path
(
project
,
'master'
)
end
end
step
"page should have 'test' on graph"
do
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
"'test'"
it
'renders project network'
do
expect
(
page
).
to
have_selector
".network-graph"
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
"master"
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'master'
end
end
end
When
'I switch ref to "feature"
'
do
first
(
'.js-project-refs-dropdown'
).
click
it
'switches ref to branch
'
do
switch_ref_to
(
'feature'
)
page
.
within
'.project-refs-form'
do
click_link
'feature'
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
'feature'
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'feature'
end
end
end
When
'I switch ref to "v1.0.0"
'
do
first
(
'.js-project-refs-dropdown'
).
click
it
'switches ref to tag
'
do
switch_ref_to
(
'v1.0.0'
)
page
.
within
'.project-refs-form'
do
click_link
'v1.0.0'
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
'v1.0.0'
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'v1.0.0'
end
end
end
When
'click "Show only selected branch" checkbox'
do
find
(
'#filter_ref'
).
click
end
step
'page should have content not containing "v1.0.0"'
do
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'Change some files'
it
'renders by commit sha of "v1.0.0"'
do
page
.
within
".network-form"
do
fill_in
'extended_sha1'
,
with:
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
find
(
'button'
).
click
end
expect
(
page
).
to
have_selector
".network-graph"
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
"master"
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'v1.0.0'
end
end
end
step
'page should have "v1.0.0" in title'
do
expect
(
page
).
to
have_css
'title'
,
text:
'Graph · v1.0.0'
,
visible:
false
end
it
'filters select tag'
do
switch_ref_to
(
'v1.0.0'
)
step
'page should only have content from "v1.0.0"'
do
page
.
within
'.network-graph'
do
expect
(
page
).
not_to
have_content
'Change some files'
end
end
expect
(
page
).
to
have_css
'title'
,
text:
'Graph · v1.0.0'
,
visible:
false
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'Change some files'
end
step
'page should select "feature" in select box'
do
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
"feature"
end
click_show_only_selected_branch_checkbox
step
'page should select "v1.0.0" in select box
'
do
expect
(
page
).
to
have_selector
'.dropdown-menu-toggle'
,
text:
"v1.0.0"
end
page
.
within
'.network-graph
'
do
expect
(
page
).
not_to
have_content
'Change some files'
end
step
'page should have "feature" on graph'
do
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'feature'
end
end
click_show_only_selected_branch_checkbox
When
'I looking for a commit by SHA of "v1.0.0"'
do
page
.
within
".network-form"
do
fill_in
'extended_sha1'
,
with:
'6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
find
(
'button'
).
click
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'Change some files'
end
end
sleep
2
end
step
'page should have "v1.0.0" on graph
'
do
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
'v1.0.0
'
end
end
it
'renders error message when sha commit not exists
'
do
page
.
within
".network-form"
do
fill_in
'extended_sha1'
,
with:
';
'
find
(
'button'
).
click
end
When
'I look for a commit by ";"'
do
page
.
within
".network-form"
do
fill_in
'extended_sha1'
,
with:
';'
find
(
'button'
).
click
expect
(
page
).
to
have_selector
'.flash-alert'
,
text:
"Git revision ';' does not exist."
end
end
step
'I should see non-existent git revision error message'
do
expect
(
page
).
to
have_selector
'.flash-alert'
,
text:
"Git revision ';' does not exist."
it
'renders project network with test branch'
do
visit
project_network_path
(
project
,
"'test'"
)
page
.
within
'.network-graph'
do
expect
(
page
).
to
have_content
"'test'"
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