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
e0edf6c7
Commit
e0edf6c7
authored
7 years ago
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve QA sanity selectors test output message
parent
170c07ef
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
3 deletions
+40
-3
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/qa/page/validator.rb
qa/qa/page/validator.rb
+6
-1
qa/qa/scenario/test/sanity/selectors.rb
qa/qa/scenario/test/sanity/selectors.rb
+28
-0
qa/spec/page/base_spec.rb
qa/spec/page/base_spec.rb
+1
-1
No files found.
qa/qa/page/base.rb
View file @
e0edf6c7
...
@@ -50,7 +50,7 @@ module QA
...
@@ -50,7 +50,7 @@ module QA
def
self
.
errors
def
self
.
errors
if
views
.
empty?
if
views
.
empty?
return
[
"
#{
name
}
class does not have views / elements defined!"
]
return
[
"
Page
class does not have views / elements defined!"
]
end
end
views
.
map
(
&
:errors
).
flatten
views
.
map
(
&
:errors
).
flatten
...
...
This diff is collapsed.
Click to expand it.
qa/qa/page/element.rb
View file @
e0edf6c7
...
@@ -19,6 +19,10 @@ module QA
...
@@ -19,6 +19,10 @@ 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
This diff is collapsed.
Click to expand it.
qa/qa/page/validator.rb
View file @
e0edf6c7
...
@@ -2,7 +2,12 @@ module QA
...
@@ -2,7 +2,12 @@ module QA
module
Page
module
Page
class
Validator
class
Validator
ValidationError
=
Class
.
new
(
StandardError
)
ValidationError
=
Class
.
new
(
StandardError
)
Error
=
Struct
.
new
(
:page
,
:message
)
Error
=
Struct
.
new
(
:page
,
:message
)
do
def
to_s
"Error:
#{
page
}
-
#{
message
}
"
end
end
def
initialize
(
constant
)
def
initialize
(
constant
)
@module
=
constant
@module
=
constant
...
...
This diff is collapsed.
Click to expand it.
qa/qa/scenario/test/sanity/selectors.rb
View file @
e0edf6c7
...
@@ -13,6 +13,34 @@ module QA
...
@@ -13,6 +13,34 @@ module QA
end
end
validators
.
map
(
&
:errors
).
flatten
.
tap
do
|
errors
|
validators
.
map
(
&
:errors
).
flatten
.
tap
do
|
errors
|
break
if
errors
.
none?
STDERR
.
puts
<<~
EOS
GitLab QA sanity selectors validation test detected problems
your merge request!
The purpose of this tes is to make sure that GitLab QA tests,
that are entirely black-box and click-driven scenario, do match
pages structure / layout in the GitLab CE / EE repositories.
It looks like you have changed views / pages / selectors, and
these are now out of sync with what we have defined in `qa/`
directory.
Please update code in `qa/` directory to match currect changes
in this merge request.
For more help see documentation in `qa/page/README.md` file or
ask for help on #qa channel on Slack (GitLab Team only).
If you are not a team member, and you still need help to
contribute, please open an issue in GitLab QA issue tracker.
Please see errors described below.
EOS
STDERR
.
puts
errors
end
end
validators
.
each
(
&
:validate!
)
validators
.
each
(
&
:validate!
)
...
...
This diff is collapsed.
Click to expand it.
qa/spec/page/base_spec.rb
View file @
e0edf6c7
...
@@ -56,7 +56,7 @@ describe QA::Page::Base do
...
@@ -56,7 +56,7 @@ describe QA::Page::Base do
it
'appends an error about missing views / elements block'
do
it
'appends an error about missing views / elements block'
do
expect
(
described_class
.
errors
)
expect
(
described_class
.
errors
)
.
to
include
'
QA::Page::Bas
e class does not have views / elements defined!'
.
to
include
'
Pag
e class does not have views / elements defined!'
end
end
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
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