summaryrefslogtreecommitdiff
path: root/qa/qa/page/component/confirm_modal.rb
blob: a90be76c879fbd8ce96ee1fae772a77f23c8d4bd (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
# frozen_string_literal: true

module QA
  module Page
    module Component
      module ConfirmModal
        extend QA::Page::PageConcern

        def self.included(base)
          super
        end

        def fill_confirmation_text(text)
          fill_element :confirm_input, text
        end

        def wait_for_confirm_button_enabled
          wait_until(reload: false) do
            !find_element(:confirm_button).disabled?
          end
        end

        def confirm_transfer
          wait_for_confirm_button_enabled
          click_element :confirm_button
        end
      end
    end
  end
end