blob: 99497cbe0ade86e60d6bbc288fefdf59fb362499 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# frozen_string_literal: true
module QA
module Scenario
module Test
module Sanity
class Selectors < Scenario::Template
include Scenario::Bootable
def pages
@pages ||= [QA::Page]
end
def perform(*)
validators = pages.map do |page|
Page::Validator.new(page)
end
validators.flat_map(&:errors).tap do |errors|
break if errors.none?
warn <<~EOS
GitLab QA sanity selectors validation test detected problems
with your merge request!
The purpose of this test is to make sure that GitLab QA tests,
that are entirely black-box, click-driven scenarios, do match
pages structure / layout in 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 the code in `qa/` directory to make it match
current changes in this merge request.
For more help see documentation in `qa/page/README.md` file or
ask for help on #quality 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
warn errors
end
validators.each(&:validate!)
puts 'Views / selectors validation passed!'
end
end
end
end
end
end
QA::Scenario::Test::Sanity::Selectors.prepend_if_ee('QA::EE::Scenario::Test::Sanity::Selectors')
|