summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-07-05 09:04:57 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-07-05 09:04:57 +0000
commit3bdaeb94c0f3363e6c51152949aa45d3876b2772 (patch)
tree66aca7c77e8ef3f10f9ae5e3b11b607d98590a73
parent89e19862c6c95fa3b82971a5d0422adffee7ca66 (diff)
parentc97d8b8e8d9e6a3d085e82cc4a06be07c0327ee4 (diff)
downloadgitlab-ce-3bdaeb94c0f3363e6c51152949aa45d3876b2772.tar.gz
Merge branch '48779-qa-merge-request-squash-sometimes-fail' into 'master'
Resolve "QA: Merge request squash sometimes fail" Closes #48779 See merge request gitlab-org/gitlab-ce!20375
-rw-r--r--qa/qa/page/merge_request/show.rb44
-rw-r--r--qa/qa/specs/features/merge_request/squash_spec.rb2
2 files changed, 37 insertions, 9 deletions
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index 9507f92f4b2..c200f14f4fb 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -20,14 +20,6 @@ module QA
element :squash_checkbox
end
- def rebase!
- click_element :mr_rebase_button
-
- wait(reload: false) do
- has_text?('Fast-forward merge without a merge commit')
- end
- end
-
def fast_forward_possible?
!has_text?('Fast-forward merge is not possible')
end
@@ -38,7 +30,35 @@ module QA
has_selector?('.accept-merge-request')
end
+ def rebase!
+ # The rebase button is disabled on load
+ wait do
+ has_css?(element_selector_css(:mr_rebase_button))
+ end
+
+ # The rebase button is enabled via JS
+ wait(reload: false) do
+ !first(element_selector_css(:mr_rebase_button)).disabled?
+ end
+
+ click_element :mr_rebase_button
+
+ wait(reload: false) do
+ has_text?('Fast-forward merge without a merge commit')
+ end
+ end
+
def merge!
+ # The merge button is disabled on load
+ wait do
+ has_css?(element_selector_css(:merge_button))
+ end
+
+ # The merge button is enabled via JS
+ wait(reload: false) do
+ !first(element_selector_css(:merge_button)).disabled?
+ end
+
click_element :merge_button
wait(reload: false) do
@@ -47,10 +67,16 @@ module QA
end
def mark_to_squash
- wait(reload: true) do
+ # The squash checkbox is disabled on load
+ wait do
has_css?(element_selector_css(:squash_checkbox))
end
+ # The squash checkbox is enabled via JS
+ wait(reload: false) do
+ !first(element_selector_css(:squash_checkbox)).disabled?
+ end
+
click_element :squash_checkbox
end
end
diff --git a/qa/qa/specs/features/merge_request/squash_spec.rb b/qa/qa/specs/features/merge_request/squash_spec.rb
index f0ad4bfd701..4856bbe1a69 100644
--- a/qa/qa/specs/features/merge_request/squash_spec.rb
+++ b/qa/qa/specs/features/merge_request/squash_spec.rb
@@ -24,6 +24,8 @@ module QA
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!