Commit c97d8b8e authored by Rémy Coutable's avatar Rémy Coutable

[QA] Ensure we wait for the squash checbox to be clickable before clicking it...

[QA] Ensure we wait for the squash checbox to be clickable before clicking it in the squash scenario
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent baab4cdd
......@@ -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