Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a39771cf
Commit
a39771cf
authored
Oct 22, 2020
by
Desiree Chevalier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate e2e notes page object
Consolidates page objects for notes into one shared area
parent
12de7161
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
110 deletions
+106
-110
app/assets/javascripts/notes/components/discussion_filter.vue
...assets/javascripts/notes/components/discussion_filter.vue
+1
-1
qa/qa/ee/page/group/epic/show.rb
qa/qa/ee/page/group/epic/show.rb
+1
-5
qa/qa/page/component/issuable/sidebar.rb
qa/qa/page/component/issuable/sidebar.rb
+1
-1
qa/qa/page/component/note.rb
qa/qa/page/component/note.rb
+84
-3
qa/qa/page/project/issue/show.rb
qa/qa/page/project/issue/show.rb
+0
-85
qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
..._ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/2_plan/issue/comment_issue_spec.rb
...cs/features/browser_ui/2_plan/issue/comment_issue_spec.rb
+2
-2
qa/qa/specs/features/ee/browser_ui/2_plan/epic/epics_management_spec.rb
...atures/ee/browser_ui/2_plan/epic/epics_management_spec.rb
+13
-9
qa/qa/specs/features/ee/browser_ui/3_create/merge_request/add_batch_comments_in_merge_request_spec.rb
...merge_request/add_batch_comments_in_merge_request_spec.rb
+3
-3
No files found.
app/assets/javascripts/notes/components/discussion_filter.vue
View file @
a39771cf
...
...
@@ -116,7 +116,7 @@ export default {
<gl-dropdown
v-if=
"displayFilters"
id=
"discussion-filter-dropdown"
class=
"gl-mr-3 full-width-mobile discussion-filter-container js-discussion-filter-container
qa-discussion-filter
"
class=
"gl-mr-3 full-width-mobile discussion-filter-container js-discussion-filter-container"
data-qa-selector=
"discussion_filter_dropdown"
:text=
"currentFilter.title"
>
...
...
qa/qa/ee/page/group/epic/show.rb
View file @
a39771cf
...
...
@@ -7,6 +7,7 @@ module QA
module
Epic
class
Show
<
QA
::
Page
::
Base
include
QA
::
Page
::
Component
::
Issuable
::
Common
include
QA
::
Page
::
Component
::
Note
view
'ee/app/assets/javascripts/epic/components/epic_header.vue'
do
element
:close_reopen_epic_button
...
...
@@ -41,11 +42,6 @@ module QA
click_element
:add_issue_button
end
def
add_comment_to_epic
(
comment
)
fill_element
:comment_field
,
comment
click_element
:comment_button
end
def
remove_issue_from_epic
click_element
:remove_issue_button
# Capybara code is used below due to the modal being defined in the @gitlab/ui project
...
...
qa/qa/page/component/issuable/sidebar.rb
View file @
a39771cf
...
...
@@ -73,7 +73,7 @@ module QA
def
has_no_assignee_named?
(
username
)
within_element
(
:assignee_block
)
do
has_no_text?
(
username
)
has_no_text?
(
username
,
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
end
end
...
...
qa/qa/page/component/note.rb
View file @
a39771cf
...
...
@@ -13,20 +13,35 @@ module QA
element
:toggle_comments_button
end
base
.
view
'app/assets/javascripts/notes/components/comment_form.vue'
do
element
:comment_button
element
:comment_field
element
:discussion_menu_item
element
:note_dropdown
end
base
.
view
'app/assets/javascripts/notes/components/discussion_actions.vue'
do
element
:discussion_reply_tab
element
:resolve_discussion_button
end
base
.
view
'app/assets/javascripts/notes/components/comment_form.vue'
do
element
:note_dropdown
element
:discussion_menu_item
base
.
view
'app/assets/javascripts/notes/components/discussion_filter.vue'
do
element
:discussion_filter_dropdown
,
required:
true
element
:filter_menu_item
end
base
.
view
'app/assets/javascripts/notes/components/discussion_filter_note.vue'
do
element
:discussion_filter_container
end
base
.
view
'app/assets/javascripts/notes/components/noteable_discussion.vue'
do
element
:discussion_content
end
base
.
view
'app/assets/javascripts/notes/components/noteable_note.vue'
do
element
:noteable_note_container
end
base
.
view
'app/assets/javascripts/notes/components/note_actions.vue'
do
element
:note_edit_button
end
...
...
@@ -36,6 +51,10 @@ module QA
element
:reply_comment_button
end
base
.
view
'app/assets/javascripts/notes/components/note_header.vue'
do
element
:system_note_content
end
base
.
view
'app/assets/javascripts/notes/components/toggle_replies_widget.vue'
do
element
:expand_replies_button
element
:collapse_replies_button
...
...
@@ -44,12 +63,30 @@ module QA
base
.
view
'app/assets/javascripts/vue_shared/components/notes/skeleton_note.vue'
do
element
:skeleton_note_placeholder
end
base
.
view
'app/views/shared/notes/_form.html.haml'
do
element
:new_note_form
,
'new-note'
# rubocop:disable QA/ElementWithPattern
element
:new_note_form
,
'attr: :note'
# rubocop:disable QA/ElementWithPattern
end
end
def
collapse_replies
click_element
:collapse_replies_button
end
# Attachment option should be an absolute path
def
comment
(
text
,
attachment:
nil
,
filter: :all_activities
)
method
(
"select_
#{
filter
}
_filter"
).
call
fill_element
:comment_field
,
"
#{
text
}
\n
"
unless
attachment
.
nil?
QA
::
Page
::
Component
::
Dropzone
.
new
(
self
,
'.new-note'
)
.
attach_file
(
attachment
)
end
click_element
:comment_button
end
def
edit_comment
(
text
)
click_element
:note_edit_button
fill_element
:reply_field
,
text
...
...
@@ -60,6 +97,18 @@ module QA
click_element
:expand_replies_button
end
def
has_comment?
(
comment_text
)
has_element?
(
:noteable_note_container
,
text:
comment_text
,
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
end
def
has_system_note?
(
note_text
)
has_element?
(
:system_note_content
,
text:
note_text
,
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
end
def
noteable_note_item
find_element
(
:noteable_note_container
)
end
def
reply_to_discussion
(
position
,
reply_text
)
type_reply_to_discussion
(
position
,
reply_text
)
click_element
:reply_comment_button
...
...
@@ -71,6 +120,26 @@ module QA
end
end
def
select_all_activities_filter
select_filter_with_text
(
'Show all activity'
)
end
def
select_comments_only_filter
select_filter_with_text
(
'Show comments only'
)
wait_until
do
has_no_element?
(
:system_note_content
)
end
end
def
select_history_only_filter
select_filter_with_text
(
'Show history only'
)
wait_until
do
has_element?
(
:discussion_filter_container
)
&&
has_no_element?
(
:noteable_note_container
)
end
end
def
start_discussion
(
text
)
fill_element
:comment_field
,
text
click_element
:note_dropdown
...
...
@@ -90,6 +159,18 @@ module QA
def
wait_for_loading
has_no_element?
(
:skeleton_note_placeholer
)
end
private
def
select_filter_with_text
(
text
)
retry_on_exception
do
click_element
(
:title
)
click_element
:discussion_filter_dropdown
find_element
(
:filter_menu_item
,
text:
text
).
click
wait_for_loading
end
end
end
end
end
...
...
qa/qa/page/project/issue/show.rb
View file @
a39771cf
...
...
@@ -10,28 +10,6 @@ module QA
include
Page
::
Component
::
DesignManagement
include
Page
::
Component
::
Issuable
::
Sidebar
view
'app/assets/javascripts/notes/components/comment_form.vue'
do
element
:comment_button
element
:comment_field
end
view
'app/assets/javascripts/notes/components/discussion_filter.vue'
do
element
:discussion_filter_dropdown
,
required:
true
element
:filter_menu_item
end
view
'app/assets/javascripts/notes/components/discussion_filter_note.vue'
do
element
:discussion_filter_container
end
view
'app/assets/javascripts/notes/components/noteable_note.vue'
do
element
:noteable_note_container
end
view
'app/assets/javascripts/notes/components/note_header.vue'
do
element
:system_note_content
end
view
'app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue'
do
element
:remove_related_issue_button
end
...
...
@@ -41,11 +19,6 @@ module QA
element
:reopen_issue_button
end
view
'app/views/shared/notes/_form.html.haml'
do
element
:new_note_form
,
'new-note'
# rubocop:disable QA/ElementWithPattern
element
:new_note_form
,
'attr: :note'
# rubocop:disable QA/ElementWithPattern
end
view
'app/assets/javascripts/related_issues/components/add_issuable_form.vue'
do
element
:add_issue_button
end
...
...
@@ -88,67 +61,9 @@ module QA
click_element
:close_issue_button
end
# Adds a comment to an issue
# attachment option should be an absolute path
def
comment
(
text
,
attachment:
nil
,
filter: :all_activities
)
method
(
"select_
#{
filter
}
_filter"
).
call
fill_element
:comment_field
,
"
#{
text
}
\n
"
unless
attachment
.
nil?
QA
::
Page
::
Component
::
Dropzone
.
new
(
self
,
'.new-note'
)
.
attach_file
(
attachment
)
end
click_element
:comment_button
end
def
has_comment?
(
comment_text
)
has_element?
(
:noteable_note_container
,
text:
comment_text
,
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
end
def
has_system_note?
(
note_text
)
has_element?
(
:system_note_content
,
text:
note_text
,
wait:
QA
::
Support
::
Repeater
::
DEFAULT_MAX_WAIT_TIME
)
end
def
noteable_note_item
find_element
(
:noteable_note_container
)
end
def
select_all_activities_filter
select_filter_with_text
(
'Show all activity'
)
end
def
select_comments_only_filter
select_filter_with_text
(
'Show comments only'
)
wait_until
do
has_no_element?
(
:system_note_content
)
end
end
def
select_history_only_filter
select_filter_with_text
(
'Show history only'
)
wait_until
do
has_element?
(
:discussion_filter_container
)
&&
has_no_element?
(
:noteable_note_container
)
end
end
def
has_metrics_unfurled?
has_element?
(
:prometheus_graph_widgets
,
wait:
30
)
end
private
def
select_filter_with_text
(
text
)
retry_on_exception
do
click_element
(
:title
)
click_element
:discussion_filter_dropdown
find_element
(
:filter_menu_item
,
text:
text
).
click
wait_for_loading
end
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/2_plan/issue/collapse_comments_in_discussions_spec.rb
View file @
a39771cf
...
...
@@ -26,7 +26,7 @@ module QA
expect
(
show
).
not_to
have_content
(
my_first_reply
)
show
.
expand_replies
expect
(
show
).
to
have_co
nt
ent
(
my_first_reply
)
expect
(
show
).
to
have_co
mm
ent
(
my_first_reply
)
expect
(
show
).
not_to
have_content
(
one_reply
)
end
end
...
...
qa/qa/specs/features/browser_ui/2_plan/issue/comment_issue_spec.rb
View file @
a39771cf
...
...
@@ -16,11 +16,11 @@ module QA
show
.
comment
(
first_version_of_comment
)
expect
(
show
).
to
have_co
nt
ent
(
first_version_of_comment
)
expect
(
show
).
to
have_co
mm
ent
(
first_version_of_comment
)
show
.
edit_comment
(
second_version_of_comment
)
expect
(
show
).
to
have_co
nt
ent
(
second_version_of_comment
)
expect
(
show
).
to
have_co
mm
ent
(
second_version_of_comment
)
expect
(
show
).
not_to
have_content
(
first_version_of_comment
)
end
end
...
...
qa/qa/specs/features/ee/browser_ui/2_plan/epic/epics_management_spec.rb
View file @
a39771cf
...
...
@@ -51,20 +51,22 @@ module QA
it
'comments on epic'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/525'
do
comment
=
'My Epic Comment'
EE
::
Page
::
Group
::
Epic
::
Show
.
perform
do
|
show
|
show
.
add_comment_to_epic
(
comment
)
end
show
.
comment
(
comment
)
expect
(
page
).
to
have_content
(
comment
)
expect
(
show
).
to
have_comment
(
comment
)
end
end
it
'closes and reopens an epic'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/524'
do
EE
::
Page
::
Group
::
Epic
::
Show
.
perform
(
&
:close_reopen_epic
)
EE
::
Page
::
Group
::
Epic
::
Show
.
perform
do
|
show
|
show
.
close_reopen_epic
expect
(
page
).
to
have_content
(
'C
losed'
)
expect
(
show
).
to
have_system_note
(
'c
losed'
)
EE
::
Page
::
Group
::
Epic
::
Show
.
perform
(
&
:close_reopen_epic
)
show
.
close_reopen_epic
expect
(
page
).
to
have_content
(
'Open'
)
expect
(
show
).
to
have_system_note
(
'opened'
)
end
end
end
...
...
@@ -79,8 +81,10 @@ module QA
epic
.
visit!
expect
(
page
).
to
have_content
(
'added issue'
)
expect
(
page
).
to
have_content
(
'removed issue'
)
EE
::
Page
::
Group
::
Epic
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
have_system_note
(
'added issue'
)
expect
(
show
).
to
have_system_note
(
'removed issue'
)
end
end
def
create_issue_resource
...
...
qa/qa/specs/features/ee/browser_ui/3_create/merge_request/add_batch_comments_in_merge_request_spec.rb
View file @
a39771cf
...
...
@@ -32,8 +32,8 @@ module QA
show
.
start_review
show
.
submit_pending_reviews
expect
(
show
).
to
have_co
nt
ent
(
"I'm starting a new discussion"
)
expect
(
show
).
to
have_co
nt
ent
(
"Could you please check this?"
)
expect
(
show
).
to
have_co
mm
ent
(
"I'm starting a new discussion"
)
expect
(
show
).
to
have_co
mm
ent
(
"Could you please check this?"
)
expect
(
show
).
to
have_content
(
"1 unresolved thread"
)
end
end
...
...
@@ -72,7 +72,7 @@ module QA
show
.
click_discussions_tab
show
.
resolve_discussion_at_index
(
0
)
expect
(
show
).
to
have_co
nt
ent
(
"Can you check this line of code?"
)
expect
(
show
).
to
have_co
mm
ent
(
"Can you check this line of code?"
)
expect
(
show
).
to
have_content
(
"All threads resolved"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment