summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-05-29 20:51:43 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-05-29 20:51:43 +1100
commit4cff66a6c46361e8d775ea3f5a80bf147d4020b3 (patch)
treef1f76411400f35f394fedd28ad03d42ccbaf990e /qa
parent6e354cb642f911dc71be3d5368f066900fc25970 (diff)
downloadgitlab-ce-4cff66a6c46361e8d775ea3f5a80bf147d4020b3.tar.gz
Add 'squash and rebase' feature to CEblackst0ne-squash-and-merge-in-gitlab-core-ce
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/merge_request/show.rb12
-rw-r--r--qa/qa/specs/features/merge_request/squash_spec.rb48
2 files changed, 60 insertions, 0 deletions
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index 166861e6c4a..9507f92f4b2 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -16,6 +16,10 @@ module QA
element :no_fast_forward_message, 'Fast-forward merge is not possible'
end
+ view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_squash_before_merge.vue' do
+ element :squash_checkbox
+ end
+
def rebase!
click_element :mr_rebase_button
@@ -41,6 +45,14 @@ module QA
has_text?('The changes were merged into')
end
end
+
+ def mark_to_squash
+ wait(reload: true) do
+ has_css?(element_selector_css(:squash_checkbox))
+ end
+
+ click_element :squash_checkbox
+ end
end
end
end
diff --git a/qa/qa/specs/features/merge_request/squash_spec.rb b/qa/qa/specs/features/merge_request/squash_spec.rb
new file mode 100644
index 00000000000..dbbdf852a38
--- /dev/null
+++ b/qa/qa/specs/features/merge_request/squash_spec.rb
@@ -0,0 +1,48 @@
+module QA
+ feature 'merge request squash commits', :core do
+ scenario 'when squash commits is marked before merge' 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::Push.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!
+
+ 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