Commit 75795ecd authored by Walmyr Lima's avatar Walmyr Lima

Update page objects with new elements and methods

Also, reorder some views to keep the standard of organizing things
alphabetically.
parent 9f5019c7
...@@ -5,14 +5,30 @@ module QA ...@@ -5,14 +5,30 @@ module QA
module Project module Project
module Issue module Issue
class Index < Page::Base class Index < Page::Base
view 'app/helpers/projects_helper.rb' do
element :assignee_link
end
view 'app/views/projects/issues/_issue.html.haml' do view 'app/views/projects/issues/_issue.html.haml' do
element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern
end end
view 'app/views/shared/issuable/_assignees.html.haml' do
element :avatar_counter
end
view 'app/views/shared/issuable/_nav.html.haml' do view 'app/views/shared/issuable/_nav.html.haml' do
element :closed_issues_link element :closed_issues_link
end end
def assignee_link_count
all_elements(:assignee_link).count
end
def avatar_counter
find_element(:avatar_counter)
end
def click_issue_link(title) def click_issue_link(title)
click_link(title) click_link(title)
end end
......
...@@ -22,24 +22,54 @@ module QA ...@@ -22,24 +22,54 @@ module QA
element :noteable_note_item element :noteable_note_item
end end
view 'app/assets/javascripts/sidebar/components/assignees/assignee_avatar.vue' do
element :avatar_image
end
view 'app/assets/javascripts/sidebar/components/assignees/assignee_title.vue' do
element :assignee_edit_link
element :assignee_title
end
view 'app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue' do
element :more_assignees_link
end
view 'app/helpers/dropdowns_helper.rb' do view 'app/helpers/dropdowns_helper.rb' do
element :dropdown_input_field element :dropdown_input_field
end end
view 'app/views/shared/notes/_form.html.haml' do view 'app/views/shared/issuable/_close_reopen_button.html.haml' do
element :new_note_form, 'new-note' # rubocop:disable QA/ElementWithPattern element :reopen_issue_button
element :new_note_form, 'attr: :note' # rubocop:disable QA/ElementWithPattern
end end
view 'app/views/shared/issuable/_sidebar.html.haml' do view 'app/views/shared/issuable/_sidebar.html.haml' do
element :assignee_block
element :labels_block element :labels_block
element :edit_link_labels element :edit_link_labels
element :dropdown_menu_labels element :dropdown_menu_labels
element :milestone_link element :milestone_link
end end
view 'app/views/shared/issuable/_close_reopen_button.html.haml' do view 'app/views/shared/notes/_form.html.haml' do
element :reopen_issue_button element :new_note_form, 'new-note' # rubocop:disable QA/ElementWithPattern
element :new_note_form, 'attr: :note' # rubocop:disable QA/ElementWithPattern
end
def assign(user)
click_element(:assignee_edit_link)
select_user(user.username)
click_body
end
def assignee_title
find_element(:assignee_title)
end
def avatar_image_count
wait_assignees_block_finish_loading do
all_elements(:avatar_image).count
end
end end
def click_milestone_link def click_milestone_link
...@@ -66,6 +96,10 @@ module QA ...@@ -66,6 +96,10 @@ module QA
end end
end end
def more_assignees_link
find_element(:more_assignees_link)
end
def select_all_activities_filter def select_all_activities_filter
select_filter_with_text('Show all activity') select_filter_with_text('Show all activity')
end end
...@@ -103,6 +137,10 @@ module QA ...@@ -103,6 +137,10 @@ module QA
find_element(:labels_block) find_element(:labels_block)
end end
def toggle_more_assignees_link
click_element(:more_assignees_link)
end
private private
def select_filter_with_text(text) def select_filter_with_text(text)
...@@ -112,6 +150,20 @@ module QA ...@@ -112,6 +150,20 @@ module QA
find_element(:filter_options, text: text).click find_element(:filter_options, text: text).click
end end
end end
def select_user(username)
find("#{element_selector_css(:assignee_block)} input").set(username)
find('.dropdown-menu-user-link', text: "@#{username}").click
end
def wait_assignees_block_finish_loading
within_element(:assignee_block) do
wait(reload: false, max: 10, interval: 1) do
finished_loading?
yield
end
end
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