Commit ea7a8d7b authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'tomi/fix/batch_waiting' into 'master'

Adding another check for applied badges to make them more stable

See merge request gitlab-org/gitlab!73241
parents 53fbb092 9c071619
......@@ -134,8 +134,14 @@ export default {
<gl-icon name="question-o" css-classes="link-highlight" />
</a>
</div>
<div v-if="isApplied" class="badge badge-success">{{ __('Applied') }}</div>
<div v-else-if="isApplying" class="d-flex align-items-center text-secondary">
<div v-if="isApplied" class="badge badge-success" data-qa-selector="applied_badge">
{{ __('Applied') }}
</div>
<div
v-else-if="isApplying"
class="d-flex align-items-center text-secondary"
data-qa-selector="applying_badge"
>
<gl-loading-icon size="sm" class="d-flex-center mr-2" />
<span>{{ applyingSuggestionsMessage }}</span>
</div>
......
......@@ -99,6 +99,8 @@ module QA
view 'app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue' do
element :add_suggestion_batch_button
element :applied_badge
element :applying_badge
end
view 'app/views/projects/merge_requests/_description.html.haml' do
......@@ -363,6 +365,13 @@ module QA
all_elements(:add_suggestion_batch_button, minimum: 1).first.click
end
def has_suggestions_applied?(count)
wait_until(reload: false) do
has_no_element?(:applying_badge)
end
all_elements(:applied_badge, count: count)
end
def cherry_pick!
click_element(:cherry_pick_button, Page::Component::CommitModal)
click_element(:submit_commit_button)
......
......@@ -52,7 +52,7 @@ module QA
4.times { merge_request.add_suggestion_to_batch }
merge_request.apply_suggestion_with_message("Custom commit message")
expect(merge_request).to have_css('.badge-success', text: "Applied", count: 4)
expect(merge_request).to have_suggestions_applied(4)
end
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