summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/3_create
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create')
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb57
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb25
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb45
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb54
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb31
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb60
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/create_edit_delete_file_via_web_spec.rb58
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb23
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb70
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb40
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb49
11 files changed, 0 insertions, 512 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb
deleted file mode 100644
index bcf55a02a61..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Merge request creation' do
- it 'user creates a new merge request' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- current_project = Factory::Resource::Project.fabricate! do |project|
- project.name = 'project-with-merge-request-and-milestone'
- end
-
- current_milestone = Factory::Resource::ProjectMilestone.fabricate! do |milestone|
- milestone.title = 'unique-milestone'
- milestone.project = current_project
- end
-
- Factory::Resource::MergeRequest.fabricate! do |merge_request|
- merge_request.title = 'This is a merge request with a milestone'
- merge_request.description = 'Great feature with milestone'
- merge_request.project = current_project
- merge_request.milestone = current_milestone
- end
-
- expect(page).to have_content('This is a merge request with a milestone')
- expect(page).to have_content('Great feature with milestone')
- expect(page).to have_content(/Opened [\w\s]+ ago/)
-
- Page::Issuable::Sidebar.perform do |sidebar|
- expect(sidebar).to have_milestone(current_milestone.title)
- end
- end
- end
- end
-
- describe 'creates a merge request', :smoke do
- it 'user creates a new merge request' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- current_project = Factory::Resource::Project.fabricate! do |project|
- project.name = 'project-with-merge-request'
- end
-
- Factory::Resource::MergeRequest.fabricate! do |merge_request|
- merge_request.title = 'This is a merge request'
- merge_request.description = 'Great feature'
- merge_request.project = current_project
- end
-
- expect(page).to have_content('This is a merge request')
- expect(page).to have_content('Great feature')
- expect(page).to have_content(/Opened [\w\s]+ ago/)
- end
- end
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb
deleted file mode 100644
index 407a15800ab..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Merge request creation from fork' do
- it 'user forks a project, submits a merge request and maintainer merges it' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- merge_request = Factory::Resource::MergeRequestFromFork.fabricate! do |merge_request|
- merge_request.fork_branch = 'feature-branch'
- end
-
- Page::Menu::Main.perform { |main| main.sign_out }
- Page::Main::Login.perform { |login| login.sign_in_using_credentials }
-
- merge_request.visit!
-
- Page::MergeRequest::Show.perform { |show| show.merge! }
-
- expect(page).to have_content('The changes were merged')
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb
deleted file mode 100644
index ddcbc94b1b1..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/merge_request/rebase_merge_request_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Merge request rebasing' do
- it 'user rebases source branch of merge request' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- project = Factory::Resource::Project.fabricate! do |project|
- project.name = "only-fast-forward"
- end
-
- Page::Menu::Side.act { go_to_settings }
- Page::Project::Settings::MergeRequest.act { enable_ff_only }
-
- merge_request = Factory::Resource::MergeRequest.fabricate! do |merge_request|
- merge_request.project = project
- merge_request.title = 'Needs rebasing'
- end
-
- Factory::Repository::ProjectPush.fabricate! do |push|
- push.project = project
- push.file_name = "other.txt"
- push.file_content = "New file added!"
- push.branch_name = "master"
- push.new_branch = false
- end
-
- merge_request.visit!
-
- Page::MergeRequest::Show.perform do |merge_request|
- expect(merge_request).to have_content('Needs rebasing')
- expect(merge_request).not_to be_fast_forward_possible
- expect(merge_request).not_to have_merge_button
-
- merge_request.rebase!
-
- expect(merge_request).to have_merge_button
- expect(merge_request.fast_forward_possible?).to be_truthy
- end
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb
deleted file mode 100644
index b5b8855a35d..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/merge_request/squash_merge_request_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Merge request squashing' do
- it 'user squashes commits while merging' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- project = Factory::Resource::Project.fabricate! do |project|
- project.name = "squash-before-merge"
- end
-
- merge_request = Factory::Resource::MergeRequest.fabricate! do |merge_request|
- merge_request.project = project
- merge_request.title = 'Squashing commits'
- end
-
- Factory::Repository::ProjectPush.fabricate! do |push|
- push.project = project
- push.commit_message = 'to be squashed'
- push.branch_name = merge_request.source_branch
- push.new_branch = false
- push.file_name = 'other.txt'
- push.file_content = "Test with unicode characters ❤✓€❄"
- end
-
- merge_request.visit!
-
- expect(page).to have_text('to be squashed')
-
- Page::MergeRequest::Show.perform do |merge_request_page|
- merge_request_page.mark_to_squash
- merge_request_page.merge!
-
- merge_request.project.visit!
-
- Git::Repository.perform do |repository|
- repository.uri = Page::Project::Show.act do
- choose_repository_clone_http
- repository_location.uri
- end
-
- repository.use_default_credentials
-
- repository.act { clone }
-
- expect(repository.commits.size).to eq 3
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
deleted file mode 100644
index 84f663c4866..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/repository/add_ssh_key_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'SSH keys support' 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
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb
deleted file mode 100644
index 0dcdc6639d1..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/repository/clone_spec.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Git clone over HTTP', :ldap do
- let(:location) do
- Page::Project::Show.act do
- choose_repository_clone_http
- repository_location
- end
- end
-
- before do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- Factory::Resource::Project.fabricate! do |scenario|
- scenario.name = 'project-with-code'
- scenario.description = 'project for git clone tests'
- end
-
- Git::Repository.perform do |repository|
- repository.uri = location.uri
- repository.use_default_credentials
-
- repository.act do
- clone
- configure_identity('GitLab QA', 'root@gitlab.com')
- commit_file('test.rb', 'class Test; end', 'Add Test class')
- commit_file('README.md', '# Test', 'Add Readme')
- push_changes
- end
- end
- end
-
- it 'user performs a deep clone' do
- Git::Repository.perform do |repository|
- repository.uri = location.uri
- repository.use_default_credentials
-
- repository.act { clone }
-
- expect(repository.commits.size).to eq 2
- end
- end
-
- it 'user performs a shallow clone' do
- Git::Repository.perform do |repository|
- repository.uri = location.uri
- repository.use_default_credentials
-
- repository.act { shallow_clone }
-
- expect(repository.commits.size).to eq 1
- expect(repository.commits.first).to include 'Add Readme'
- end
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/create_edit_delete_file_via_web_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/create_edit_delete_file_via_web_spec.rb
deleted file mode 100644
index 82d635065a0..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/repository/create_edit_delete_file_via_web_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Files management' do
- it 'user creates, edits and deletes a file via the Web' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- # Create
- file_name = 'QA Test - File name'
- file_content = 'QA Test - File content'
- commit_message_for_create = 'QA Test - Create new file'
-
- Factory::Resource::File.fabricate! do |file|
- file.name = file_name
- file.content = file_content
- file.commit_message = commit_message_for_create
- end
-
- expect(page).to have_content('The file has been successfully created.')
- expect(page).to have_content(file_name)
- expect(page).to have_content(file_content)
- expect(page).to have_content(commit_message_for_create)
-
- # Edit
- updated_file_content = 'QA Test - Updated file content'
- commit_message_for_update = 'QA Test - Update file'
-
- Page::File::Show.act { click_edit }
-
- Page::File::Form.act do
- remove_content
- add_content(updated_file_content)
- add_commit_message(commit_message_for_update)
- commit_changes
- end
-
- expect(page).to have_content('Your changes have been successfully committed.')
- expect(page).to have_content(updated_file_content)
- expect(page).to have_content(commit_message_for_update)
-
- # Delete
- commit_message_for_delete = 'QA Test - Delete file'
-
- Page::File::Show.act do
- click_delete
- add_commit_message(commit_message_for_delete)
- click_delete_file
- end
-
- expect(page).to have_content('The file has been successfully deleted.')
- expect(page).to have_content(commit_message_for_delete)
- expect(page).to have_no_content(file_name)
- end
- end
- end
-end
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
deleted file mode 100644
index bf32569b6cb..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Git push over HTTP', :ldap do
- it 'user pushes code to the repository' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- Factory::Repository::ProjectPush.fabricate! do |push|
- push.file_name = 'README.md'
- push.file_content = '# This is a test project'
- 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('This is a test project')
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb
deleted file mode 100644
index b2da685c477..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Protected branch support', :ldap do
- let(:branch_name) { 'protected-branch' }
- let(:commit_message) { 'Protected push commit message' }
- let(:project) do
- Factory::Resource::Project.fabricate! do |resource|
- resource.name = 'protected-branch-project'
- end
- end
-
- before do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
- end
-
- after do
- # We need to clear localStorage because we're using it for the dropdown,
- # and capybara doesn't do this for us.
- # https://github.com/teamcapybara/capybara/issues/1702
- Capybara.execute_script 'localStorage.clear()'
- end
-
- context 'when developers and maintainers are allowed to push to a protected branch' do
- it 'user with push rights successfully pushes to the protected branch' do
- create_protected_branch(allow_to_push: true)
-
- push = push_new_file(branch_name)
-
- expect(push.output).to match(/remote: To create a merge request for protected-branch, visit/)
- end
- end
-
- context 'when developers and maintainers are not allowed to push to a protected branch' do
- it 'user without push rights fails to push to the protected branch' do
- create_protected_branch(allow_to_push: false)
-
- push = push_new_file(branch_name)
-
- expect(push.output)
- .to match(/remote\: GitLab\: You are not allowed to push code to protected branches on this project/)
- expect(push.output)
- .to match(/\[remote rejected\] #{branch_name} -> #{branch_name} \(pre-receive hook declined\)/)
- end
- end
-
- def create_protected_branch(allow_to_push:)
- Factory::Resource::Branch.fabricate! do |resource|
- resource.branch_name = branch_name
- resource.project = project
- resource.allow_to_push = allow_to_push
- resource.protected = true
- end
- end
-
- def push_new_file(branch)
- Factory::Repository::ProjectPush.fabricate! do |resource|
- resource.project = project
- resource.file_name = 'new_file.md'
- resource.file_content = '# This is a new file'
- resource.commit_message = 'Add new_file.md'
- resource.branch_name = branch_name
- resource.new_branch = false
- end
- end
- end
- 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 7c989bfd8cc..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/repository/use_ssh_key_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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
diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb
deleted file mode 100644
index 8009b9e8609..00000000000
--- a/qa/qa/specs/features/browser_ui/3_create/wiki/create_edit_clone_push_wiki_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- context :create do
- describe 'Wiki management' do
- def login
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
- end
-
- def validate_content(content)
- expect(page).to have_content('Wiki was successfully updated')
- expect(page).to have_content(/#{content}/)
- end
-
- before do
- login
- end
-
- it 'user creates, edits, clones, and pushes to the wiki' do
- wiki = Factory::Resource::Wiki.fabricate! do |resource|
- resource.title = 'Home'
- resource.content = '# My First Wiki Content'
- resource.message = 'Update home'
- end
-
- validate_content('My First Wiki Content')
-
- Page::Project::Wiki::Edit.act { go_to_edit_page }
- Page::Project::Wiki::New.perform do |page|
- page.set_content("My Second Wiki Content")
- page.save_changes
- end
-
- validate_content('My Second Wiki Content')
-
- Factory::Repository::WikiPush.fabricate! do |push|
- push.wiki = wiki
- push.file_name = 'Home.md'
- push.file_content = '# My Third Wiki Content'
- push.commit_message = 'Update Home.md'
- end
- Page::Menu::Side.act { click_wiki }
-
- expect(page).to have_content('My Third Wiki Content')
- end
- end
- end
-end