Welcome to mirror list, hosted at ThFree Co, Russian Federation.

have_matcher.rb « matchers « support « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a9b365f7e8188cc57b9a8ac13f199574493a1d32 (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
# frozen_string_literal: true

module QA
  module Support
    module Matchers
      module HaveMatcher
        PREDICATE_TARGETS = %w[
          auto_devops_container
          element
          file_content
          assignee
          child_pipeline
          linked_pipeline
          content
          design
          file
          issue
          job
          package
          pipeline
          related_issue_item
          sast_status
          security_configuration_history_link
          snippet_description
          tag
          label
          variable
          system_note
          alert_with_title
          incident
          framework
        ].each do |predicate|
          RSpec::Matchers.define "have_#{predicate}" do |*args, **kwargs|
            match do |page_object|
              page_object.public_send("has_#{predicate}?", *args, **kwargs)
            end

            match_when_negated do |page_object|
              page_object.public_send("has_no_#{predicate}?", *args, **kwargs)
            end
          end
        end
      end
    end
  end
end