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
8c22c654
Commit
8c22c654
authored
Jan 09, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add QA page views / elements couling with the menu
parent
dee047aa
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
13 deletions
+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
No files found.
app/views/dashboard/_projects_head.html.haml
View file @
8c22c654
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
.fade-right
=
icon
(
'angle-right'
)
.fade-right
=
icon
(
'angle-right'
)
%ul
.nav-links.scrolling-tabs
%ul
.nav-links.scrolling-tabs
=
nav_link
(
page:
[
dashboard_projects_path
,
root_path
])
do
=
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
Your projects
=
nav_link
(
page:
starred_dashboard_projects_path
)
do
=
nav_link
(
page:
starred_dashboard_projects_path
)
do
=
link_to
starred_dashboard_projects_path
,
data:
{
placement:
'right'
}
do
=
link_to
starred_dashboard_projects_path
,
data:
{
placement:
'right'
}
do
...
...
app/views/layouts/header/_default.html.haml
View file @
8c22c654
%header
.navbar.navbar-gitlab
%header
.navbar.navbar-gitlab
.qa-navbar
%a
.sr-only.gl-accessibility
{
href:
"#content-body"
,
tabindex:
"1"
}
Skip to content
%a
.sr-only.gl-accessibility
{
href:
"#content-body"
,
tabindex:
"1"
}
Skip to content
.container-fluid
.container-fluid
.header-content
.header-content
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
=
todos_count_format
(
todos_pending_count
)
=
todos_count_format
(
todos_pending_count
)
%li
.header-user.dropdown
%li
.header-user.dropdown
=
link_to
current_user
,
class:
user_dropdown_class
,
data:
{
toggle:
"dropdown"
}
do
=
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'
)
=
sprite_icon
(
'angle-down'
,
css_class:
'caret-down'
)
.dropdown-menu-nav.dropdown-menu-align-right
.dropdown-menu-nav.dropdown-menu-align-right
%ul
%ul
...
...
app/views/layouts/nav/_dashboard.html.haml
View file @
8c22c654
%ul
.list-unstyled.navbar-sub-nav
%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"
}
}
%a
{
href:
"#"
,
data:
{
toggle:
"dropdown"
}
}
Projects
Projects
=
sprite_icon
(
'angle-down'
,
css_class:
'caret-down'
)
=
sprite_icon
(
'angle-down'
,
css_class:
'caret-down'
)
.dropdown-menu.projects-dropdown-menu
.dropdown-menu.projects-dropdown-menu
=
render
"layouts/nav/projects_dropdown/show"
=
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
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups'
,
title:
'Groups'
do
Groups
Groups
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
%li
.line-separator.hidden-xs
%li
.line-separator.hidden-xs
-
if
current_user
.
admin?
-
if
current_user
.
admin?
=
nav_link
(
controller:
'admin/dashboard'
)
do
=
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
)
=
sprite_icon
(
'admin'
,
size:
18
)
-
if
Gitlab
::
Sherlock
.
enabled?
-
if
Gitlab
::
Sherlock
.
enabled?
%li
%li
...
...
qa/qa/page/base.rb
View file @
8c22c654
...
@@ -40,6 +40,10 @@ module QA
...
@@ -40,6 +40,10 @@ module QA
page
.
within
(
selector
)
{
yield
}
if
block_given?
page
.
within
(
selector
)
{
yield
}
if
block_given?
end
end
def
click_element
(
name
)
find
(
"qa-
#{
name
.
tr
(
'_'
,
'-'
)
}
"
).
click
end
def
self
.
path
def
self
.
path
raise
NotImplementedError
raise
NotImplementedError
end
end
...
...
qa/qa/page/main/oauth.rb
View file @
8c22c654
...
@@ -2,6 +2,10 @@ module QA
...
@@ -2,6 +2,10 @@ module QA
module
Page
module
Page
module
Main
module
Main
class
OAuth
<
Page
::
Base
class
OAuth
<
Page
::
Base
view
'app/views/doorkeeper/authorizations/new.html.haml'
do
element
:authorization_button
,
'submit_tag "Authorize"'
end
def
needs_authorization?
def
needs_authorization?
page
.
current_url
.
include?
(
'/oauth'
)
page
.
current_url
.
include?
(
'/oauth'
)
end
end
...
...
qa/qa/page/menu/main.rb
View file @
8c22c654
...
@@ -2,19 +2,36 @@ module QA
...
@@ -2,19 +2,36 @@ module QA
module
Page
module
Page
module
Menu
module
Menu
class
Main
<
Page
::
Base
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
def
go_to_groups
within_top_menu
{
click_
link
'Groups'
}
within_top_menu
{
click_
element
:groups_link
}
end
end
def
go_to_projects
def
go_to_projects
within_top_menu
do
within_top_menu
do
click_
link
'Projects'
click_
element
:projects_dropdown
click_
link
'Your projects'
click_
element
:your_projects_link
end
end
end
end
def
go_to_admin_area
def
go_to_admin_area
within_top_menu
{
find
(
'.admin-icon'
).
clic
k
}
within_top_menu
{
click_element
:admin_area_lin
k
}
end
end
def
sign_out
def
sign_out
...
@@ -24,20 +41,20 @@ module QA
...
@@ -24,20 +41,20 @@ module QA
end
end
def
has_personal_area?
def
has_personal_area?
page
.
has_selector?
(
'.
header-user-dropdown-toggle
'
)
page
.
has_selector?
(
'.
qa-user-avatar
'
)
end
end
private
private
def
within_top_menu
def
within_top_menu
page
.
within
(
'.navbar'
)
do
page
.
within
(
'.
qa-
navbar'
)
do
yield
yield
end
end
end
end
def
within_user_menu
def
within_user_menu
within_top_menu
do
within_top_menu
do
find
(
'.header-user-dropdown-toggle'
).
click
click_element
:user_avatar
page
.
within
(
'.dropdown-menu-nav'
)
do
page
.
within
(
'.dropdown-menu-nav'
)
do
yield
yield
...
...
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