Commit 3bdaeb94 authored by Sean McGivern's avatar Sean McGivern

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
parents 89e19862 c97d8b8e
......@@ -20,7 +20,27 @@ module QA
element :squash_checkbox
end
def fast_forward_possible?
!has_text?('Fast-forward merge is not possible')
end
def has_merge_button?
refresh
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
......@@ -28,17 +48,17 @@ module QA
end
end
def fast_forward_possible?
!has_text?('Fast-forward merge is not possible')
def merge!
# The merge button is disabled on load
wait do
has_css?(element_selector_css(:merge_button))
end
def has_merge_button?
refresh
has_selector?('.accept-merge-request')
# The merge button is enabled via JS
wait(reload: false) do
!first(element_selector_css(:merge_button)).disabled?
end
def merge!
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
......
......@@ -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!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment