summaryrefslogtreecommitdiff
path: root/qa/qa/page/component
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/component')
-rw-r--r--qa/qa/page/component/issue_board/show.rb2
-rw-r--r--qa/qa/page/component/project_selector.rb3
-rw-r--r--qa/qa/page/component/select2.rb8
-rw-r--r--qa/qa/page/component/snippet.rb14
4 files changed, 27 insertions, 0 deletions
diff --git a/qa/qa/page/component/issue_board/show.rb b/qa/qa/page/component/issue_board/show.rb
index 9e843630115..15c1c25cbf9 100644
--- a/qa/qa/page/component/issue_board/show.rb
+++ b/qa/qa/page/component/issue_board/show.rb
@@ -96,6 +96,8 @@ module QA
click_boards_config_button
click_element(:labels_edit_button)
find_element(:labels_dropdown_content).find('li', text: label).click
+ # Clicking the edit button again closes the dropdown and allows the save button to be clicked
+ click_element(:labels_edit_button)
click_element(:save_changes_button)
wait_boards_list_finish_loading
end
diff --git a/qa/qa/page/component/project_selector.rb b/qa/qa/page/component/project_selector.rb
index 80ed6b8e53b..54bd95c5422 100644
--- a/qa/qa/page/component/project_selector.rb
+++ b/qa/qa/page/component/project_selector.rb
@@ -20,6 +20,9 @@ module QA
end
def select_project
+ wait_until(sleep_interval: 2, reload: false) do
+ has_element? :project_list_item
+ end
click_element :project_list_item
end
end
diff --git a/qa/qa/page/component/select2.rb b/qa/qa/page/component/select2.rb
index b8beb64b6bd..761bbb17168 100644
--- a/qa/qa/page/component/select2.rb
+++ b/qa/qa/page/component/select2.rb
@@ -8,6 +8,10 @@ module QA
find('.select2-result-label', text: item_text, match: :prefer_exact).click
end
+ def has_item?(item_text)
+ has_css?('.select2-result-label', text: item_text, match: :prefer_exact)
+ end
+
def current_selection
find('.select2-chosen').text
end
@@ -25,8 +29,12 @@ module QA
end
def search_and_select(item_text)
+ QA::Runtime::Logger.info "Searching and selecting: #{item_text}"
+
search_item(item_text)
+ raise QA::Page::Base::ElementNotFound, %Q(Couldn't find option named "#{item_text}") unless has_item?(item_text)
+
select_item(item_text)
end
diff --git a/qa/qa/page/component/snippet.rb b/qa/qa/page/component/snippet.rb
index b84166ccefd..2776b6c078e 100644
--- a/qa/qa/page/component/snippet.rb
+++ b/qa/qa/page/component/snippet.rb
@@ -40,6 +40,7 @@ module QA
base.view 'app/assets/javascripts/snippets/components/show.vue' do
element :clone_button
+ element :snippet_embed_dropdown
end
base.view 'app/assets/javascripts/vue_shared/components/clone_dropdown.vue' do
@@ -73,6 +74,10 @@ module QA
element :more_actions_dropdown
element :delete_comment_button
end
+
+ base.view 'app/assets/javascripts/snippets/components/embed_dropdown.vue' do
+ element :copy_button
+ end
end
def has_snippet_title?(snippet_title)
@@ -105,6 +110,10 @@ module QA
end
end
+ def has_embed_dropdown?
+ has_element?(:snippet_embed_dropdown)
+ end
+
def click_edit_button
click_element(:snippet_action_button, action: 'Edit')
end
@@ -129,6 +138,11 @@ module QA
Git::Location.new(find_element(:copy_ssh_url_button)['data-clipboard-text']).uri.to_s
end
+ def get_sharing_link
+ click_element(:snippet_embed_dropdown)
+ find_element(:copy_button, action: 'Share')['data-clipboard-text']
+ end
+
def add_comment(comment)
fill_element(:note_field, comment)
click_element(:comment_button)