summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorRamya Authappan <rauthappan@gitlab.com>2019-01-03 14:57:51 +0000
committerSanad Liaquat <sliaquat@gitlab.com>2019-01-03 14:57:51 +0000
commitd3c73487c59e3d9b3c80c9df5573e8328085dbc7 (patch)
tree7262b8601211345b70a5de17640c21ae00649f19 /qa
parent54a14270a6363ff2344453e8d376f0a294de798a (diff)
downloadgitlab-ce-d3c73487c59e3d9b3c80c9df5573e8328085dbc7.tar.gz
Collapsible Comments Test for Issues
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb1
-rw-r--r--qa/qa/page/component/note.rb51
-rw-r--r--qa/qa/page/merge_request/show.rb27
-rw-r--r--qa/qa/page/project/issue/show.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb37
5 files changed, 92 insertions, 25 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index bf05b6b53ca..ef6a92f9768 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -283,6 +283,7 @@ module QA
autoload :Select2, 'qa/page/component/select2'
autoload :DropdownFilter, 'qa/page/component/dropdown_filter'
autoload :UsersSelect, 'qa/page/component/users_select'
+ autoload :Note, 'qa/page/component/note'
module Issuable
autoload :Common, 'qa/page/component/issuable/common'
diff --git a/qa/qa/page/component/note.rb b/qa/qa/page/component/note.rb
new file mode 100644
index 00000000000..67d7f114786
--- /dev/null
+++ b/qa/qa/page/component/note.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module Note
+ def self.included(base)
+ base.view 'app/assets/javascripts/notes/components/comment_form.vue' do
+ element :note_dropdown
+ element :discussion_option
+ end
+
+ base.view 'app/assets/javascripts/notes/components/note_form.vue' do
+ element :reply_input
+ element :reply_comment_button
+ end
+
+ base.view 'app/assets/javascripts/notes/components/noteable_discussion.vue' do
+ element :discussion_reply
+ end
+
+ base.view 'app/assets/javascripts/notes/components/toggle_replies_widget.vue' do
+ element :expand_replies
+ element :collapse_replies
+ end
+ 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
+ click_element :reply_comment_button
+ end
+
+ def collapse_replies
+ click_element :collapse_replies
+ end
+
+ def expand_replies
+ click_element :expand_replies
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index 869dc0b9d21..4f21ed602d9 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -4,6 +4,8 @@ module QA
module Page
module MergeRequest
class Show < Page::Base
+ include Page::Component::Note
+
view 'app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue' do
element :merge_button
element :fast_forward_message, 'Fast-forward merge without a merge commit' # rubocop:disable QA/ElementWithPattern
@@ -34,19 +36,6 @@ module QA
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
@@ -163,18 +152,6 @@ module QA
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
-
def edit!
click_element :edit_button
end
diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb
index 9ec6d90719e..1028cc045a0 100644
--- a/qa/qa/page/project/issue/show.rb
+++ b/qa/qa/page/project/issue/show.rb
@@ -6,6 +6,7 @@ module QA
module Issue
class Show < Page::Base
include Page::Component::Issuable::Common
+ include Page::Component::Note
view 'app/views/shared/notes/_form.html.haml' do
element :new_note_form, 'new-note' # rubocop:disable QA/ElementWithPattern
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
new file mode 100644
index 00000000000..fa779bd1f4e
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+module QA
+ context 'Plan' do
+ describe 'collapse comments in issue discussions' do
+ let(:issue_title) { 'issue title' }
+
+ it 'user collapses reply for comments in an issue' do
+ Runtime::Browser.visit(:gitlab, Page::Main::Login)
+ Page::Main::Login.perform(&:sign_in_using_credentials)
+
+ Resource::Issue.fabricate! do |issue|
+ issue.title = issue_title
+ end
+
+ expect(page).to have_content(issue_title)
+
+ Page::Project::Issue::Show.perform do |show_page|
+ show_page.select_all_activities_filter
+ show_page.start_discussion("My first discussion")
+ expect(show_page).to have_content("My first discussion")
+
+ show_page.reply_to_discussion("My First Reply")
+ expect(show_page).to have_content("My First Reply")
+
+ show_page.collapse_replies
+ expect(show_page).to have_content("1 reply")
+ expect(show_page).not_to have_content("My First Reply")
+
+ show_page.expand_replies
+ expect(show_page).to have_content("My First Reply")
+ expect(show_page).not_to have_content("1 reply")
+ end
+ end
+ end
+ end
+end