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

ssh_key_support_spec.rb « repository « 3_create « browser_ui « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2e8c43d6981674515f04d9c688f74a9bd1848f93 (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
# frozen_string_literal: true

module QA
  RSpec.describe 'SSH keys support', :smoke do
    key_title = "key for ssh tests #{Time.now.to_f}"
    key = nil

    before do
      Flow::Login.sign_in
    end

    it 'user can add an SSH key', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347819' do
      key = Resource::SSHKey.fabricate_via_browser_ui! do |resource|
        resource.title = key_title
      end

      expect(page).to have_content(key.title)
      expect(page).to have_content(key.md5_fingerprint)
    end

    # Note this context ensures that the example it contains is executed after the example above. Be aware of the order of execution if you add new examples in either context.
    context 'after adding an ssh key' do
      it 'can delete an ssh key', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347820' do
        Page::Main::Menu.perform(&:click_edit_profile_link)
        Page::Profile::Menu.perform(&: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.md5_fingerprint)
      end
    end
  end
end