diff options
author | Mark Lapierre <mlapierre@gmail.com> | 2018-06-11 18:58:06 -0400 |
---|---|---|
committer | Mark Lapierre <mlapierre@gitlab.com> | 2018-09-12 12:44:27 -0400 |
commit | dabc8211a9c65881b023d8bb69131c0d68aa50c6 (patch) | |
tree | 29815f017584f5d13db15bb210d26a55d4c20154 /qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb | |
parent | b9ea4e35ac679a87ea16ca01a5f02bd96b3b16c3 (diff) | |
download | gitlab-ce-dabc8211a9c65881b023d8bb69131c0d68aa50c6.tar.gz |
Add an SSH key and use it to clone and push
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb')
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb new file mode 100644 index 00000000000..7c989bfd8cc --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module QA + context :create do + describe 'SSH key support' do + # Note: If you run this test against GDK make sure you've enabled sshd + # See: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/docs/run_qa_against_gdk.md + + let(:key_title) { "key for ssh tests #{Time.now.to_f}" } + + it 'user adds an ssh key and pushes code to the repository' 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 + + Factory::Repository::ProjectPush.fabricate! do |push| + push.ssh_key = key + push.file_name = 'README.md' + push.file_content = '# Test Use SSH Key' + push.commit_message = 'Add README.md' + end + + Page::Project::Show.act { wait_for_push } + + expect(page).to have_content('README.md') + expect(page).to have_content('Test Use SSH Key') + + 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 + end + end + end +end |