Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8c22c654
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,发现更多精彩内容 >>
提交
8c22c654
编写于
1月 09, 2018
作者:
G
Grzegorz Bizon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add QA page views / elements couling with the menu
上级
dee047aa
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
38 addition
and
13 deletion
+38
-13
app/views/dashboard/_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+1
-1
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+2
-2
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+3
-3
qa/qa/page/base.rb
qa/qa/page/base.rb
+4
-0
qa/qa/page/main/oauth.rb
qa/qa/page/main/oauth.rb
+4
-0
qa/qa/page/menu/main.rb
qa/qa/page/menu/main.rb
+24
-7
未找到文件。
app/views/dashboard/_projects_head.html.haml
浏览文件 @
8c22c654
...
...
@@ -6,7 +6,7 @@
.fade-right
=
icon
(
'angle-right'
)
%ul
.nav-links.scrolling-tabs
=
nav_link
(
page:
[
dashboard_projects_path
,
root_path
])
do
=
link_to
dashboard_projects_path
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
=
link_to
dashboard_projects_path
,
class:
'shortcuts-activity
qa-your-projects-link
'
,
data:
{
placement:
'right'
}
do
Your projects
=
nav_link
(
page:
starred_dashboard_projects_path
)
do
=
link_to
starred_dashboard_projects_path
,
data:
{
placement:
'right'
}
do
...
...
app/views/layouts/header/_default.html.haml
浏览文件 @
8c22c654
%header
.navbar.navbar-gitlab
%header
.navbar.navbar-gitlab
.qa-navbar
%a
.sr-only.gl-accessibility
{
href:
"#content-body"
,
tabindex:
"1"
}
Skip to content
.container-fluid
.header-content
...
...
@@ -43,7 +43,7 @@
=
todos_count_format
(
todos_pending_count
)
%li
.header-user.dropdown
=
link_to
current_user
,
class:
user_dropdown_class
,
data:
{
toggle:
"dropdown"
}
do
=
image_tag
avatar_icon
(
current_user
,
23
),
width:
23
,
height:
23
,
class:
"header-user-avatar"
=
image_tag
avatar_icon
(
current_user
,
23
),
width:
23
,
height:
23
,
class:
"header-user-avatar
qa-user-avatar
"
=
sprite_icon
(
'angle-down'
,
css_class:
'caret-down'
)
.dropdown-menu-nav.dropdown-menu-align-right
%ul
...
...
app/views/layouts/nav/_dashboard.html.haml
浏览文件 @
8c22c654
%ul
.list-unstyled.navbar-sub-nav
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
id:
'nav-projects-dropdown'
,
class:
"home dropdown header-projects"
})
do
=
nav_link
(
path:
[
'root#index'
,
'projects#trending'
,
'projects#starred'
,
'dashboard/projects#index'
],
html_options:
{
id:
'nav-projects-dropdown'
,
class:
"home dropdown header-projects
qa-projects-dropdown
"
})
do
%a
{
href:
"#"
,
data:
{
toggle:
"dropdown"
}
}
Projects
=
sprite_icon
(
'angle-down'
,
css_class:
'caret-down'
)
.dropdown-menu.projects-dropdown-menu
=
render
"layouts/nav/projects_dropdown/show"
=
nav_link
(
controller:
[
'dashboard/groups'
,
'explore/groups'
],
html_options:
{
class:
"hidden-xs"
})
do
=
nav_link
(
controller:
[
'dashboard/groups'
,
'explore/groups'
],
html_options:
{
class:
"hidden-xs
qa-groups-link
"
})
do
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
Groups
...
...
@@ -59,7 +59,7 @@
%li
.line-separator.hidden-xs
-
if
current_user
.
admin?
=
nav_link
(
controller:
'admin/dashboard'
)
do
=
link_to
admin_root_path
,
class:
'admin-icon'
,
title:
'Admin area'
,
aria:
{
label:
"Admin area"
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
link_to
admin_root_path
,
class:
'admin-icon
qa-admin-area-link
'
,
title:
'Admin area'
,
aria:
{
label:
"Admin area"
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
sprite_icon
(
'admin'
,
size:
18
)
-
if
Gitlab
::
Sherlock
.
enabled?
%li
...
...
qa/qa/page/base.rb
浏览文件 @
8c22c654
...
...
@@ -40,6 +40,10 @@ module QA
page
.
within
(
selector
)
{
yield
}
if
block_given?
end
def
click_element
(
name
)
find
(
"qa-
#{
name
.
tr
(
'_'
,
'-'
)
}
"
).
click
end
def
self
.
path
raise
NotImplementedError
end
...
...
qa/qa/page/main/oauth.rb
浏览文件 @
8c22c654
...
...
@@ -2,6 +2,10 @@ module QA
module
Page
module
Main
class
OAuth
<
Page
::
Base
view
'app/views/doorkeeper/authorizations/new.html.haml'
do
element
:authorization_button
,
'submit_tag "Authorize"'
end
def
needs_authorization?
page
.
current_url
.
include?
(
'/oauth'
)
end
...
...
qa/qa/page/menu/main.rb
浏览文件 @
8c22c654
...
...
@@ -2,19 +2,36 @@ module QA
module
Page
module
Menu
class
Main
<
Page
::
Base
view
'app/views/layouts/header/_default.html.haml'
do
element
:navbar
element
:user_avatar
element
:user_menu
,
'.dropdown-menu-nav'
element
:user_sign_out_link
,
'link_to "Sign out"'
end
view
'app/views/layouts/nav/_dashboard.html.haml'
do
element
:admin_area_link
element
:projects_dropdown
element
:groups_link
end
view
'app/views/dashboard/_projects_head.html.haml'
do
element
:your_projects_link
end
def
go_to_groups
within_top_menu
{
click_
link
'Groups'
}
within_top_menu
{
click_
element
:groups_link
}
end
def
go_to_projects
within_top_menu
do
click_
link
'Projects'
click_
link
'Your projects'
click_
element
:projects_dropdown
click_
element
:your_projects_link
end
end
def
go_to_admin_area
within_top_menu
{
find
(
'.admin-icon'
).
clic
k
}
within_top_menu
{
click_element
:admin_area_lin
k
}
end
def
sign_out
...
...
@@ -24,20 +41,20 @@ module QA
end
def
has_personal_area?
page
.
has_selector?
(
'.
header-user-dropdown-toggle
'
)
page
.
has_selector?
(
'.
qa-user-avatar
'
)
end
private
def
within_top_menu
page
.
within
(
'.navbar'
)
do
page
.
within
(
'.
qa-
navbar'
)
do
yield
end
end
def
within_user_menu
within_top_menu
do
find
(
'.header-user-dropdown-toggle'
).
click
click_element
:user_avatar
page
.
within
(
'.dropdown-menu-nav'
)
do
yield
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录