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
Léo-Paul Géneau
gitlab-ce
Commits
5d8cd87c
Commit
5d8cd87c
authored
May 14, 2018
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove /features
parent
5f4dc699
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
0 additions
and
1989 deletions
+0
-1989
features/steps/group/members.rb
features/steps/group/members.rb
+0
-68
features/steps/profile/notifications.rb
features/steps/profile/notifications.rb
+0
-20
features/steps/project/commits/branches.rb
features/steps/project/commits/branches.rb
+0
-32
features/steps/project/commits/comments.rb
features/steps/project/commits/comments.rb
+0
-6
features/steps/project/commits/diff_comments.rb
features/steps/project/commits/diff_comments.rb
+0
-6
features/steps/project/create.rb
features/steps/project/create.rb
+0
-23
features/steps/project/issues/filter_labels.rb
features/steps/project/issues/filter_labels.rb
+0
-61
features/steps/project/issues/issues.rb
features/steps/project/issues/issues.rb
+0
-175
features/steps/project/issues/milestones.rb
features/steps/project/issues/milestones.rb
+0
-20
features/steps/project/issues/references.rb
features/steps/project/issues/references.rb
+0
-7
features/steps/project/merge_requests/references.rb
features/steps/project/merge_requests/references.rb
+0
-7
features/steps/project/source/browse_files.rb
features/steps/project/source/browse_files.rb
+0
-435
features/steps/shared/active_tab.rb
features/steps/shared/active_tab.rb
+0
-32
features/steps/shared/admin.rb
features/steps/shared/admin.rb
+0
-11
features/steps/shared/authentication.rb
features/steps/shared/authentication.rb
+0
-56
features/steps/shared/diff_note.rb
features/steps/shared/diff_note.rb
+0
-44
features/steps/shared/group.rb
features/steps/shared/group.rb
+0
-46
features/steps/shared/issuable.rb
features/steps/shared/issuable.rb
+0
-78
features/steps/shared/markdown.rb
features/steps/shared/markdown.rb
+0
-11
features/steps/shared/note.rb
features/steps/shared/note.rb
+0
-21
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+0
-413
features/steps/shared/project.rb
features/steps/shared/project.rb
+0
-102
features/steps/shared/project_tab.rb
features/steps/shared/project_tab.rb
+0
-66
features/steps/shared/shortcuts.rb
features/steps/shared/shortcuts.rb
+0
-18
features/steps/shared/sidebar_active_tab.rb
features/steps/shared/sidebar_active_tab.rb
+0
-31
features/steps/shared/user.rb
features/steps/shared/user.rb
+0
-41
features/support/capybara.rb
features/support/capybara.rb
+0
-50
features/support/db_cleaner.rb
features/support/db_cleaner.rb
+0
-11
features/support/env.rb
features/support/env.rb
+0
-60
features/support/gitaly.rb
features/support/gitaly.rb
+0
-3
features/support/login_helpers.rb
features/support/login_helpers.rb
+0
-19
features/support/rerun.rb
features/support/rerun.rb
+0
-16
No files found.
features/steps/group/members.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::GroupMembers
<
Spinach
::
FeatureSteps
include
WaitForRequests
include
SharedAuthentication
include
SharedPaths
include
SharedGroup
include
SharedUser
step
'I should see user "John Doe" in team list'
do
expect
(
group_members_list
).
to
have_content
(
"John Doe"
)
end
step
'I should not see user "Mary Jane" in team list'
do
expect
(
group_members_list
).
not_to
have_content
(
"Mary Jane"
)
end
step
'I click on the "Remove User From Group" button for "John Doe"'
do
find
(
:css
,
'.project-members-page li'
,
text:
"John Doe"
).
find
(
:css
,
'a.btn-remove'
).
click
# poltergeist always confirms popups.
end
step
'I click on the "Remove User From Group" button for "Mary Jane"'
do
find
(
:css
,
'li'
,
text:
"Mary Jane"
).
find
(
:css
,
'a.btn-remove'
).
click
# poltergeist always confirms popups.
end
step
'I should not see the "Remove User From Group" button for "John Doe"'
do
expect
(
find
(
:css
,
'.project-members-page li'
,
text:
"John Doe"
)).
not_to
have_selector
(
:css
,
'a.btn-remove'
)
# poltergeist always confirms popups.
end
step
'I should not see the "Remove User From Group" button for "Mary Jane"'
do
expect
(
find
(
:css
,
'li'
,
text:
"Mary Jane"
)).
not_to
have_selector
(
:css
,
'a.btn-remove'
)
# poltergeist always confirms popups.
end
step
'I change the "Mary Jane" role to "Developer"'
do
member
=
mary_jane_member
page
.
within
"#group_member_
#{
member
.
id
}
"
do
click_button
member
.
human_access
page
.
within
'.dropdown-menu'
do
click_link
'Developer'
end
wait_for_requests
end
end
step
'I should see "Mary Jane" as "Developer"'
do
member
=
mary_jane_member
page
.
within
"#group_member_
#{
member
.
id
}
"
do
expect
(
page
).
to
have_content
"Developer"
end
end
private
def
mary_jane_member
user
=
User
.
find_by
(
name:
"Mary Jane"
)
owned_group
.
members
.
find_by
(
user_id:
user
.
id
)
end
def
group_members_list
find
(
".panel .content-list"
)
end
end
features/steps/profile/notifications.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProfileNotifications
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
step
'I visit profile notifications page'
do
visit
profile_notifications_path
end
step
'I should see global notifications settings'
do
expect
(
page
).
to
have_content
"Notifications"
end
step
'I select Mention setting from dropdown'
do
first
(
:link
,
"On mention"
).
click
end
step
'I should see Notification saved message'
do
expect
(
page
).
to
have_content
'On mention'
end
end
features/steps/project/commits/branches.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectCommitsBranches
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
step
'I click link "All"'
do
click_link
"All"
end
step
'I click link "Protected"'
do
click_link
"Protected"
end
step
'I click new branch link'
do
click_link
"New branch"
end
step
'I submit new branch form with invalid name'
do
fill_in
'branch_name'
,
with:
'1.0 stable'
page
.
find
(
"body"
).
click
# defocus the branch_name input
select_branch
(
'master'
)
click_button
'Create branch'
end
def
select_branch
(
branch_name
)
find
(
'.git-revision-dropdown-toggle'
).
click
page
.
within
'#new-branch-form .dropdown-menu'
do
click_link
branch_name
end
end
end
features/steps/project/commits/comments.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectCommitsComments
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedNote
include
SharedPaths
include
SharedProject
end
features/steps/project/commits/diff_comments.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectCommitsDiffComments
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedDiffNote
include
SharedPaths
include
SharedProject
end
features/steps/project/create.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectCreate
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedUser
step
'fill project form with valid data'
do
fill_in
'project_path'
,
with:
'Empty'
page
.
within
'#content-body'
do
click_button
"Create project"
end
end
step
'I should see project page'
do
expect
(
page
).
to
have_content
"Empty"
expect
(
current_path
).
to
eq
project_path
(
Project
.
last
)
end
step
'I should see empty project instructions'
do
expect
(
page
).
to
have_content
"git init"
expect
(
page
).
to
have_content
"git remote"
expect
(
page
).
to
have_content
Project
.
last
.
url_to_repo
end
end
features/steps/project/issues/filter_labels.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectIssuesFilterLabels
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
include
Select2Helper
step
'I should see "Bugfix1" in issues list'
do
page
.
within
".issues-list"
do
expect
(
page
).
to
have_content
"Bugfix1"
end
end
step
'I should see "Bugfix2" in issues list'
do
page
.
within
".issues-list"
do
expect
(
page
).
to
have_content
"Bugfix2"
end
end
step
'I should not see "Bugfix2" in issues list'
do
page
.
within
".issues-list"
do
expect
(
page
).
not_to
have_content
"Bugfix2"
end
end
step
'I should not see "Feature1" in issues list'
do
page
.
within
".issues-list"
do
expect
(
page
).
not_to
have_content
"Feature1"
end
end
step
'I click "dropdown close button"'
do
page
.
first
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
sleep
2
end
step
'I click link "feature"'
do
page
.
within
".labels-filter"
do
click_link
"feature"
end
end
step
'project "Shop" has issue "Bugfix1" with labels: "bug", "feature"'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
issue
=
create
(
:issue
,
title:
"Bugfix1"
,
project:
project
)
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'bug'
)
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'feature'
)
end
step
'project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement"'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
issue
=
create
(
:issue
,
title:
"Bugfix2"
,
project:
project
)
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'bug'
)
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'enhancement'
)
end
step
'project "Shop" has issue "Feature1" with labels: "feature"'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
issue
=
create
(
:issue
,
title:
"Feature1"
,
project:
project
)
issue
.
labels
<<
project
.
labels
.
find_by
(
title:
'feature'
)
end
end
features/steps/project/issues/issues.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectIssues
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedIssuable
include
SharedProject
include
SharedNote
include
SharedPaths
include
SharedMarkdown
include
SharedUser
step
'I should not see "Release 0.3" in issues'
do
expect
(
page
).
not_to
have_content
"Release 0.3"
end
step
'I click link "Closed"'
do
find
(
'.issues-state-filters [data-state="closed"] span'
,
text:
'Closed'
).
click
end
step
'I should see "Release 0.3" in issues'
do
expect
(
page
).
to
have_content
"Release 0.3"
end
step
'I should not see "Release 0.4" in issues'
do
expect
(
page
).
not_to
have_content
"Release 0.4"
end
step
'I click link "All"'
do
find
(
'.issues-state-filters [data-state="all"] span'
,
text:
'All'
).
click
# Waits for load
expect
(
find
(
'.issues-state-filters > .active'
)).
to
have_content
'All'
end
step
'I should see issue "Tweet control"'
do
expect
(
page
).
to
have_content
"Tweet control"
end
step
'I click "author" dropdown'
do
page
.
find
(
'.js-author-search'
).
click
sleep
1
end
step
'I see current user as the first user'
do
expect
(
page
).
to
have_selector
(
'.dropdown-content'
,
visible:
true
)
users
=
page
.
all
(
'.dropdown-menu-author .dropdown-content li a'
)
expect
(
users
[
0
].
text
).
to
eq
'Any Author'
expect
(
users
[
1
].
text
).
to
eq
"
#{
current_user
.
name
}
#{
current_user
.
to_reference
}
"
end
step
'I click link "500 error on profile"'
do
click_link
"500 error on profile"
end
step
'I should see label \'bug\' with issue'
do
page
.
within
'.issuable-show-labels'
do
expect
(
page
).
to
have_content
'bug'
end
end
step
'I fill in issue search with "Re"'
do
filter_issue
"Re"
end
step
'I fill in issue search with "Bu"'
do
filter_issue
"Bu"
end
step
'I fill in issue search with ".3"'
do
filter_issue
".3"
end
step
'I fill in issue search with "Something"'
do
filter_issue
"Something"
end
step
'I fill in issue search with ""'
do
filter_issue
""
end
step
'project "Shop" has milestone "v2.2"'
do
milestone
=
create
(
:milestone
,
title:
"v2.2"
,
project:
project
)
3
.
times
{
create
(
:issue
,
project:
project
,
milestone:
milestone
)
}
end
step
'project "Shop" has milestone "v3.0"'
do
milestone
=
create
(
:milestone
,
title:
"v3.0"
,
project:
project
)
3
.
times
{
create
(
:issue
,
project:
project
,
milestone:
milestone
)
}
end
When
'I select milestone "v3.0"'
do
select
"v3.0"
,
from:
"milestone_id"
end
step
'I should see selected milestone with title "v3.0"'
do
issues_milestone_selector
=
"#issue_milestone_id_chzn > a"
expect
(
find
(
issues_milestone_selector
)).
to
have_content
(
"v3.0"
)
end
When
'I select first assignee from "Shop" project'
do
first_assignee
=
project
.
users
.
first
select
first_assignee
.
name
,
from:
"assignee_id"
end
step
'I should see first assignee from "Shop" as selected assignee'
do
issues_assignee_selector
=
"#issue_assignee_id_chzn > a"
assignee_name
=
project
.
users
.
first
.
name
expect
(
find
(
issues_assignee_selector
)).
to
have_content
(
assignee_name
)
end
step
'The list should be sorted by "Least popular"'
do
page
.
within
'.issues-list'
do
page
.
within
'li.issue:nth-child(1)'
do
expect
(
page
).
to
have_content
'Tweet control'
expect
(
page
).
to
have_content
'1 2'
end
page
.
within
'li.issue:nth-child(2)'
do
expect
(
page
).
to
have_content
'Release 0.4'
expect
(
page
).
to
have_content
'2 1'
end
page
.
within
'li.issue:nth-child(3)'
do
expect
(
page
).
to
have_content
'Bugfix'
expect
(
page
).
not_to
have_content
'0 0'
end
end
end
When
'I visit empty project page'
do
project
=
Project
.
find_by
(
name:
'Empty Project'
)
visit
project_path
(
project
)
end
When
"I visit project
\"
Community
\"
issues page"
do
project
=
Project
.
find_by
(
name:
'Community'
)
visit
project_issues_path
(
project
)
end
step
'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\''
do
create
(
:issue
,
title:
'Bugfix1'
,
description:
'Description for issue1'
,
project:
project
)
end
step
'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\''
do
create
(
:issue
,
title:
'Feature1'
,
description:
'Feature submitted for issue1'
,
project:
project
)
end
step
'I fill in issue search with \'Description for issue1\''
do
filter_issue
'Description for issue'
end
step
'I fill in issue search with \'issue1\''
do
filter_issue
'issue1'
end
step
'I fill in issue search with \'Rock and roll\''
do
filter_issue
'Rock and roll'
end
step
'I should see \'Bugfix1\' in issues'
do
expect
(
page
).
to
have_content
'Bugfix1'
end
step
'I should see \'Feature1\' in issues'
do
expect
(
page
).
to
have_content
'Feature1'
end
step
'I should not see \'Bugfix1\' in issues'
do
expect
(
page
).
not_to
have_content
'Bugfix1'
end
def
filter_issue
(
text
)
fill_in
'issuable_search'
,
with:
text
end
end
features/steps/project/issues/milestones.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectIssuesMilestones
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
include
SharedMarkdown
step
'project "Shop" has milestone "v2.2"'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
milestone
=
create
(
:milestone
,
title:
"v2.2"
,
project:
project
,
description:
"# Description header"
)
3
.
times
{
create
(
:issue
,
project:
project
,
milestone:
milestone
)
}
end
When
'I click link "All Issues"'
do
click_link
'All Issues'
end
end
features/steps/project/issues/references.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectIssuesReferences
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedIssuable
include
SharedNote
include
SharedProject
include
SharedUser
end
features/steps/project/merge_requests/references.rb
deleted
100644 → 0
View file @
5f4dc699
class
Spinach::Features::ProjectMergeRequestsReferences
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedIssuable
include
SharedNote
include
SharedProject
include
SharedUser
end
features/steps/project/source/browse_files.rb
deleted
100644 → 0
View file @
5f4dc699
This diff is collapsed.
Click to expand it.
features/steps/shared/active_tab.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedActiveTab
include
Spinach
::
DSL
include
WaitForRequests
after
do
wait_for_requests
if
javascript_test?
end
def
ensure_active_main_tab
(
content
)
expect
(
find
(
'.sidebar-top-level-items > li.active'
)).
to
have_content
(
content
)
end
def
ensure_active_sub_tab
(
content
)
expect
(
find
(
'.sidebar-sub-level-items > li.active:not(.fly-out-top-item)'
)).
to
have_content
(
content
)
end
def
ensure_active_sub_nav
(
content
)
expect
(
find
(
'.layout-nav .controls li.active'
)).
to
have_content
(
content
)
end
step
'no other main tabs should be active'
do
expect
(
page
).
to
have_selector
(
'.sidebar-top-level-items > li.active'
,
count:
1
)
end
step
'no other sub tabs should be active'
do
expect
(
page
).
to
have_selector
(
'.sidebar-sub-level-items > li.active:not(.fly-out-top-item)'
,
count:
1
)
end
step
'no other sub navs should be active'
do
expect
(
page
).
to
have_selector
(
'.layout-nav .controls li.active'
,
count:
1
)
end
end
features/steps/shared/admin.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedAdmin
include
Spinach
::
DSL
step
'there are projects in system'
do
2
.
times
{
create
(
:project
,
:repository
)
}
end
step
'system has users'
do
2
.
times
{
create
(
:user
)
}
end
end
features/steps/shared/authentication.rb
deleted
100644 → 0
View file @
5f4dc699
require
Rails
.
root
.
join
(
'features'
,
'support'
,
'login_helpers'
)
module
SharedAuthentication
include
Spinach
::
DSL
include
LoginHelpers
step
'I sign in as a user'
do
sign_out
(
@user
)
if
@user
@user
=
create
(
:user
)
sign_in
(
@user
)
end
step
'I sign in via the UI'
do
gitlab_sign_in
(
create
(
:user
))
end
step
'I should be redirected to sign in page'
do
expect
(
current_path
).
to
eq
new_user_session_path
end
step
"I logout directly"
do
gitlab_sign_out
end
def
current_user
@user
||
User
.
reorder
(
nil
).
first
end
private
def
gitlab_sign_in
(
user
)
visit
new_user_session_path
fill_in
"user_login"
,
with:
user
.
email
fill_in
"user_password"
,
with:
"12345678"
check
'user_remember_me'
click_button
"Sign in"
@user
=
user
end
def
gitlab_sign_out
return
unless
@user
if
Capybara
.
current_driver
==
Capybara
.
javascript_driver
find
(
'.header-user-dropdown-toggle'
).
click
click_link
'Sign out'
expect
(
page
).
to
have_button
(
'Sign in'
)
else
sign_out
(
@user
)
end
@user
=
nil
end
end
features/steps/shared/diff_note.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedDiffNote
include
Spinach
::
DSL
include
RepoHelpers
include
WaitForRequests
after
do
wait_for_requests
if
javascript_test?
end
step
'I delete a diff comment'
do
find
(
'.note'
).
hover
find
(
".js-note-delete"
).
click
end
step
'I haven\'t written any diff comment text'
do
page
.
within
(
diff_file_selector
)
do
fill_in
"note[note]"
,
with:
""
end
end
step
'The diff comment preview tab should say there is nothing to do'
do
page
.
within
(
diff_file_selector
)
do
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
end
end
step
'I see side-by-side diff button'
do
expect
(
page
).
to
have_content
"Side-by-side"
end
def
diff_file_selector
'.diff-file:nth-of-type(1)'
end
def
click_diff_line
(
code
)
find
(
".line_holder[id='
#{
code
}
'] button"
).
click
end
def
click_parallel_diff_line
(
code
,
line_type
)
find
(
".line_holder.parallel td[id='
#{
code
}
']"
).
find
(
:xpath
,
'preceding-sibling::*[1][self::td]'
).
hover
find
(
".line_holder.parallel button[data-line-code='
#{
code
}
']"
).
click
end
end
features/steps/shared/group.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedGroup
include
Spinach
::
DSL
step
'current user is developer of group "Owned"'
do
is_member_of
(
current_user
.
name
,
"Owned"
,
Gitlab
::
Access
::
DEVELOPER
)
end
step
'"John Doe" is guest of group "Guest"'
do
is_member_of
(
"John Doe"
,
"Guest"
,
Gitlab
::
Access
::
GUEST
)
end
step
'"Mary Jane" is owner of group "Owned"'
do
is_member_of
(
"Mary Jane"
,
"Owned"
,
Gitlab
::
Access
::
OWNER
)
end
step
'"Mary Jane" is guest of group "Owned"'
do
is_member_of
(
"Mary Jane"
,
"Owned"
,
Gitlab
::
Access
::
GUEST
)
end
step
'"Mary Jane" is guest of group "Guest"'
do
is_member_of
(
"Mary Jane"
,
"Guest"
,
Gitlab
::
Access
::
GUEST
)
end
step
'I should see group "TestGroup"'
do
expect
(
page
).
to
have_content
"TestGroup"
end
step
'I should not see group "TestGroup"'
do
expect
(
page
).
not_to
have_content
"TestGroup"
end
protected
def
is_member_of
(
username
,
groupname
,
role
)
user
=
User
.
find_by
(
name:
username
)
||
create
(
:user
,
name:
username
)
group
=
Group
.
find_by
(
name:
groupname
)
||
create
(
:group
,
name:
groupname
)
group
.
add_user
(
user
,
role
)
project
||=
create
(
:project
,
:repository
,
namespace:
group
)
create
(
:closed_issue_event
,
project:
project
)
project
.
add_master
(
user
)
end
def
owned_group
@owned_group
||=
Group
.
find_by
(
name:
"Owned"
)
end
end
features/steps/shared/issuable.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedIssuable
include
Spinach
::
DSL
def
edit_issuable
find
(
'.js-issuable-edit'
,
visible:
true
).
click
end
step
'I leave a comment referencing issue "Community issue"'
do
leave_reference_comment
(
issuable:
Issue
.
find_by
(
title:
'Community issue'
),
from_project_name:
'Enterprise'
)
end
step
'I click link "Edit" for the merge request'
do
edit_issuable
end
step
'I sort the list by "Least popular"'
do
find
(
'button.dropdown-toggle'
).
click
page
.
within
(
'.content ul.dropdown-menu.dropdown-menu-align-right li'
)
do
click_link
'Least popular'
end
end
step
'I click link "Next" in the sidebar'
do
page
.
within
'.issuable-sidebar'
do
click_link
'Next'
end
end
def
create_issuable_for_project
(
project_name
:,
title
:,
type: :issue
)
project
=
Project
.
find_by
(
name:
project_name
)
attrs
=
{
title:
title
,
author:
project
.
users
.
first
,
description:
'# Description header'
}
case
type
when
:issue
attrs
[
:project
]
=
project
when
:merge_request
attrs
.
merge!
(
source_project:
project
,
target_project:
project
,
source_branch:
'fix'
,
target_branch:
'master'
)
end
create
(
type
,
attrs
)
end
def
leave_reference_comment
(
issuable
:,
from_project_name
:)
project
=
Project
.
find_by
(
name:
from_project_name
)
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
"#
#{
issuable
.
to_reference
(
project
)
}
"
click_button
'Comment'
end
end
def
visible_note
(
issuable
:,
from_project_name
:,
user_name
:)
project
=
Project
.
find_by
(
name:
from_project_name
)
expect
(
page
).
to
have_content
(
user_name
)
expect
(
page
).
to
have_content
(
"mentioned in
#{
issuable
.
class
.
to_s
.
titleize
.
downcase
}
#{
issuable
.
to_reference
(
project
)
}
"
)
end
def
expect_sidebar_content
(
content
)
page
.
within
'.issuable-sidebar'
do
expect
(
page
).
to
have_content
content
end
end
end
features/steps/shared/markdown.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedMarkdown
include
Spinach
::
DSL
step
'I should not see the Markdown preview'
do
expect
(
find
(
'.gfm-form .js-md-preview'
)).
not_to
be_visible
end
step
'I haven\'t written any description text'
do
find
(
'.gfm-form'
).
fill_in
'Description'
,
with:
''
end
end
features/steps/shared/note.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedNote
include
Spinach
::
DSL
include
WaitForRequests
after
do
wait_for_requests
if
javascript_test?
end
step
'I haven\'t written any comment text'
do
page
.
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
""
end
end
step
'The comment preview tab should say there is nothing to do'
do
page
.
within
(
".js-main-target-form"
)
do
find
(
'.js-md-preview-button'
).
click
expect
(
find
(
'.js-md-preview'
)).
to
have_content
(
'Nothing to preview.'
)
end
end
end
features/steps/shared/paths.rb
deleted
100644 → 0
View file @
5f4dc699
This diff is collapsed.
Click to expand it.
features/steps/shared/project.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedProject
include
Spinach
::
DSL
# Create a project without caring about what it's called
step
"I own a project"
do
@project
=
create
(
:project
,
:repository
,
namespace:
@user
.
namespace
)
@project
.
add_master
(
@user
)
end
step
"I own a project in some group namespace"
do
@group
=
create
(
:group
,
name:
'some group'
)
@project
=
create
(
:project
,
namespace:
@group
)
@project
.
add_master
(
@user
)
end
def
current_project
@project
||=
Project
.
first
end
# ----------------------------------------
# Visibility of archived project
# ----------------------------------------
step
'I should not see project "Archive"'
do
project
=
Project
.
find_by
(
name:
"Archive"
)
expect
(
page
).
not_to
have_content
project
.
full_name
end
step
'I should see project "Archive"'
do
project
=
Project
.
find_by
(
name:
"Archive"
)
expect
(
page
).
to
have_content
project
.
full_name
end
# ----------------------------------------
# Visibility level
# ----------------------------------------
step
'I should see project "Enterprise"'
do
expect
(
page
).
to
have_content
"Enterprise"
end
step
'I should not see project "Enterprise"'
do
expect
(
page
).
not_to
have_content
"Enterprise"
end
step
'internal project "Internal"'
do
create
(
:project
,
:internal
,
:repository
,
name:
'Internal'
)
end
step
'I should see project "Internal"'
do
page
.
within
'.js-projects-list-holder'
do
expect
(
page
).
to
have_content
"Internal"
end
end
step
'I should not see project "Internal"'
do
page
.
within
'.js-projects-list-holder'
do
expect
(
page
).
not_to
have_content
"Internal"
end
end
step
'I should see project "Community"'
do
expect
(
page
).
to
have_content
"Community"
end
step
'I should not see project "Community"'
do
expect
(
page
).
not_to
have_content
"Community"
end
step
'"John Doe" owns private project "Enterprise"'
do
user_owns_project
(
user_name:
'John Doe'
,
project_name:
'Enterprise'
)
end
step
'"John Doe" owns internal project "Internal"'
do
user_owns_project
(
user_name:
'John Doe'
,
project_name:
'Internal'
,
visibility: :internal
)
end
step
'public empty project "Empty Public Project"'
do
create
:project_empty_repo
,
:public
,
name:
"Empty Public Project"
end
step
'project "Shop" has labels: "bug", "feature", "enhancement"'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
create
(
:label
,
project:
project
,
title:
'bug'
)
create
(
:label
,
project:
project
,
title:
'feature'
)
create
(
:label
,
project:
project
,
title:
'enhancement'
)
end
def
user_owns_project
(
user_name
:,
project_name
:,
visibility: :private
)
user
=
user_exists
(
user_name
,
username:
user_name
.
gsub
(
/\s/
,
''
).
underscore
)
project
=
Project
.
find_by
(
name:
project_name
)
project
||=
create
(
:project
,
visibility
,
name:
project_name
,
namespace:
user
.
namespace
)
project
.
add_master
(
user
)
end
end
features/steps/shared/project_tab.rb
deleted
100644 → 0
View file @
5f4dc699
require_relative
'active_tab'
module
SharedProjectTab
include
Spinach
::
DSL
include
SharedActiveTab
step
'the active main tab should be Project'
do
ensure_active_main_tab
(
'Overview'
)
end
step
'the active main tab should be Repository'
do
ensure_active_main_tab
(
'Repository'
)
end
step
'the active main tab should be Issues'
do
ensure_active_main_tab
(
'Issues'
)
end
step
'the active sub tab should be Members'
do
ensure_active_sub_tab
(
'Members'
)
end
step
'the active main tab should be Merge Requests'
do
ensure_active_main_tab
(
'Merge Requests'
)
end
step
'the active main tab should be Snippets'
do
ensure_active_main_tab
(
'Snippets'
)
end
step
'the active main tab should be Wiki'
do
ensure_active_main_tab
(
'Wiki'
)
end
step
'the active main tab should be Members'
do
ensure_active_main_tab
(
'Members'
)
end
step
'the active main tab should be Settings'
do
ensure_active_main_tab
(
'Settings'
)
end
step
'the active sub tab should be Graph'
do
ensure_active_sub_tab
(
'Graph'
)
end
step
'the active sub tab should be Files'
do
ensure_active_sub_tab
(
'Files'
)
end
step
'the active sub tab should be Commits'
do
ensure_active_sub_tab
(
'Commits'
)
end
step
'the active sub tab should be Home'
do
ensure_active_sub_tab
(
'Details'
)
end
step
'the active sub tab should be Activity'
do
ensure_active_sub_tab
(
'Activity'
)
end
step
'the active sub tab should be Charts'
do
ensure_active_sub_tab
(
'Charts'
)
end
end
features/steps/shared/shortcuts.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedShortcuts
include
Spinach
::
DSL
step
'I press "g" and "p"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'p'
)
end
step
'I press "g" and "i"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'i'
)
end
step
'I press "g" and "m"'
do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'm'
)
end
end
features/steps/shared/sidebar_active_tab.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedSidebarActiveTab
include
Spinach
::
DSL
step
'no other main tabs should be active'
do
expect
(
page
).
to
have_selector
(
'.nav-sidebar li.active'
,
count:
1
)
end
def
ensure_active_main_tab
(
content
)
expect
(
find
(
'.nav-sidebar li.active'
)).
to
have_content
(
content
)
end
step
'the active main tab should be Home'
do
ensure_active_main_tab
(
'Projects'
)
end
step
'the active main tab should be Groups'
do
ensure_active_main_tab
(
'Groups'
)
end
step
'the active main tab should be Projects'
do
ensure_active_main_tab
(
'Projects'
)
end
step
'the active main tab should be Issues'
do
ensure_active_main_tab
(
'Issues'
)
end
step
'the active main tab should be Merge Requests'
do
ensure_active_main_tab
(
'Merge Requests'
)
end
end
features/steps/shared/user.rb
deleted
100644 → 0
View file @
5f4dc699
module
SharedUser
include
Spinach
::
DSL
step
'User "John Doe" exists'
do
user_exists
(
"John Doe"
,
{
username:
"john_doe"
})
end
step
'User "Mary Jane" exists'
do
user_exists
(
"Mary Jane"
,
{
username:
"mary_jane"
})
end
step
'gitlab user "Mike"'
do
create
(
:user
,
name:
"Mike"
)
end
protected
def
user_exists
(
name
,
options
=
{})
User
.
find_by
(
name:
name
)
||
create
(
:user
,
{
name:
name
,
admin:
false
}.
merge
(
options
))
end
step
'I have no ssh keys'
do
@user
.
keys
.
delete_all
end
step
'I click on "Personal projects" tab'
do
page
.
within
'.nav-links'
do
click_link
'Personal projects'
end
expect
(
page
).
to
have_css
(
'.tab-content #projects.active'
)
end
step
'I click on "Contributed projects" tab'
do
page
.
within
'.nav-links'
do
click_link
'Contributed projects'
end
expect
(
page
).
to
have_css
(
'.tab-content #contributed.active'
)
end
end
features/support/capybara.rb
deleted
100644 → 0
View file @
5f4dc699
require
'capybara-screenshot/spinach'
# Give CI some extra time
timeout
=
(
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
])
?
60
:
30
Capybara
.
register_driver
:chrome
do
|
app
|
capabilities
=
Selenium
::
WebDriver
::
Remote
::
Capabilities
.
chrome
(
# This enables access to logs with `page.driver.manage.get_log(:browser)`
loggingPrefs:
{
browser:
"ALL"
,
client:
"ALL"
,
driver:
"ALL"
,
server:
"ALL"
}
)
options
=
Selenium
::
WebDriver
::
Chrome
::
Options
.
new
options
.
add_argument
(
"window-size=1240,1400"
)
# Chrome won't work properly in a Docker container in sandbox mode
options
.
add_argument
(
"no-sandbox"
)
# Run headless by default unless CHROME_HEADLESS specified
options
.
add_argument
(
"headless"
)
unless
ENV
[
'CHROME_HEADLESS'
]
=~
/^(false|no|0)$/i
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab-ee/issues/4252
options
.
add_argument
(
"disable-dev-shm-usage"
)
if
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
]
Capybara
::
Selenium
::
Driver
.
new
(
app
,
browser: :chrome
,
desired_capabilities:
capabilities
,
options:
options
)
end
Capybara
.
javascript_driver
=
:chrome
Capybara
.
default_max_wait_time
=
timeout
Capybara
.
ignore_hidden_elements
=
false
# Keep only the screenshots generated from the last failing test suite
Capybara
::
Screenshot
.
prune_strategy
=
:keep_last_run
# From https://github.com/mattheworiordan/capybara-screenshot/issues/84#issuecomment-41219326
Capybara
::
Screenshot
.
register_driver
(
:chrome
)
do
|
driver
,
path
|
driver
.
browser
.
save_screenshot
(
path
)
end
Spinach
.
hooks
.
before_run
do
TestEnv
.
eager_load_driver_server
end
features/support/db_cleaner.rb
deleted
100644 → 0
View file @
5f4dc699
require
'database_cleaner'
DatabaseCleaner
[
:active_record
].
strategy
=
:deletion
Spinach
.
hooks
.
before_scenario
do
DatabaseCleaner
.
start
end
Spinach
.
hooks
.
after_scenario
do
DatabaseCleaner
.
clean
end
features/support/env.rb
deleted
100644 → 0
View file @
5f4dc699
require
'./spec/simplecov_env'
SimpleCovEnv
.
start!
ENV
[
'RAILS_ENV'
]
=
'test'
require
'./config/environment'
require
'rspec/expectations'
if
ENV
[
'CI'
]
require
'knapsack'
Knapsack
::
Adapters
::
SpinachAdapter
.
bind
end
WebMock
.
enable!
%w(select2_helper test_env repo_helpers wait_for_requests project_forks_helper)
.
each
do
|
f
|
require
Rails
.
root
.
join
(
'spec'
,
'support'
,
'helpers'
,
f
)
end
%w(sidekiq webmock)
.
each
do
|
f
|
require
Rails
.
root
.
join
(
'spec'
,
'support'
,
f
)
end
Dir
[
"
#{
Rails
.
root
}
/features/steps/shared/*.rb"
].
each
{
|
file
|
require
file
}
Spinach
.
hooks
.
before_run
do
include
RSpec
::
Mocks
::
ExampleMethods
include
ActiveJob
::
TestHelper
include
FactoryBot
::
Syntax
::
Methods
include
GitlabRoutingHelper
RSpec
::
Mocks
.
setup
TestEnv
.
init
(
mailer:
false
)
# skip pre-receive hook check so we can use
# web editor and merge
TestEnv
.
disable_pre_receive
end
Spinach
.
hooks
.
after_scenario
do
|
scenario_data
,
step_definitions
|
if
scenario_data
.
tags
.
include?
(
'javascript'
)
include
WaitForRequests
block_and_wait_for_requests_complete
end
end
module
StdoutReporterWithScenarioLocation
# Override the standard reporter to show filename and line number next to each
# scenario for easy, focused re-runs
def
before_scenario_run
(
scenario
,
step_definitions
=
nil
)
@max_step_name_length
=
scenario
.
steps
.
map
(
&
:name
).
map
(
&
:length
).
max
if
scenario
.
steps
.
any?
# rubocop:disable Gitlab/ModuleWithInstanceVariables
name
=
scenario
.
name
# This number has no significance, it's just to line things up
max_length
=
@max_step_name_length
+
19
# rubocop:disable Gitlab/ModuleWithInstanceVariables
out
.
puts
"
\n
#{
'Scenario:'
.
green
}
#{
name
.
light_green
.
ljust
(
max_length
)
}
"
\
" #
#{
scenario
.
feature
.
filename
}
:
#{
scenario
.
line
}
"
end
end
Spinach
::
Reporter
::
Stdout
.
prepend
(
StdoutReporterWithScenarioLocation
)
features/support/gitaly.rb
deleted
100644 → 0
View file @
5f4dc699
Spinach
.
hooks
.
before_scenario
do
allow
(
Gitlab
::
GitalyClient
).
to
receive
(
:feature_enabled?
).
and_return
(
true
)
end
features/support/login_helpers.rb
deleted
100644 → 0
View file @
5f4dc699
module
LoginHelpers
# After inclusion, IntegrationHelpers calls these two methods that aren't
# supported by Spinach, so we perform the end results ourselves
class
<<
self
def
setup
(
*
args
)
Spinach
.
hooks
.
before_scenario
do
Warden
.
test_mode!
end
end
def
teardown
(
*
args
)
Spinach
.
hooks
.
after_scenario
do
Warden
.
test_reset!
end
end
end
include
Devise
::
Test
::
IntegrationHelpers
end
features/support/rerun.rb
deleted
100644 → 0
View file @
5f4dc699
# The spinach-rerun-reporter doesn't define the on_undefined_step
# See it here: https://github.com/javierav/spinach-rerun-reporter/blob/master/lib/spinach/reporter/rerun.rb
require
'spinach-rerun-reporter'
module
Spinach
class
Reporter
class
Rerun
def
on_undefined_step
(
step_data
,
failure
,
step_definitions
=
nil
)
super
step_data
,
failure
,
step_definitions
# save feature file and scenario line
@rerun
<<
"
#{
current_feature
.
filename
}
:
#{
current_scenario
.
line
}
"
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