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
Boxiang Sun
gitlab-ce
Commits
dee047aa
Commit
dee047aa
authored
Jan 09, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add QA login page views / selectors definition
parent
df774fae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 deletions
+16
-14
qa/qa/page/element.rb
qa/qa/page/element.rb
+0
-4
qa/qa/page/main/login.rb
qa/qa/page/main/login.rb
+12
-0
qa/qa/page/view.rb
qa/qa/page/view.rb
+2
-2
qa/spec/page/view_spec.rb
qa/spec/page/view_spec.rb
+2
-8
No files found.
qa/qa/page/element.rb
View file @
dee047aa
...
@@ -19,10 +19,6 @@ module QA
...
@@ -19,10 +19,6 @@ module QA
def
matches?
(
line
)
def
matches?
(
line
)
!!
(
line
=~
expression
)
!!
(
line
=~
expression
)
end
end
def
to_s
@name
end
end
end
end
end
end
end
qa/qa/page/main/login.rb
View file @
dee047aa
...
@@ -2,6 +2,18 @@ module QA
...
@@ -2,6 +2,18 @@ module QA
module
Page
module
Page
module
Main
module
Main
class
Login
<
Page
::
Base
class
Login
<
Page
::
Base
view
'app/views/devise/passwords/edit.html.haml'
do
element
:password_field
,
'password_field :password'
element
:password_confirmation
,
'password_field :password_confirmation'
element
:change_password_button
,
'submit "Change your password"'
end
view
'app/views/devise/sessions/_new_base.html.haml'
do
element
:login_field
,
'text_field :login'
element
:passowrd_field
,
'password_field :password'
element
:sign_in_button
,
'submit "Sign in"'
end
def
initialize
def
initialize
wait
(
'.application'
,
time:
500
)
wait
(
'.application'
,
time:
500
)
end
end
...
...
qa/qa/page/view.rb
View file @
dee047aa
...
@@ -23,13 +23,13 @@ module QA
...
@@ -23,13 +23,13 @@ module QA
# elements' existence.
# elements' existence.
#
#
@missing
||=
@elements
.
dup
.
tap
do
|
elements
|
@missing
||=
@elements
.
dup
.
tap
do
|
elements
|
File
.
new
(
pathname
.
to_s
).
foreach
do
|
line
|
File
.
foreach
(
pathname
.
to_s
)
do
|
line
|
elements
.
reject!
{
|
element
|
element
.
matches?
(
line
)
}
elements
.
reject!
{
|
element
|
element
.
matches?
(
line
)
}
end
end
end
end
@missing
.
map
do
|
missing
|
@missing
.
map
do
|
missing
|
"Missing element `
#{
missing
}
` in `
#{
pathname
}
` view partial!"
"Missing element `
#{
missing
.
name
}
` in `
#{
pathname
}
` view partial!"
end
end
end
end
...
...
qa/spec/page/view_spec.rb
View file @
dee047aa
...
@@ -24,12 +24,6 @@ describe QA::Page::View do
...
@@ -24,12 +24,6 @@ describe QA::Page::View do
end
end
describe
'#errors'
do
describe
'#errors'
do
let
(
:file
)
{
spy
(
'file'
)
}
before
do
allow
(
File
).
to
receive
(
:new
).
and_return
(
file
)
end
context
'when view partial is present'
do
context
'when view partial is present'
do
before
do
before
do
allow
(
subject
.
pathname
).
to
receive
(
:readable?
)
allow
(
subject
.
pathname
).
to
receive
(
:readable?
)
...
@@ -38,7 +32,7 @@ describe QA::Page::View do
...
@@ -38,7 +32,7 @@ describe QA::Page::View do
context
'when pattern is found'
do
context
'when pattern is found'
do
before
do
before
do
allow
(
f
ile
).
to
receive
(
:foreach
)
allow
(
F
ile
).
to
receive
(
:foreach
)
.
and_yield
(
'some element'
).
once
.
and_yield
(
'some element'
).
once
allow
(
element
).
to
receive
(
:matches?
)
allow
(
element
).
to
receive
(
:matches?
)
.
with
(
'some element'
).
and_return
(
true
)
.
with
(
'some element'
).
and_return
(
true
)
...
@@ -51,7 +45,7 @@ describe QA::Page::View do
...
@@ -51,7 +45,7 @@ describe QA::Page::View do
context
'when pattern has not been found'
do
context
'when pattern has not been found'
do
before
do
before
do
allow
(
f
ile
).
to
receive
(
:foreach
)
allow
(
F
ile
).
to
receive
(
:foreach
)
.
and_yield
(
'some element'
).
once
.
and_yield
(
'some element'
).
once
allow
(
element
).
to
receive
(
:matches?
)
allow
(
element
).
to
receive
(
:matches?
)
.
with
(
'some element'
).
and_return
(
false
)
.
with
(
'some element'
).
and_return
(
false
)
...
...
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