Commit 16761366 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch '118473-click-popovers-in-mr-qa-tests' into 'master'

Dismiss popover in MR

See merge request gitlab-org/gitlab!22235
parents eae1e557 1fd5848b
...@@ -57,7 +57,12 @@ export default { ...@@ -57,7 +57,12 @@ export default {
<icon name="external-link" :size="10" /> <icon name="external-link" :size="10" />
</gl-link> </gl-link>
</p> </p>
<gl-button variant="primary" size="sm" @click="onDismiss"> <gl-button
variant="primary"
size="sm"
data-qa-selector="dismiss_popover_button"
@click="onDismiss"
>
{{ __('Got it') }} {{ __('Got it') }}
</gl-button> </gl-button>
</gl-popover> </gl-popover>
......
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
</script> </script>
<template> <template>
<timeline-entry-item class="note note-wrapper"> <timeline-entry-item class="note note-wrapper" data-qa-selector="skeleton_note">
<div class="timeline-icon"></div> <div class="timeline-icon"></div>
<div class="timeline-content"> <div class="timeline-content">
<div class="note-header"></div> <div class="note-header"></div>
......
...@@ -6,6 +6,10 @@ module QA ...@@ -6,6 +6,10 @@ module QA
class Show < Page::Base class Show < Page::Base
include Page::Component::Note include Page::Component::Note
view 'app/assets/javascripts/mr_tabs_popover/components/popover.vue' do
element :dismiss_popover_button
end
view 'app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue' do view 'app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue' do
element :dropdown_toggle element :dropdown_toggle
element :download_email_patches element :download_email_patches
...@@ -42,6 +46,10 @@ module QA ...@@ -42,6 +46,10 @@ module QA
element :squash_checkbox element :squash_checkbox
end end
view 'app/assets/javascripts/vue_shared/components/notes/skeleton_note.vue' do
element :skeleton_note
end
view 'app/views/projects/merge_requests/show.html.haml' do view 'app/views/projects/merge_requests/show.html.haml' do
element :notes_tab element :notes_tab
element :diffs_tab element :diffs_tab
...@@ -69,28 +77,30 @@ module QA ...@@ -69,28 +77,30 @@ module QA
has_text?("No newline at end of file") has_text?("No newline at end of file")
end end
all_elements(:new_diff_line).first.hover all_elements(:new_diff_line).first.hover
click_element :diff_comment click_element(:diff_comment)
fill_element :reply_input, text fill_element(:reply_input, text)
end end
def click_discussions_tab def click_discussions_tab
click_element :notes_tab click_element(:notes_tab)
finished_loading? wait_for_loading
end end
def click_diffs_tab def click_diffs_tab
click_element :diffs_tab click_element(:diffs_tab)
finished_loading? wait_for_loading
click_element(:dismiss_popover_button) if has_element?(:dismiss_popover_button)
end end
def click_pipeline_link def click_pipeline_link
click_element :pipeline_link click_element(:pipeline_link)
end end
def edit! def edit!
click_element :edit_button click_element(:edit_button)
end end
def fast_forward_possible? def fast_forward_possible?
...@@ -203,6 +213,10 @@ module QA ...@@ -203,6 +213,10 @@ module QA
has_element?(:merge_request_error_content) has_element?(:merge_request_error_content)
end end
end end
def wait_for_loading
finished_loading? && has_no_element?(:skeleton_note)
end
end end
end end
end end
......
...@@ -70,7 +70,6 @@ module QA ...@@ -70,7 +70,6 @@ module QA
Page::MergeRequest::Show.perform do |show| Page::MergeRequest::Show.perform do |show|
show.click_discussions_tab show.click_discussions_tab
show.refresh
show.resolve_discussion_at_index(0) show.resolve_discussion_at_index(0)
expect(show).to have_content("Can you check this line of code?") expect(show).to have_content("Can you check this line of code?")
......
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