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,14 +20,6 @@ module QA ...@@ -20,14 +20,6 @@ module QA
element :squash_checkbox element :squash_checkbox
end 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? def fast_forward_possible?
!has_text?('Fast-forward merge is not possible') !has_text?('Fast-forward merge is not possible')
end end
...@@ -38,7 +30,35 @@ module QA ...@@ -38,7 +30,35 @@ module QA
has_selector?('.accept-merge-request') has_selector?('.accept-merge-request')
end 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! 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 click_element :merge_button
wait(reload: false) do wait(reload: false) do
...@@ -47,10 +67,16 @@ module QA ...@@ -47,10 +67,16 @@ module QA
end end
def mark_to_squash def mark_to_squash
wait(reload: true) do # The squash checkbox is disabled on load
wait do
has_css?(element_selector_css(:squash_checkbox)) has_css?(element_selector_css(:squash_checkbox))
end end
# The squash checkbox is enabled via JS
wait(reload: false) do
!first(element_selector_css(:squash_checkbox)).disabled?
end
click_element :squash_checkbox click_element :squash_checkbox
end end
end end
......
...@@ -24,6 +24,8 @@ module QA ...@@ -24,6 +24,8 @@ module QA
merge_request.visit! merge_request.visit!
expect(page).to have_text('to be squashed')
Page::MergeRequest::Show.perform do |merge_request_page| Page::MergeRequest::Show.perform do |merge_request_page|
merge_request_page.mark_to_squash merge_request_page.mark_to_squash
merge_request_page.merge! 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