Commit 2ae6c47d authored by Nick Thomas's avatar Nick Thomas

Merge branch 'qa-batch-comments-e2e-tests' into 'master'

QA Selectors for Batch Comment E2E Automation

See merge request gitlab-org/gitlab-ce!22681
parents 7d4b717c 1b4e3e74
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
<button <button
v-if="shouldShowCommentButton" v-if="shouldShowCommentButton"
type="button" type="button"
class="add-diff-note js-add-diff-note-button" class="add-diff-note js-add-diff-note-button qa-diff-comment"
title="Add a comment to this line" title="Add a comment to this line"
@click="handleCommentButton" @click="handleCommentButton"
> >
......
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
:line-type="newLineType" :line-type="newLineType"
:is-bottom="isBottom" :is-bottom="isBottom"
:is-hover="isHover" :is-hover="isHover"
class="diff-line-num new_line" class="diff-line-num new_line qa-new-diff-line"
/> />
<td <td
:class="line.type" :class="line.type"
......
...@@ -390,7 +390,7 @@ append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown" ...@@ -390,7 +390,7 @@ append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown"
:disabled="isSubmitButtonDisabled" :disabled="isSubmitButtonDisabled"
name="button" name="button"
type="button" type="button"
class="btn comment-btn note-type-toggle js-note-new-discussion dropdown-toggle" class="btn comment-btn note-type-toggle js-note-new-discussion dropdown-toggle qa-note-dropdown"
data-display="static" data-display="static"
data-toggle="dropdown" data-toggle="dropdown"
aria-label="Open comment type dropdown"> aria-label="Open comment type dropdown">
...@@ -422,7 +422,7 @@ append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown" ...@@ -422,7 +422,7 @@ append-right-10 comment-type-dropdown js-comment-type-dropdown droplab-dropdown"
<li :class="{ 'droplab-item-selected': noteType === 'discussion' }"> <li :class="{ 'droplab-item-selected': noteType === 'discussion' }">
<button <button
type="button" type="button"
class="btn btn-transparent" class="btn btn-transparent qa-discussion-option"
@click.prevent="setNoteType('discussion')"> @click.prevent="setNoteType('discussion')">
<i <i
aria-hidden="true" aria-hidden="true"
......
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
:data-supports-quick-actions="!isEditing" :data-supports-quick-actions="!isEditing"
name="note[note]" name="note[note]"
class="note-textarea js-gfm-input js-note-text class="note-textarea js-gfm-input js-note-text
js-autosize markdown-area js-vue-issue-note-form js-vue-textarea" js-autosize markdown-area js-vue-issue-note-form js-vue-textarea qa-reply-input"
aria-label="Description" aria-label="Description"
placeholder="Write a comment or drag your files here…" placeholder="Write a comment or drag your files here…"
@keydown.meta.enter="handleUpdate()" @keydown.meta.enter="handleUpdate()"
......
...@@ -369,7 +369,7 @@ Please check your network connection and try again.`; ...@@ -369,7 +369,7 @@ Please check your network connection and try again.`;
role="group"> role="group">
<button <button
type="button" type="button"
class="js-vue-discussion-reply btn btn-text-field mr-2" class="js-vue-discussion-reply btn btn-text-field mr-2 qa-discussion-reply"
title="Add a reply" title="Add a reply"
@click="showReplyForm">Reply...</button> @click="showReplyForm">Reply...</button>
</div> </div>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
.fade-left= icon('angle-left') .fade-left= icon('angle-left')
.fade-right= icon('angle-right') .fade-right= icon('angle-right')
%ul.merge-request-tabs.nav-tabs.nav.nav-links.scrolling-tabs %ul.merge-request-tabs.nav-tabs.nav.nav-links.scrolling-tabs
%li.notes-tab %li.notes-tab.qa-notes-tab
= tab_link_for @merge_request, :show, force_link: @commit.present? do = tab_link_for @merge_request, :show, force_link: @commit.present? do
Discussion Discussion
%span.badge.badge-pill= @merge_request.related_notes.user.count %span.badge.badge-pill= @merge_request.related_notes.user.count
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
= tab_link_for @merge_request, :pipelines do = tab_link_for @merge_request, :pipelines do
Pipelines Pipelines
%span.badge.badge-pill.js-pipelines-mr-count= @pipelines.size %span.badge.badge-pill.js-pipelines-mr-count= @pipelines.size
%li.diffs-tab %li.diffs-tab.qa-diffs-tab
= tab_link_for @merge_request, :diffs do = tab_link_for @merge_request, :diffs do
Changes Changes
%span.badge.badge-pill= @merge_request.diff_size %span.badge.badge-pill= @merge_request.diff_size
......
# frozen_string_literal: true
module QA module QA
module Page module Page
module MergeRequest module MergeRequest
...@@ -23,6 +25,32 @@ module QA ...@@ -23,6 +25,32 @@ module QA
element :squash_checkbox element :squash_checkbox
end end
view 'app/views/projects/merge_requests/show.html.haml' do
element :notes_tab
element :diffs_tab
end
view 'app/assets/javascripts/diffs/components/diff_line_gutter_content.vue' do
element :diff_comment
end
view 'app/assets/javascripts/notes/components/comment_form.vue' do
element :note_dropdown
element :discussion_option
end
view 'app/assets/javascripts/notes/components/note_form.vue' do
element :reply_input
end
view 'app/assets/javascripts/notes/components/noteable_discussion.vue' do
element :discussion_reply
end
view 'app/assets/javascripts/diffs/components/inline_diff_table_row.vue' do
element :new_diff_line
end
view 'app/views/shared/issuable/_sidebar.html.haml' do view 'app/views/shared/issuable/_sidebar.html.haml' do
element :labels_block element :labels_block
end end
...@@ -106,6 +134,35 @@ module QA ...@@ -106,6 +134,35 @@ module QA
click_element :squash_checkbox click_element :squash_checkbox
end end
def go_to_discussions_tab
click_element :notes_tab
end
def go_to_diffs_tab
click_element :diffs_tab
end
def add_comment_to_diff(text)
wait(time: 5) do
page.has_text?("No newline at end of file")
end
all_elements(:new_diff_line).first.hover
click_element :diff_comment
fill_element :reply_input, text
end
def start_discussion(text)
fill_element :comment_input, text
click_element :note_dropdown
click_element :discussion_option
click_element :comment_button
end
def reply_to_discussion(reply_text)
all_elements(:discussion_reply).last.click
fill_element :reply_input, reply_text
end
end end
end 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