Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-25 06:06:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-25 06:06:21 +0300
commit7bb7a8d529fd1155a35a2e9e9cdddd7953f3776d (patch)
treee0cedf3ea8732ab14cd918242279619c3c7d7072 /qa
parent504ab1e32cbd3a529fe61f6c9a30823febce796c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/base.rb4
-rw-r--r--qa/qa/page/project/issue/index.rb16
-rw-r--r--qa/qa/page/project/issue/show.rb62
-rw-r--r--qa/qa/runtime/env.rb32
4 files changed, 109 insertions, 5 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb
index 104c9b19e2a..94e046fd3bf 100644
--- a/qa/qa/page/base.rb
+++ b/qa/qa/page/base.rb
@@ -131,6 +131,10 @@ module QA
has_no_css?('.fa-spinner', wait: Capybara.default_max_wait_time)
end
+ def finished_loading_block?
+ has_no_css?('.fa-spinner.block-loading', wait: Capybara.default_max_wait_time)
+ end
+
def wait_for_animated_element(name)
# It would be ideal if we could detect when the animation is complete
# but in some cases there's nothing we can easily access via capybara
diff --git a/qa/qa/page/project/issue/index.rb b/qa/qa/page/project/issue/index.rb
index f74366f6967..befee25b37a 100644
--- a/qa/qa/page/project/issue/index.rb
+++ b/qa/qa/page/project/issue/index.rb
@@ -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
diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb
index e5e26b1864b..9264289b603 100644
--- a/qa/qa/page/project/issue/show.rb
+++ b/qa/qa/page/project/issue/show.rb
@@ -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_block?
+ yield
+ end
+ end
+ end
end
end
end
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index 594e5712ab2..a437c83100a 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -145,6 +145,38 @@ module QA
ENV['GITLAB_QA_PASSWORD_2']
end
+ def gitlab_qa_username_3
+ ENV['GITLAB_QA_USERNAME_3'] || 'gitlab-qa-user3'
+ end
+
+ def gitlab_qa_password_3
+ ENV['GITLAB_QA_PASSWORD_3']
+ end
+
+ def gitlab_qa_username_4
+ ENV['GITLAB_QA_USERNAME_4'] || 'gitlab-qa-user4'
+ end
+
+ def gitlab_qa_password_4
+ ENV['GITLAB_QA_PASSWORD_4']
+ end
+
+ def gitlab_qa_username_5
+ ENV['GITLAB_QA_USERNAME_5'] || 'gitlab-qa-user5'
+ end
+
+ def gitlab_qa_password_5
+ ENV['GITLAB_QA_PASSWORD_5']
+ end
+
+ def gitlab_qa_username_6
+ ENV['GITLAB_QA_USERNAME_6'] || 'gitlab-qa-user6'
+ end
+
+ def gitlab_qa_password_6
+ ENV['GITLAB_QA_PASSWORD_6']
+ end
+
def knapsack?
!!(ENV['KNAPSACK_GENERATE_REPORT'] || ENV['KNAPSACK_REPORT_PATH'] || ENV['KNAPSACK_TEST_FILE_PATTERN'])
end