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
Jérome Perrin
gitlab-ce
Commits
0ed3d8a0
Commit
0ed3d8a0
authored
Sep 22, 2017
by
Vitaliy @blackst0ne Klachkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the 'project/shortcuts.feature' spinach test with an rspec analog
parent
92173ac5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
126 deletions
+119
-126
changelogs/unreleased/replace_project_shortcuts-feature.yml
changelogs/unreleased/replace_project_shortcuts-feature.yml
+5
-0
features/project/shortcuts.feature
features/project/shortcuts.feature
+0
-63
features/steps/project/project_shortcuts.rb
features/steps/project/project_shortcuts.rb
+0
-42
spec/features/projects/shortcuts_spec.rb
spec/features/projects/shortcuts_spec.rb
+0
-21
spec/features/projects/user_uses_shortcuts_spec.rb
spec/features/projects/user_uses_shortcuts_spec.rb
+108
-0
spec/support/matchers/navigation_matcher.rb
spec/support/matchers/navigation_matcher.rb
+6
-0
No files found.
changelogs/unreleased/replace_project_shortcuts-feature.yml
0 → 100644
View file @
0ed3d8a0
---
title
:
Replace the 'project/shortcuts.feature' spinach test with an rspec analog
merge_request
:
14431
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
features/project/shortcuts.feature
deleted
100644 → 0
View file @
92173ac5
@dashboard
Feature
:
Project Shortcuts
Background
:
Given
I sign in as a user
And
I own a project
And
I visit my project's commits page
@javascript
Scenario
:
Navigate to files tab
Given
I press
"g"
and
"f"
Then
the active main tab should be Repository
Then
the active sub tab should be Files
@javascript
Scenario
:
Navigate to commits tab
Given
I visit my project's files page
Given
I press
"g"
and
"c"
Then
the active main tab should be Repository
Then
the active sub tab should be Commits
@javascript
Scenario
:
Navigate to graph tab
Given
I press
"g"
and
"n"
Then
the active sub tab should be Graph
And
the active main tab should be Repository
@javascript
Scenario
:
Navigate to repository charts tab
Given
I press
"g"
and
"d"
Then
the active sub tab should be Charts
And
the active main tab should be Repository
@javascript
Scenario
:
Navigate to issues tab
Given
I press
"g"
and
"i"
Then
the active main tab should be Issues
@javascript
Scenario
:
Navigate to merge requests tab
Given
I press
"g"
and
"m"
Then
the active main tab should be Merge Requests
@javascript
Scenario
:
Navigate to snippets tab
Given
I press
"g"
and
"s"
Then
the active main tab should be Snippets
@javascript
Scenario
:
Navigate to wiki tab
Given
I press
"g"
and
"w"
Then
the active main tab should be Wiki
@javascript
Scenario
:
Navigate to project home
Given
I press
"g"
and
"p"
Then
the active sub tab should be Home
And
the active main tab should be Project
@javascript
Scenario
:
Navigate to project feed
Given
I press
"g"
and
"e"
Then
the active sub tab should be Activity
And
the active main tab should be Project
features/steps/project/project_shortcuts.rb
deleted
100644 → 0
View file @
92173ac5
class
Spinach::Features::ProjectShortcuts
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedProject
include
SharedProjectTab
include
SharedShortcuts
step
'I press "g" and "f"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'f'
)
end
step
'I press "g" and "c"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'c'
)
end
step
'I press "g" and "n"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'n'
)
end
step
'I press "g" and "d"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'd'
)
end
step
'I press "g" and "s"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
's'
)
end
step
'I press "g" and "w"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'w'
)
end
step
'I press "g" and "e"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'e'
)
end
end
spec/features/projects/shortcuts_spec.rb
deleted
100644 → 0
View file @
92173ac5
require
'spec_helper'
feature
'Project shortcuts'
do
let
(
:project
)
{
create
(
:project
,
name:
'Victorialand'
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'On a project'
,
js:
true
do
before
do
project
.
team
<<
[
user
,
:master
]
sign_in
user
visit
project_path
(
project
)
end
describe
'pressing "i"'
do
it
'redirects to new issue page'
do
find
(
'body'
).
native
.
send_key
(
'i'
)
expect
(
page
).
to
have_content
(
'Victorialand'
)
end
end
end
end
spec/features/projects/user_uses_shortcuts_spec.rb
0 → 100644
View file @
0ed3d8a0
require
'spec_helper'
describe
'User uses shortcuts'
,
:js
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
visit
(
project_path
(
project
))
end
context
'when navigating to the Overview pages'
do
it
'redirects to the details page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'p'
)
expect
(
page
).
to
have_active_navigation
(
'Overview'
)
expect
(
page
).
to
have_active_sub_navigation
(
'Details'
)
end
it
'redirects to the activity page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'e'
)
expect
(
page
).
to
have_active_navigation
(
'Overview'
)
expect
(
page
).
to
have_active_sub_navigation
(
'Activity'
)
end
end
context
'when navigating to the Repository pages'
do
it
'redirects to the repository files page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'f'
)
expect
(
page
).
to
have_active_navigation
(
'Repository'
)
expect
(
page
).
to
have_active_sub_navigation
(
'Files'
)
end
it
'redirects to the repository commits page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'c'
)
expect
(
page
).
to
have_active_navigation
(
'Repository'
)
expect
(
page
).
to
have_active_sub_navigation
(
'Commits'
)
end
it
'redirects to the repository graph page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'n'
)
expect
(
page
).
to
have_active_navigation
(
'Repository'
)
expect
(
page
).
to
have_active_sub_navigation
(
'Graph'
)
end
it
'redirects to the repository charts page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'd'
)
expect
(
page
).
to
have_active_navigation
(
'Repository'
)
expect
(
page
).
to
have_active_sub_navigation
(
'Charts'
)
end
end
context
'when navigating to the Issues pages'
do
it
'redirects to the issues list page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'i'
)
expect
(
page
).
to
have_active_navigation
(
'Issues'
)
expect
(
page
).
to
have_active_sub_navigation
(
'List'
)
end
it
'redirects to the new issue page'
do
find
(
'body'
).
native
.
send_key
(
'i'
)
expect
(
page
).
to
have_content
(
project
.
title
)
end
end
context
'when navigating to the Merge Requests pages'
do
it
'redirects to the merge requests page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'm'
)
expect
(
page
).
to
have_active_navigation
(
'Merge Requests'
)
end
end
context
'when navigating to the Snippets pages'
do
it
'redirects to the snippets page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
's'
)
expect
(
page
).
to
have_active_navigation
(
'Snippets'
)
end
end
context
'when navigating to the Wiki pages'
do
it
'redirects to the wiki page'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'w'
)
expect
(
page
).
to
have_active_navigation
(
'Wiki'
)
end
end
end
spec/support/matchers/navigation_matcher.rb
View file @
0ed3d8a0
...
@@ -4,3 +4,9 @@ RSpec::Matchers.define :have_active_navigation do |expected|
...
@@ -4,3 +4,9 @@ RSpec::Matchers.define :have_active_navigation do |expected|
expect
(
page
.
find
(
'.sidebar-top-level-items > li.active'
)).
to
have_content
(
expected
)
expect
(
page
.
find
(
'.sidebar-top-level-items > li.active'
)).
to
have_content
(
expected
)
end
end
end
end
RSpec
::
Matchers
.
define
:have_active_sub_navigation
do
|
expected
|
match
do
|
page
|
expect
(
page
.
find
(
'.sidebar-sub-level-items > li.active:not(.fly-out-top-item)'
)).
to
have_content
(
expected
)
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