summaryrefslogtreecommitdiff
path: root/qa/qa/page/file/shared/commit_button.rb
blob: 9ea4f4e7818a4f110e514ccc9a0123b8b258a5b2 (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
# frozen_string_literal: true

module QA
  module Page
    module File
      module Shared
        module CommitButton
          def self.included(base)
            base.view 'app/views/projects/_commit_button.html.haml' do
              element :commit_button
            end
          end

          def commit_changes
            click_element(:commit_button)

            wait_until(reload: false, max_duration: 60) do
              finished_loading?
            end
          end
        end
      end
    end
  end
end