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
9910968f
Commit
9910968f
authored
Jan 10, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix QA selector class used to click on QA elements
parent
fc9ecdbb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+2
-2
qa/qa/page/base.rb
qa/qa/page/base.rb
+1
-1
qa/qa/page/element.rb
qa/qa/page/element.rb
+4
-0
qa/spec/page/element_spec.rb
qa/spec/page/element_spec.rb
+8
-1
No files found.
app/views/layouts/nav/_dashboard.html.haml
View file @
9910968f
...
...
@@ -6,8 +6,8 @@
.dropdown-menu.projects-dropdown-menu
=
render
"layouts/nav/projects_dropdown/show"
=
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
=
nav_link
(
controller:
[
'dashboard/groups'
,
'explore/groups'
],
html_options:
{
class:
"hidden-xs"
})
do
=
link_to
dashboard_groups_path
,
class:
'dashboard-shortcuts-groups
qa-groups-link
'
,
title:
'Groups'
do
Groups
=
nav_link
(
path:
'dashboard#activity'
,
html_options:
{
class:
"visible-lg"
})
do
...
...
qa/qa/page/base.rb
View file @
9910968f
...
...
@@ -41,7 +41,7 @@ module QA
end
def
click_element
(
name
)
find
(
Page
::
Element
.
new
(
name
).
selector
).
click
find
(
Page
::
Element
.
new
(
name
).
selector
_css
).
click
end
def
self
.
path
...
...
qa/qa/page/element.rb
View file @
9910968f
...
...
@@ -12,6 +12,10 @@ module QA
"qa-
#{
@name
.
to_s
.
tr
(
'_'
,
'-'
)
}
"
end
def
selector_css
".
#{
selector
}
"
end
def
expression
if
@pattern
.
is_a?
(
String
)
@_regexp
||=
Regexp
.
new
(
Regexp
.
escape
(
@pattern
))
...
...
qa/spec/page/element_spec.rb
View file @
9910968f
describe
QA
::
Page
::
Element
do
describe
'#selector'
do
it
'transform element name into QA-specific selector'
do
it
'transform
s
element name into QA-specific selector'
do
expect
(
described_class
.
new
(
:sign_in_button
).
selector
)
.
to
eq
'qa-sign-in-button'
end
end
describe
'#selector_css'
do
it
'transforms element name into QA-specific clickable css selector'
do
expect
(
described_class
.
new
(
:sign_in_button
).
selector_css
)
.
to
eq
'.qa-sign-in-button'
end
end
context
'when pattern is an expression'
do
subject
{
described_class
.
new
(
:something
,
/button 'Sign in'/
)
}
...
...
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