summaryrefslogtreecommitdiff
path: root/qa/qa/page/project/secure/configuration_form.rb
blob: 3e89a57e87081dd193776d474fb9a2a899f68d10 (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module Secure
        class ConfigurationForm < QA::Page::Base
          include QA::Page::Component::Select2
          include QA::Page::Settings::Common

          view 'app/assets/javascripts/security_configuration/components/feature_card.vue' do
            element :dependency_scanning_status, "`${feature.type}_status`" # rubocop:disable QA/ElementWithPattern
            element :sast_status, "`${feature.type}_status`" # rubocop:disable QA/ElementWithPattern
            element :sast_enable_button, "`${feature.type}_enable_button`" # rubocop:disable QA/ElementWithPattern
            element :dependency_scanning_mr_button, "`${feature.type}_mr_button`" # rubocop:disable QA/ElementWithPattern
          end

          def click_sast_enable_button
            click_element(:sast_enable_button)
          end

          def click_dependency_scanning_mr_button
            click_element(:dependency_scanning_mr_button)
          end

          def has_sast_status?(status_text)
            within_element(:sast_status) do
              has_text?(status_text)
            end
          end

          def has_dependency_scanning_status?(status_text)
            within_element(:dependency_scanning_status) do
              has_text?(status_text)
            end
          end
        end
      end
    end
  end
end

QA::Page::Project::Secure::ConfigurationForm.prepend_mod_with('Page::Project::Secure::ConfigurationForm', namespace: QA)