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

add_ssh_key_spec.rb « project « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63fea3205ddbab123bb2feaf9bbb78b2e96e3ed9 (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
# frozen_string_literal: true

module QA
  describe 'SSH keys support', :core do
    let(:key_title) { "key for ssh tests #{Time.now.to_f}" }

    it 'user adds and then removes an SSH key' do
      Runtime::Browser.visit(:gitlab, Page::Main::Login)
      Page::Main::Login.act { sign_in_using_credentials }

      key = Factory::Resource::SSHKey.fabricate! do |resource|
        resource.title = key_title
      end

      expect(page).to have_content("Title: #{key_title}")
      expect(page).to have_content(key.fingerprint)

      Page::Menu::Main.act { go_to_profile_settings }
      Page::Menu::Profile.act { click_ssh_keys }

      Page::Profile::SSHKeys.perform do |ssh_keys|
        ssh_keys.remove_key(key_title)
      end

      expect(page).not_to have_content("Title: #{key_title}")
      expect(page).not_to have_content(key.fingerprint)
    end
  end
end