summaryrefslogtreecommitdiff
path: root/qa/qa/vendor/github/page/login.rb
blob: f6e72bb01f98d6c7f7621d04a3ecb8116a4f380d (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

require 'capybara/dsl'

module QA
  module Vendor
    module Github
      module Page
        class Login < Page::Base
          def login
            fill_in 'login', with: QA::Runtime::Env.github_username
            fill_in 'password', with: QA::Runtime::Env.github_password
            click_on 'Sign in'

            otp = OnePassword::CLI.new.otp

            fill_in 'otp', with: otp

            click_on 'Verify'

            click_on 'Authorize gitlab-qa' if has_button?('Authorize gitlab-qa')
          end
        end
      end
    end
  end
end