summaryrefslogtreecommitdiff
path: root/qa/qa/resource/ssh_key.rb
blob: 4e399ae730ef2b26fc2c944f94d4328fb3bf48f9 (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
# frozen_string_literal: true

module QA
  module Resource
    class SSHKey < Base
      extend Forwardable

      attr_accessor :title

      def_delegators :key, :private_key, :public_key, :fingerprint

      def key
        @key ||= Runtime::Key::RSA.new
      end

      def fabricate!
        Page::Main::Menu.perform(&:click_settings_link)
        Page::Profile::Menu.perform(&:click_ssh_keys)

        Page::Profile::SSHKeys.perform do |page|
          page.add_key(public_key, title)
        end
      end
    end
  end
end