Commit 7738df4e authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'egb-refactor-ssh-key-spec' into 'master'

Refactor `browser_ui/3_create/repository/add_ssh_key_spec.rb` into two `it` clauses

See merge request gitlab-org/gitlab!34428
parents 8815b77e 7a31110b
# frozen_string_literal: true # frozen_string_literal: true
module QA module QA
RSpec.describe 'Create' do RSpec.describe 'SSH keys support', :smoke do
describe 'SSH keys support' do key_title = "key for ssh tests #{Time.now.to_f}"
let(:key_title) { "key for ssh tests #{Time.now.to_f}" } key = nil
it 'user adds and then removes an SSH key', :smoke do before do
Flow::Login.sign_in Flow::Login.sign_in
end
key = Resource::SSHKey.fabricate_via_browser_ui! do |resource| it 'user can add an SSH key' do
resource.title = key_title key = Resource::SSHKey.fabricate_via_browser_ui! do |resource|
end resource.title = key_title
end
expect(page).to have_content(key.title) expect(page).to have_content(key.title)
expect(page).to have_content(key.md5_fingerprint) 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' do
Page::Main::Menu.perform(&:click_settings_link) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys| Page::Profile::SSHKeys.perform do |ssh_keys|
ssh_keys.remove_key(key_title) ssh_keys.remove_key(key_title)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment