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
module Project
module Issue
class Index < Page::Base
view 'app/helpers/projects_helper.rb' do
element :assignee_link
end
view 'app/views/projects/issues/_issue.html.haml' do
element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern
end
view 'app/views/shared/issuable/_assignees.html.haml' do
element :avatar_counter
end
view 'app/views/shared/issuable/_nav.html.haml' do
element :closed_issues_link
end
def assignee_link_count
all_elements(:assignee_link).count
end
def avatar_counter
find_element(:avatar_counter)
end
def click_issue_link(title)
click_link(title)
end
......
......@@ -22,24 +22,54 @@ module QA
element :noteable_note_item
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
element :dropdown_input_field
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
view 'app/views/shared/issuable/_close_reopen_button.html.haml' do
element :reopen_issue_button
end
view 'app/views/shared/issuable/_sidebar.html.haml' do
element :assignee_block
element :labels_block
element :edit_link_labels
element :dropdown_menu_labels
element :milestone_link
end
view 'app/views/shared/issuable/_close_reopen_button.html.haml' do
element :reopen_issue_button
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
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
def click_milestone_link
......@@ -66,6 +96,10 @@ module QA
end
end
def more_assignees_link
find_element(:more_assignees_link)
end
def select_all_activities_filter
select_filter_with_text('Show all activity')
end
......@@ -103,6 +137,10 @@ module QA
find_element(:labels_block)
end
def toggle_more_assignees_link
click_element(:more_assignees_link)
end
private
def select_filter_with_text(text)
......@@ -112,6 +150,20 @@ module QA
find_element(:filter_options, text: text).click
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
......
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