summaryrefslogtreecommitdiff
path: root/qa/qa/page/project
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /qa/qa/page/project
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
downloadgitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'qa/qa/page/project')
-rw-r--r--qa/qa/page/project/fork/new.rb4
-rw-r--r--qa/qa/page/project/issue/new.rb18
-rw-r--r--qa/qa/page/project/members.rb60
-rw-r--r--qa/qa/page/project/menu.rb14
-rw-r--r--qa/qa/page/project/new_experiment.rb26
-rw-r--r--qa/qa/page/project/operations/metrics/show.rb3
-rw-r--r--qa/qa/page/project/settings/advanced.rb4
-rw-r--r--qa/qa/page/project/settings/ci_cd.rb2
-rw-r--r--qa/qa/page/project/settings/integrations.rb7
-rw-r--r--qa/qa/page/project/settings/main.rb2
-rw-r--r--qa/qa/page/project/settings/members.rb62
-rw-r--r--qa/qa/page/project/settings/services/jira.rb60
-rw-r--r--qa/qa/page/project/snippet/new.rb29
-rw-r--r--qa/qa/page/project/sub_menus/settings.rb9
-rw-r--r--qa/qa/page/project/web_ide/edit.rb22
-rw-r--r--qa/qa/page/project/wiki/edit.rb30
-rw-r--r--qa/qa/page/project/wiki/new.rb61
-rw-r--r--qa/qa/page/project/wiki/show.rb57
18 files changed, 295 insertions, 175 deletions
diff --git a/qa/qa/page/project/fork/new.rb b/qa/qa/page/project/fork/new.rb
index 1a52c61551d..49c2205fd08 100644
--- a/qa/qa/page/project/fork/new.rb
+++ b/qa/qa/page/project/fork/new.rb
@@ -6,11 +6,11 @@ module QA
module Fork
class New < Page::Base
view 'app/views/projects/forks/_fork_button.html.haml' do
- element :namespace, 'link_to project_forks_path' # rubocop:disable QA/ElementWithPattern
+ element :fork_namespace_content
end
def choose_namespace(namespace = Runtime::Namespace.path)
- click_on namespace
+ click_element(:fork_namespace_content, name: namespace)
end
end
end
diff --git a/qa/qa/page/project/issue/new.rb b/qa/qa/page/project/issue/new.rb
index 65c02801d67..c90a09dce2e 100644
--- a/qa/qa/page/project/issue/new.rb
+++ b/qa/qa/page/project/issue/new.rb
@@ -4,27 +4,11 @@ module QA
module Page
module Project
module Issue
- class New < Page::Base
+ class New < Page::Issuable::New
view 'app/views/shared/issuable/_form.html.haml' do
element :issuable_create_button
end
- view 'app/views/shared/issuable/form/_title.html.haml' do
- element :issue_title_textbox, 'form.text_field :title' # rubocop:disable QA/ElementWithPattern
- end
-
- view 'app/views/shared/form_elements/_description.html.haml' do
- element :issue_description_textarea, "render 'projects/zen', f: form, attr: :description" # rubocop:disable QA/ElementWithPattern
- end
-
- def add_title(title)
- fill_in 'issue_title', with: title
- end
-
- def add_description(description)
- fill_in 'issue_description', with: description
- end
-
def create_new_issue
click_element :issuable_create_button, Page::Project::Issue::Show
end
diff --git a/qa/qa/page/project/members.rb b/qa/qa/page/project/members.rb
new file mode 100644
index 00000000000..88b05ceb1d1
--- /dev/null
+++ b/qa/qa/page/project/members.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ class Members < Page::Base
+ include QA::Page::Component::Select2
+
+ view 'app/views/shared/members/_invite_member.html.haml' do
+ element :member_select_field
+ element :invite_member_button
+ end
+
+ view 'app/views/projects/project_members/_team.html.haml' do
+ element :members_list
+ end
+
+ view 'app/views/projects/project_members/index.html.haml' do
+ element :invite_group_tab
+ end
+
+ view 'app/views/shared/members/_invite_group.html.haml' do
+ element :group_select_field
+ element :invite_group_button
+ end
+
+ view 'app/views/shared/members/_group.html.haml' do
+ element :group_row
+ element :delete_group_access_link
+ end
+
+ def select_group(group_name)
+ click_element :group_select_field
+ search_and_select(group_name)
+ end
+
+ def invite_group(group_name)
+ click_element :invite_group_tab
+ select_group(group_name)
+ click_element :invite_group_button
+ end
+
+ def add_member(username)
+ click_element :member_select_field
+ search_and_select username
+ click_element :invite_member_button
+ end
+
+ def remove_group(group_name)
+ click_element :invite_group_tab
+ page.accept_alert do
+ within_element(:group_row, text: group_name) do
+ click_element :delete_group_access_link
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/menu.rb b/qa/qa/page/project/menu.rb
index 5967213a52b..3d4d0ff9d22 100644
--- a/qa/qa/page/project/menu.rb
+++ b/qa/qa/page/project/menu.rb
@@ -16,6 +16,8 @@ module QA
element :activity_link
element :merge_requests_link
element :wiki_link
+ element :snippets_link
+ element :members_link
end
def click_merge_requests
@@ -35,6 +37,18 @@ module QA
click_element(:activity_link)
end
end
+
+ def click_snippets
+ within_sidebar do
+ click_element(:snippets_link)
+ end
+ end
+
+ def click_members
+ within_sidebar do
+ click_element(:members_link)
+ end
+ end
end
end
end
diff --git a/qa/qa/page/project/new_experiment.rb b/qa/qa/page/project/new_experiment.rb
new file mode 100644
index 00000000000..813f7f6cefe
--- /dev/null
+++ b/qa/qa/page/project/new_experiment.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ class NewExperiment < Page::Base
+ view 'app/assets/javascripts/projects/experiment_new_project_creation/components/welcome.vue' do
+ element :blank_project_link, ':data-qa-selector="`${panel.name}_link`"' # rubocop:disable QA/ElementWithPattern
+ element :create_from_template_link, ':data-qa-selector="`${panel.name}_link`"' # rubocop:disable QA/ElementWithPattern
+ end
+
+ def shown?
+ has_element? :blank_project_link
+ end
+
+ def click_blank_project_link
+ click_element :blank_project_link
+ end
+
+ def click_create_from_template_link
+ click_element :create_from_template_link
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/operations/metrics/show.rb b/qa/qa/page/project/operations/metrics/show.rb
index 2228cca1d3d..a1c15e72f44 100644
--- a/qa/qa/page/project/operations/metrics/show.rb
+++ b/qa/qa/page/project/operations/metrics/show.rb
@@ -11,6 +11,9 @@ module QA
view 'app/assets/javascripts/monitoring/components/dashboard.vue' do
element :prometheus_graphs
+ end
+
+ view 'app/assets/javascripts/monitoring/components/dashboard_header.vue' do
element :dashboards_filter_dropdown
element :environments_dropdown
element :edit_dashboard_button
diff --git a/qa/qa/page/project/settings/advanced.rb b/qa/qa/page/project/settings/advanced.rb
index 3bb5181a31c..d6e004e827e 100644
--- a/qa/qa/page/project/settings/advanced.rb
+++ b/qa/qa/page/project/settings/advanced.rb
@@ -43,7 +43,9 @@ module QA
def transfer_project!(project_name, namespace)
expand_select_list
- select_transfer_option(namespace)
+ # Workaround for a failure to search when there are no spaces around the /
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/218965
+ select_transfer_option(namespace.gsub(/([^\s])\/([^\s])/, '\1 / \2'))
click_element(:transfer_button)
fill_confirmation_text(project_name)
click_confirm_button
diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb
index aa27c030b78..a7a0f6f57b6 100644
--- a/qa/qa/page/project/settings/ci_cd.rb
+++ b/qa/qa/page/project/settings/ci_cd.rb
@@ -42,5 +42,3 @@ module QA
end
end
end
-
-QA::Page::Project::Settings::CICD.prepend_if_ee('QA::EE::Page::Project::Settings::CICD')
diff --git a/qa/qa/page/project/settings/integrations.rb b/qa/qa/page/project/settings/integrations.rb
index 436a42fb093..e18ff71bcb3 100644
--- a/qa/qa/page/project/settings/integrations.rb
+++ b/qa/qa/page/project/settings/integrations.rb
@@ -7,13 +7,20 @@ module QA
class Integrations < QA::Page::Base
view 'app/views/shared/integrations/_index.html.haml' do
element :prometheus_link, '{ data: { qa_selector: "#{integration.to_param' # rubocop:disable QA/ElementWithPattern
+ element :jira_link, '{ data: { qa_selector: "#{integration.to_param' # rubocop:disable QA/ElementWithPattern
end
def click_on_prometheus_integration
click_element :prometheus_link
end
+
+ def click_jira_link
+ click_element :jira_link
+ end
end
end
end
end
end
+
+QA::Page::Project::Settings::Integrations.prepend_if_ee('QA::EE::Page::Project::Settings::Integrations')
diff --git a/qa/qa/page/project/settings/main.rb b/qa/qa/page/project/settings/main.rb
index efae497b6ba..880711770c0 100644
--- a/qa/qa/page/project/settings/main.rb
+++ b/qa/qa/page/project/settings/main.rb
@@ -58,3 +58,5 @@ module QA
end
end
end
+
+QA::Page::Project::Settings::Main.prepend_if_ee("QA::EE::Page::Project::Settings::Main")
diff --git a/qa/qa/page/project/settings/members.rb b/qa/qa/page/project/settings/members.rb
deleted file mode 100644
index 5dc873750b0..00000000000
--- a/qa/qa/page/project/settings/members.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- module Page
- module Project
- module Settings
- class Members < Page::Base
- include QA::Page::Component::Select2
-
- view 'app/views/shared/members/_invite_member.html.haml' do
- element :member_select_field
- element :invite_member_button
- end
-
- view 'app/views/projects/project_members/_team.html.haml' do
- element :members_list
- end
-
- view 'app/views/projects/project_members/index.html.haml' do
- element :invite_group_tab
- end
-
- view 'app/views/shared/members/_invite_group.html.haml' do
- element :group_select_field
- element :invite_group_button
- end
-
- view 'app/views/shared/members/_group.html.haml' do
- element :group_row
- element :delete_group_access_link
- end
-
- def select_group(group_name)
- click_element :group_select_field
- search_and_select(group_name)
- end
-
- def invite_group(group_name)
- click_element :invite_group_tab
- select_group(group_name)
- click_element :invite_group_button
- end
-
- def add_member(username)
- click_element :member_select_field
- search_and_select username
- click_element :invite_member_button
- end
-
- def remove_group(group_name)
- click_element :invite_group_tab
- page.accept_alert do
- within_element(:group_row, text: group_name) do
- click_element :delete_group_access_link
- end
- end
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/page/project/settings/services/jira.rb b/qa/qa/page/project/settings/services/jira.rb
new file mode 100644
index 00000000000..9f9331bac94
--- /dev/null
+++ b/qa/qa/page/project/settings/services/jira.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Settings
+ module Services
+ class Jira < QA::Page::Base
+ view 'app/views/shared/_field.html.haml' do
+ element :url_field, 'data: { qa_selector: "#{name.downcase.gsub' # rubocop:disable QA/ElementWithPattern
+ element :username_field, 'data: { qa_selector: "#{name.downcase.gsub' # rubocop:disable QA/ElementWithPattern
+ element :password_field, 'data: { qa_selector: "#{name.downcase.gsub' # rubocop:disable QA/ElementWithPattern
+ element :jira_issue_transition_id_field, 'data: { qa_selector: "#{name.downcase.gsub' # rubocop:disable QA/ElementWithPattern
+ end
+
+ view 'app/helpers/services_helper.rb' do
+ element :save_changes_button
+ end
+
+ def setup_service_with(url:)
+ QA::Runtime::Logger.info "Setting up JIRA"
+
+ set_jira_server_url(url)
+ set_username(Runtime::Env.jira_admin_username)
+ set_password(Runtime::Env.jira_admin_password)
+ set_transaction_ids('11,21,31,41')
+
+ click_save_changes_button
+ wait_until(reload: false) do
+ has_element?(:save_changes_button, wait: 1) ? !find_element(:save_changes_button).disabled? : true
+ end
+ end
+
+ private
+
+ def set_jira_server_url(url)
+ fill_element(:url_field, url)
+ end
+
+ def set_username(username)
+ fill_element(:username_field, username)
+ end
+
+ def set_password(password)
+ fill_element(:password_field, password)
+ end
+
+ def set_transaction_ids(transaction_ids)
+ fill_element(:jira_issue_transition_id_field, transaction_ids)
+ end
+
+ def click_save_changes_button
+ click_element :save_changes_button
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/snippet/new.rb b/qa/qa/page/project/snippet/new.rb
new file mode 100644
index 00000000000..1463dfc2c7f
--- /dev/null
+++ b/qa/qa/page/project/snippet/new.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Snippet
+ class New < Page::Dashboard::Snippet::New
+ include Component::LazyLoader
+ view 'app/views/shared/empty_states/_snippets.html.haml' do
+ element :create_first_snippet_link
+ element :svg_content
+ end
+
+ def click_create_first_snippet
+ finished_loading?
+ # The svg takes a fraction of a second to load after which the
+ # "New snippet" button shifts up a bit. This can cause
+ # webdriver to miss the hit so we wait for the svg to load before
+ # clicking the button.
+ within_element(:svg_content) do
+ has_element?(:js_lazy_loaded)
+ end
+ click_element(:create_first_snippet_link)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/sub_menus/settings.rb b/qa/qa/page/project/sub_menus/settings.rb
index 0dd4bd1817a..47274c8db54 100644
--- a/qa/qa/page/project/sub_menus/settings.rb
+++ b/qa/qa/page/project/sub_menus/settings.rb
@@ -15,7 +15,6 @@ module QA
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :settings_item
- element :link_members_settings
element :general_settings_link
element :integrations_settings_link
element :operations_settings_link
@@ -31,14 +30,6 @@ module QA
end
end
- def go_to_members_settings
- hover_settings do
- within_submenu do
- click_element :link_members_settings
- end
- end
- end
-
def go_to_repository_settings
hover_settings do
within_submenu do
diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb
index 7809f9246ec..29f431d81df 100644
--- a/qa/qa/page/project/web_ide/edit.rb
+++ b/qa/qa/page/project/web_ide/edit.rb
@@ -20,12 +20,6 @@ module QA
element :file_list
end
- view 'app/assets/javascripts/ide/components/new_dropdown/modal.vue' do
- element :full_file_path
- element :new_file_modal
- element :template_list
- end
-
view 'app/assets/javascripts/ide/components/file_templates/bar.vue' do
element :file_templates_bar
element :file_template_dropdown
@@ -52,6 +46,10 @@ module QA
element :editor_container
end
+ view 'app/assets/javascripts/ide/components/ide.vue' do
+ element :first_file_button
+ end
+
def has_file?(file_name)
within_element(:file_list) do
page.has_content? file_name
@@ -59,10 +57,7 @@ module QA
end
def create_new_file_from_template(file_name, template)
- click_element :new_file
-
- # Wait for the modal animation to complete before clicking on the file name
- wait_for_animated_element(:new_file_modal)
+ click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile)
within_element(:template_list) do
click_on file_name
@@ -130,6 +125,13 @@ module QA
find('.modified textarea.inputarea')
end
end
+
+ def create_first_file(file_name)
+ finished_loading?
+ click_element(:first_file_button, Page::Component::WebIDE::Modal::CreateNewFile)
+ fill_element(:file_name_field, file_name)
+ click_button('Create file')
+ end
end
end
end
diff --git a/qa/qa/page/project/wiki/edit.rb b/qa/qa/page/project/wiki/edit.rb
index f6edc28c41a..96301e33733 100644
--- a/qa/qa/page/project/wiki/edit.rb
+++ b/qa/qa/page/project/wiki/edit.rb
@@ -5,14 +5,32 @@ module QA
module Project
module Wiki
class Edit < Page::Base
- view 'app/views/projects/wikis/_main_links.html.haml' do
- element :new_page_link, 'New page' # rubocop:disable QA/ElementWithPattern
- element :page_history_link, 'Page history' # rubocop:disable QA/ElementWithPattern
- element :edit_page_link, 'Edit' # rubocop:disable QA/ElementWithPattern
+ view 'app/views/shared/wikis/_form.html.haml' do
+ element :wiki_title_textbox
+ element :wiki_content_textarea
+ element :wiki_message_textbox
+ element :save_changes_button
+ element :create_page_button
end
- def click_edit
- click_on 'Edit'
+ def set_title(title)
+ fill_element :wiki_title_textbox, title
+ end
+
+ def set_content(content)
+ fill_element :wiki_content_textarea, content
+ end
+
+ def set_message(message)
+ fill_element :wiki_message_textbox, message
+ end
+
+ def click_save_changes
+ click_element :save_changes_button
+ end
+
+ def click_create_page
+ click_element :create_page_button
end
end
end
diff --git a/qa/qa/page/project/wiki/new.rb b/qa/qa/page/project/wiki/new.rb
deleted file mode 100644
index 792eba4bab7..00000000000
--- a/qa/qa/page/project/wiki/new.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- module Page
- module Project
- module Wiki
- class New < Page::Base
- include Component::LazyLoader
-
- view 'app/views/projects/wikis/_form.html.haml' do
- element :wiki_title_textbox
- element :wiki_content_textarea
- element :wiki_message_textbox
- element :save_changes_button
- element :create_page_button
- end
-
- view 'app/views/shared/empty_states/_wikis.html.haml' do
- element :create_first_page_link
- end
-
- view 'app/views/shared/empty_states/_wikis_layout.html.haml' do
- element :svg_content
- end
-
- def click_create_your_first_page_button
- # The svg takes a fraction of a second to load after which the
- # "Create your first page" button shifts up a bit. This can cause
- # webdriver to miss the hit so we wait for the svg to load before
- # clicking the button.
- within_element(:svg_content) do
- has_element? :js_lazy_loaded
- end
-
- click_element :create_first_page_link
- end
-
- def set_title(title)
- fill_element :wiki_title_textbox, title
- end
-
- def set_content(content)
- fill_element :wiki_content_textarea, content
- end
-
- def set_message(message)
- fill_element :wiki_message_textbox, message
- end
-
- def save_changes
- click_element :save_changes_button
- end
-
- def create_new_page
- click_element :create_page_button
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/page/project/wiki/show.rb b/qa/qa/page/project/wiki/show.rb
index 44619d177b1..7e4e714f4a6 100644
--- a/qa/qa/page/project/wiki/show.rb
+++ b/qa/qa/page/project/wiki/show.rb
@@ -5,23 +5,70 @@ module QA
module Project
module Wiki
class Show < Page::Base
- include Page::Component::LegacyClonePanel
+ include Component::LazyLoader
- view 'app/views/projects/wikis/pages.html.haml' do
- element :clone_repository_link, 'Clone repository' # rubocop:disable QA/ElementWithPattern
+ view 'app/views/shared/wikis/_sidebar.html.haml' do
+ element :clone_repository_link
end
- view 'app/views/projects/wikis/show.html.haml' do
+ view 'app/views/shared/wikis/show.html.haml' do
+ element :wiki_page_title
element :wiki_page_content
end
+ view 'app/views/shared/wikis/_main_links.html.haml' do
+ element :new_page_button
+ element :page_history_button
+ element :edit_page_button
+ end
+
+ view 'app/views/shared/empty_states/_wikis.html.haml' do
+ element :create_first_page_link
+ end
+
+ view 'app/views/shared/empty_states/_wikis_layout.html.haml' do
+ element :svg_content
+ end
+
+ def click_create_your_first_page
+ # The svg takes a fraction of a second to load after which the
+ # "Create your first page" button shifts up a bit. This can cause
+ # webdriver to miss the hit so we wait for the svg to load before
+ # clicking the button.
+ within_element(:svg_content) do
+ has_element? :js_lazy_loaded
+ end
+
+ click_element :create_first_page_link
+ end
+
+ def click_new_page
+ click_element(:new_page_button)
+ end
+
+ def click_page_history
+ click_element(:page_history_button)
+ end
+
+ def click_edit
+ click_element(:edit_page_button)
+ end
+
def click_clone_repository
- click_on 'Clone repository'
+ click_element(:clone_repository_link)
end
def wiki_text
find_element(:wiki_page_content).text
end
+
+ def has_title?(title)
+ has_element?(:wiki_page_title, title)
+ end
+
+ def has_content?(content)
+ has_element?(:wiki_page_content, content)
+ end
end
end
end