summaryrefslogtreecommitdiff
path: root/qa/qa/page/admin/settings/component/performance_bar.rb
blob: 9e92fa362fb095cc29ae10968ab6441dbc0752b5 (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 QA
  module Page
    module Admin
      module Settings
        module Component
          class PerformanceBar < Page::Base
            view 'app/views/admin/application_settings/_performance_bar.html.haml' do
              element :enable_performance_bar_checkbox
              element :save_changes_button
            end

            def enable_performance_bar
              check_element(:enable_performance_bar_checkbox)
              Capybara.current_session.driver.browser.manage.add_cookie(name: 'perf_bar_enabled', value: 'true')
            end

            def save_settings
              click_element :save_changes_button
            end
          end
        end
      end
    end
  end
end