Commit 7c95fbf8 authored by Nailia Iskhakova's avatar Nailia Iskhakova Committed by Ramya Authappan

Fix flaky file locking spec

Added wait for merge request error message
parent 7827f51f
...@@ -84,7 +84,12 @@ export default { ...@@ -84,7 +84,12 @@ export default {
<span v-else> {{ s__('mrWidget|Merge failed.') }} </span> <span v-else> {{ s__('mrWidget|Merge failed.') }} </span>
<span :class="{ 'has-custom-error': mr.mergeError }"> {{ timerText }} </span> <span :class="{ 'has-custom-error': mr.mergeError }"> {{ timerText }} </span>
</span> </span>
<button class="btn btn-default btn-sm js-refresh-button" type="button" @click="refresh"> <button
class="btn btn-default btn-sm js-refresh-button"
data-qa-selector="merge_request_error_content"
type="button"
@click="refresh"
>
{{ s__('mrWidget|Refresh now') }} {{ s__('mrWidget|Refresh now') }}
</button> </button>
</div> </div>
......
...@@ -29,6 +29,10 @@ module QA ...@@ -29,6 +29,10 @@ module QA
element :merged_status_content element :merged_status_content
end end
view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_failed_to_merge.vue' do
element :merge_request_error_content
end
view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue' do view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue' do
element :mr_rebase_button element :mr_rebase_button
element :no_fast_forward_message, 'Fast-forward merge is not possible' # rubocop:disable QA/ElementWithPattern element :no_fast_forward_message, 'Fast-forward merge is not possible' # rubocop:disable QA/ElementWithPattern
...@@ -193,6 +197,12 @@ module QA ...@@ -193,6 +197,12 @@ module QA
click_element :dropdown_toggle click_element :dropdown_toggle
visit_link_in_element(:download_plain_diff) visit_link_in_element(:download_plain_diff)
end end
def wait_for_merge_request_error_message
wait(max: 30, reload: false) do
has_element?(:merge_request_error_content)
end
end
end end
end end
end end
......
...@@ -59,9 +59,8 @@ module QA ...@@ -59,9 +59,8 @@ module QA
end end
end end
# https://gitlab.com/gitlab-org/gitlab/issues/40125 # Known issue: https://gitlab.com/gitlab-org/gitlab/issues/40125
# BUG_IN_CODE it 'creates a merge request and fails to merge' do
it 'creates a merge request and fails to merge', :quarantine do
push branch: 'test', as_user: @user_one push branch: 'test', as_user: @user_one
merge_request = Resource::MergeRequest.fabricate_via_api! do |merge_request| merge_request = Resource::MergeRequest.fabricate_via_api! do |merge_request|
...@@ -75,6 +74,7 @@ module QA ...@@ -75,6 +74,7 @@ module QA
click_lock click_lock
sign_out_and_sign_in_as user: @user_one sign_out_and_sign_in_as user: @user_one
try_to_merge merge_request: merge_request try_to_merge merge_request: merge_request
Page::MergeRequest::Show.perform(&:wait_for_merge_request_error_message)
expect(page).to have_text("locked by #{admin_username}") expect(page).to have_text("locked by #{admin_username}")
end end
......
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