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

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

module Spec
  module Support
    module Helpers
      module ModalHelpers
        def within_modal
          page.within('[role="dialog"]') do
            yield
          end
        end

        def accept_gl_confirm(text = nil, button_text: 'OK')
          yield if block_given?

          within_modal do
            unless text.nil?
              expect(page).to have_content(text)
            end

            click_button button_text
          end
        end
      end
    end
  end
end