Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ssh_keys.rb « profile « page « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 082202f91cae2b8f5bf38aff680c2d4c23709038 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true

module QA
  module Page
    module Profile
      class SSHKeys < Page::Base
        view 'app/views/profiles/keys/_form.html.haml' do
          element :key_title_field
          element :key_public_key_field
          element :add_key_button
        end

        view 'app/views/profiles/keys/_key_details.html.haml' do
          element :delete_key_button
        end

        view 'app/views/profiles/keys/_key_table.html.haml' do
          element :ssh_keys_list
        end

        def add_key(public_key, title)
          fill_element :key_public_key_field, public_key
          fill_element :key_title_field, title

          click_element :add_key_button
        end

        def remove_key(title)
          click_link(title)

          accept_alert do
            click_element :delete_key_button
          end
        end

        def keys_list
          find_element(:ssh_keys_list).text
        end
      end
    end
  end
end