ssh_key.rb 601 Bytes
Newer Older
1 2 3 4 5 6 7 8
# frozen_string_literal: true

module QA
  module Factory
    module Resource
      class SSHKey < Factory::Base
        extend Forwardable

9
        attr_accessor :title
10

11
        def_delegators :key, :private_key, :public_key, :fingerprint
12 13 14 15 16 17

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

        def fabricate!
18 19
          Page::Main::Menu.perform(&:go_to_profile_settings)
          Page::Profile::Menu.perform(&:click_ssh_keys)
20 21 22 23 24 25 26 27 28

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