Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
fa7b9f50
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fa7b9f50
编写于
3月 08, 2018
作者:
S
Semyon Pupkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move project active tab spinach tests to RSpec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
上级
2e87923d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
137 addition
and
265 deletion
+137
-265
features/project/active_tab.feature
features/project/active_tab.feature
+0
-138
features/steps/project/active_tab.rb
features/steps/project/active_tab.rb
+0
-127
spec/features/projects/actve_tabs_spec.rb
spec/features/projects/actve_tabs_spec.rb
+137
-0
未找到文件。
features/project/active_tab.feature
已删除
100644 → 0
浏览文件 @
2e87923d
Feature
:
Project Active Tab
Background
:
Given
I sign in as a user
And
I own a project
# Main Tabs
Scenario
:
On Project Home
Given
I visit my project's home page
Then
the active sub tab should be Home
And
no other sub tabs should be active
And
the active main tab should be Project
Scenario
:
On Project Repository
Given
I visit my project's files page
Then
the active main tab should be Repository
And
no other main tabs should be active
Scenario
:
On Project Issues
Given
I visit my project's issues page
Then
the active main tab should be Issues
And
no other main tabs should be active
Scenario
:
On Project Merge Requests
Given
I visit my project's merge requests page
Then
the active main tab should be Merge Requests
And
no other main tabs should be active
Scenario
:
On Project Wiki
Given
I visit my project's wiki page
Then
the active main tab should be Wiki
And
no other main tabs should be active
Scenario
:
On Project Members
Given
I visit my project's members page
Then
the active main tab should be Members
And
no other main tabs should be active
# Sub Tabs: Home
Scenario
:
On Project Home/Show
Given
I visit my project's home page
Then
the active sub tab should be Home
And
no other sub tabs should be active
And
the active main tab should be Project
And
no other main tabs should be active
Scenario
:
On Project Home/Activity
Given
I visit my project's home page
And
I click the
"Activity"
tab
Then
the active sub tab should be Activity
And
no other sub tabs should be active
And
the active main tab should be Project
# Sub Tabs: Settings
Scenario
:
On Project Settings/Integrations
Given
I visit my project's settings page
And
I click the
"Integrations"
tab
Then
the active sub tab should be Integrations
And
no other sub tabs should be active
And
the active main tab should be Settings
Scenario
:
On Project Settings/Repository
Given
I visit my project's settings page
And
I click the
"Repository"
tab
Then
the active sub tab should be Repository
And
no other sub tabs should be active
And
the active main tab should be Settings
# Sub Tabs: Repository
Scenario
:
On Project Repository/Files
Given
I visit my project's files page
Then
the active sub tab should be Files
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Repository/Commits
Given
I visit my project's commits page
Then
the active sub tab should be Commits
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Repository/Graph
Given
I visit my project's graph page
Then
the active sub tab should be Graph
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Repository/Compare
Given
I visit my project's commits page
And
I click the
"Compare"
tab
Then
the active sub tab should be Compare
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Repository/Charts
Given
I visit my project's commits page
And
I click the
"Charts"
tab
Then
the active sub tab should be Charts
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Repository/Branches
Given
I visit my project's commits page
And
I click the
"Branches"
tab
Then
the active sub tab should be Branches
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Repository/Tags
Given
I visit my project's commits page
And
I click the
"Tags"
tab
Then
the active sub tab should be Tags
And
no other sub tabs should be active
And
the active main tab should be Repository
Scenario
:
On Project Issues/Browse
Given
I visit my project's issues page
Then
the active main tab should be Issues
And
no other main tabs should be active
Scenario
:
On Project Issues/Milestones
Given
I visit my project's issues page
And
I click the
"Milestones"
sub tab
Then
the active main tab should be Issues
Then
the active sub tab should be Milestones
And
no other main tabs should be active
And
no other sub tabs should be active
Scenario
:
On Project Issues/Labels
Given
I visit my project's issues page
And
I click the
"Labels"
sub tab
Then
the active main tab should be Issues
Then
the active sub tab should be Labels
And
no other main tabs should be active
And
no other sub tabs should be active
features/steps/project/active_tab.rb
已删除
100644 → 0
浏览文件 @
2e87923d
class
Spinach::Features::ProjectActiveTab
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedProject
include
SharedActiveTab
include
SharedProjectTab
# Sub Tabs: Home
step
'I click the "Team" tab'
do
click_link
(
'Members'
)
end
step
'I click the "Attachments" tab'
do
click_link
(
'Attachments'
)
end
step
'I click the "Snippets" tab'
do
page
.
within
(
'.layout-nav'
)
do
click_link
(
'Snippets'
)
end
end
step
'I click the "Edit Project"'
do
page
.
within
'.nav-sidebar'
do
click_link
(
'Edit Project'
)
end
end
step
'I click the "Integrations" tab'
do
page
.
within
'.nav-sidebar'
do
click_link
(
'Integrations'
)
end
end
step
'I click the "Repository" tab'
do
page
.
within
'.sidebar-top-level-items > .active'
do
click_link
(
'Repository'
)
end
end
step
'I click the "Activity" tab'
do
page
.
within
'.sidebar-top-level-items > .active'
do
click_link
(
'Activity'
)
end
end
step
'the active sub tab should be Members'
do
ensure_active_sub_tab
(
'Members'
)
end
step
'the active sub tab should be Integrations'
do
ensure_active_sub_tab
(
'Integrations'
)
end
step
'the active sub tab should be Repository'
do
ensure_active_sub_tab
(
'Repository'
)
end
step
'the active sub tab should be Pages'
do
ensure_active_sub_tab
(
'Pages'
)
end
step
'the active sub tab should be Activity'
do
ensure_active_sub_tab
(
'Activity'
)
end
# Sub Tabs: Commits
step
'I click the "Compare" tab'
do
click_link
(
'Compare'
)
end
step
'I click the "Branches" tab'
do
page
.
within
'.nav-sidebar'
do
click_link
(
'Branches'
)
end
end
step
'I click the "Tags" tab'
do
click_link
(
'Tags'
)
end
step
'I click the "Charts" tab'
do
page
.
within
(
'.sidebar-top-level-items > .active'
)
do
click_link
(
'Charts'
)
end
end
step
'the active sub tab should be Compare'
do
ensure_active_sub_tab
(
'Compare'
)
end
step
'the active sub tab should be Branches'
do
ensure_active_sub_tab
(
'Branches'
)
end
step
'the active sub tab should be Tags'
do
ensure_active_sub_tab
(
'Tags'
)
end
# Sub Tabs: Issues
step
'I click the "Milestones" sub tab'
do
page
.
within
(
'.nav-sidebar'
)
do
click_link
(
'Milestones'
)
end
end
step
'I click the "Labels" sub tab'
do
page
.
within
(
'.nav-sidebar'
)
do
click_link
(
'Labels'
)
end
end
step
'the active sub tab should be Issues'
do
ensure_active_sub_tab
(
'Issues'
)
end
step
'the active sub tab should be Milestones'
do
ensure_active_sub_tab
(
'Milestones'
)
end
step
'the active sub tab should be Labels'
do
ensure_active_sub_tab
(
'Labels'
)
end
end
spec/features/projects/actve_tabs_spec.rb
0 → 100644
浏览文件 @
fa7b9f50
require
'spec_helper'
describe
'Project active tab'
do
let
(
:user
)
{
create
:user
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
end
def
click_tab
(
title
)
page
.
within
'.sidebar-top-level-items > .active'
do
click_link
(
title
)
end
end
shared_examples
'page has active tab'
do
|
title
|
it
"activates
#{
title
}
tab"
do
expect
(
page
).
to
have_selector
(
'.sidebar-top-level-items > li.active'
,
count:
1
)
expect
(
find
(
'.sidebar-top-level-items > li.active'
)).
to
have_content
(
title
)
end
end
shared_examples
'page has active sub tab'
do
|
title
|
it
"activates
#{
title
}
sub tab"
do
expect
(
page
).
to
have_selector
(
'.sidebar-sub-level-items > li.active:not(.fly-out-top-item)'
,
count:
1
)
expect
(
find
(
'.sidebar-sub-level-items > li.active:not(.fly-out-top-item)'
))
.
to
have_content
(
title
)
end
end
context
'on project Home'
do
before
do
visit
project_path
(
project
)
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active sub tab'
,
'Details'
context
'on project Home/Activity'
do
before
do
click_tab
(
'Activity'
)
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active sub tab'
,
'Activity'
end
end
context
'on project Repository'
do
before
do
root_ref
=
project
.
repository
.
root_ref
visit
project_tree_path
(
project
,
root_ref
)
end
it_behaves_like
'page has active tab'
,
'Repository'
%w(Files Commits Graph Compare Charts Branches Tags)
.
each
do
|
sub_menu
|
context
"on project Repository/
#{
sub_menu
}
"
do
before
do
click_tab
(
sub_menu
)
end
it_behaves_like
'page has active tab'
,
'Repository'
it_behaves_like
'page has active sub tab'
,
sub_menu
end
end
end
context
'on project Issues'
do
before
do
visit
project_issues_path
(
project
)
end
it_behaves_like
'page has active tab'
,
'Issues'
%w(Milestones Labels)
.
each
do
|
sub_menu
|
context
"on project Issues/
#{
sub_menu
}
"
do
before
do
click_tab
(
sub_menu
)
end
it_behaves_like
'page has active tab'
,
'Issues'
it_behaves_like
'page has active sub tab'
,
sub_menu
end
end
end
context
'on project Merge Requests'
do
before
do
visit
project_merge_requests_path
(
project
)
end
it_behaves_like
'page has active tab'
,
'Merge Requests'
end
context
'on project Wiki'
do
before
do
visit
project_wiki_path
(
project
,
:home
)
end
it_behaves_like
'page has active tab'
,
'Wiki'
end
context
'on project Members'
do
before
do
visit
project_project_members_path
(
project
)
end
it_behaves_like
'page has active tab'
,
'Members'
end
context
'on project Settings'
do
before
do
visit
edit_project_path
(
project
)
end
context
'on project Settings/Integrations'
do
before
do
click_tab
(
'Integrations'
)
end
it_behaves_like
'page has active tab'
,
'Settings'
it_behaves_like
'page has active sub tab'
,
'Integrations'
end
context
'on project Settings/Repository'
do
before
do
click_tab
(
'Repository'
)
end
it_behaves_like
'page has active tab'
,
'Settings'
it_behaves_like
'page has active sub tab'
,
'Repository'
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录