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

new.rb « pipeline « project « page « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 33aa93d620435199a7e612834f92dac06aca5638 (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
# frozen_string_literal: true

module QA
  module Page
    module Project
      module Pipeline
        class New < QA::Page::Base
          view 'app/assets/javascripts/ci/pipeline_new/components/pipeline_new_form.vue' do
            element 'run-pipeline-button', required: true
            element 'ci-variable-row-container'
            element 'pipeline-form-ci-variable-key-field'
            element 'pipeline-form-ci-variable-value-field'
            element 'pipeline-form-ci-variable-value-dropdown'
            element 'ci-variable-value-dropdown-item'
          end

          def click_run_pipeline_button
            click_element('run-pipeline-button', Page::Project::Pipeline::Show)
          end

          def click_variable_dropdown
            return unless has_variable_dropdown?

            click_element('pipeline-form-ci-variable-value-dropdown')
          end

          def configure_variable(key: nil, value: 'foo', row_index: 0)
            within_element_by_index('ci-variable-row-container', row_index) do
              fill_element('pipeline-form-ci-variable-key-field', key) unless key.nil?
              fill_element('pipeline-form-ci-variable-value-field', value)
            end
          end

          def has_variable_dropdown?
            has_element?('pipeline-form-ci-variable-value-dropdown')
          end

          def variable_dropdown
            return unless has_variable_dropdown?

            find_element('pipeline-form-ci-variable-value-dropdown')
          end

          def variable_dropdown_item_with_index(index)
            return unless has_variable_dropdown?

            within_element_by_index('ci-variable-value-dropdown-item', index) do
              find('p')
            end
          end
        end
      end
    end
  end
end