diff options
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create/repository')
6 files changed, 72 insertions, 41 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb index f586c25165c..59e4bb038a7 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/move_project_create_fork_spec.rb @@ -10,6 +10,7 @@ module QA project.initialize_with_readme = true end end + let(:fork_project) do Resource::Fork.fabricate_via_api! do |fork| fork.user = user diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb index c01558d3702..ceacc73e3c3 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_http_private_token_spec.rb @@ -2,7 +2,7 @@ module QA RSpec.describe 'Create' do - describe 'Git push over HTTP', :ldap_no_tls do + describe 'Git push over HTTP', :ldap_no_tls, :smoke do it 'user using a personal access token pushes code to the repository' do Flow::Login.sign_in diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb index b918b2ff268..2baf1e1d8fd 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Create' do describe 'Git push over HTTP', :ldap_no_tls do - it 'user pushes code to the repository' do + it 'user pushes code to the repository', :smoke do Flow::Login.sign_in Resource::Repository::ProjectPush.fabricate! do |push| diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb new file mode 100644 index 00000000000..d0f0cabbbca --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/repository/push_over_ssh_spec.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module QA + RSpec.describe 'Create' do + describe 'SSH key support' do + # Note: If you run these tests 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(:project) do + Resource::Project.fabricate! do |project| + project.name = 'ssh-tests' + end + end + + before(:context) do + @key = Resource::SSHKey.fabricate_via_api! do |resource| + resource.title = "key for ssh tests #{Time.now.to_f}" + end + end + + after(:context) do + @key.remove_via_api! + end + + before do + Flow::Login.sign_in + end + + it 'pushes code to the repository via SSH', :smoke do + Resource::Repository::ProjectPush.fabricate! do |push| + push.project = project + push.ssh_key = @key + push.file_name = 'README.md' + push.file_content = '# Test Use SSH Key' + push.commit_message = 'Add README.md' + end.project.visit! + + Page::Project::Show.perform do |project| + expect(project).to have_file('README.md') + expect(project).to have_readme_content('Test Use SSH Key') + end + end + + it 'pushes multiple branches and tags together', :smoke do + branches = [] + tags = [] + Git::Repository.perform do |repository| + repository.uri = project.repository_ssh_location.uri + repository.use_ssh_key(@key) + repository.clone + repository.configure_identity('GitLab QA', 'root@gitlab.com') + 1.upto(3) do |i| + branches << "branch#{i}" + tags << "tag#{i}" + repository.checkout("branch#{i}", new_branch: true) + repository.commit_file("file#{i}", SecureRandom.random_bytes(10000), "Add file#{i}") + repository.add_tag("tag#{i}") + end + repository.push_tags_and_branches(branches) + end + + expect(project).to have_branches(branches) + expect(project).to have_tags(tags) + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb index d67e4a4ea83..c5a07c69620 100644 --- a/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/repository/ssh_key_support_spec.rb @@ -24,10 +24,10 @@ module QA Page::Main::Menu.perform(&:click_settings_link) Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::SSHKeys.perform do |ssh_keys| - ssh_keys.remove_key(key_title) + ssh_keys.remove_key(key.title) end - expect(page).not_to have_content("Title: #{key_title}") + expect(page).not_to have_content("Title: #{key.title}") expect(page).not_to have_content(key.md5_fingerprint) end end 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 deleted file mode 100644 index e91717b0f5f..00000000000 --- a/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -module QA - RSpec.describe '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 - Flow::Login.sign_in - - key = Resource::SSHKey.fabricate_via_api! do |resource| - resource.title = key_title - end - - Resource::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.project.visit! - - expect(page).to have_content('README.md') - expect(page).to have_content('Test Use SSH Key') - - Page::Main::Menu.perform(&:click_settings_link) - Page::Profile::Menu.perform(&:click_ssh_keys) - - Page::Profile::SSHKeys.perform do |ssh_keys| - ssh_keys.remove_key(key_title) - end - end - end - end -end |