summaryrefslogtreecommitdiff
path: root/qa/qa/page/project
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-20 18:42:06 +0000
commit6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch)
tree78be5963ec075d80116a932011d695dd33910b4e /qa/qa/page/project
parent1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff)
downloadgitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz
Add latest changes from gitlab-org/gitlab@13-3-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/index.rb21
-rw-r--r--qa/qa/page/project/issue/show.rb21
-rw-r--r--qa/qa/page/project/menu.rb1
-rw-r--r--qa/qa/page/project/operations/incidents/index.rb21
-rw-r--r--qa/qa/page/project/operations/kubernetes/add_existing.rb2
-rw-r--r--qa/qa/page/project/operations/kubernetes/show.rb4
-rw-r--r--qa/qa/page/project/operations/metrics/show.rb16
-rw-r--r--qa/qa/page/project/packages/index.rb28
-rw-r--r--qa/qa/page/project/packages/show.rb27
-rw-r--r--qa/qa/page/project/settings/advanced.rb17
-rw-r--r--qa/qa/page/project/settings/ci_cd.rb8
-rw-r--r--qa/qa/page/project/settings/ci_variables.rb2
-rw-r--r--qa/qa/page/project/settings/main.rb6
-rw-r--r--qa/qa/page/project/settings/operations.rb2
-rw-r--r--qa/qa/page/project/settings/protected_branches.rb2
-rw-r--r--qa/qa/page/project/settings/repository.rb18
-rw-r--r--qa/qa/page/project/show.rb4
-rw-r--r--qa/qa/page/project/snippet/new.rb1
-rw-r--r--qa/qa/page/project/sub_menus/operations.rb9
-rw-r--r--qa/qa/page/project/sub_menus/packages.rb29
-rw-r--r--qa/qa/page/project/web_ide/edit.rb63
-rw-r--r--qa/qa/page/project/wiki/sidebar.rb8
23 files changed, 238 insertions, 76 deletions
diff --git a/qa/qa/page/project/fork/new.rb b/qa/qa/page/project/fork/new.rb
index 49c2205fd08..e2f2e9330dd 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 :fork_namespace_content
+ element :fork_namespace_button
end
def choose_namespace(namespace = Runtime::Namespace.path)
- click_element(:fork_namespace_content, name: namespace)
+ click_element(:fork_namespace_button, name: namespace)
end
end
end
diff --git a/qa/qa/page/project/issue/index.rb b/qa/qa/page/project/issue/index.rb
index e0c10220fbc..0a64f01fe98 100644
--- a/qa/qa/page/project/issue/index.rb
+++ b/qa/qa/page/project/issue/index.rb
@@ -5,8 +5,14 @@ module QA
module Project
module Issue
class Index < Page::Base
- view 'app/helpers/projects_helper.rb' do
+ view 'app/assets/javascripts/issuables_list/components/issuable.vue' do
+ element :issue_container
+ element :issue_link
+ end
+
+ view 'app/assets/javascripts/vue_shared/components/issue/issue_assignees.vue' do
element :assignee_link
+ element :avatar_counter_content
end
view 'app/views/projects/issues/export_csv/_button.html.haml' do
@@ -23,21 +29,12 @@ module QA
element :import_from_jira_link
end
- view 'app/views/projects/issues/_issue.html.haml' do
- element :issue
- 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 avatar_counter
- find_element(:avatar_counter)
+ find_element(:avatar_counter_content)
end
def click_issue_link(title)
@@ -80,7 +77,7 @@ module QA
end
def has_issue?(issue)
- has_element? :issue, issue_title: issue.title
+ has_element? :issue_container, issue_title: issue.title
end
end
end
diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb
index 04f0f34cbbb..5778d0218a7 100644
--- a/qa/qa/page/project/issue/show.rb
+++ b/qa/qa/page/project/issue/show.rb
@@ -38,23 +38,6 @@ module QA
element :new_note_form, 'attr: :note' # rubocop:disable QA/ElementWithPattern
end
- view 'app/views/projects/issues/_tabs.html.haml' do
- element :designs_tab_content
- element :designs_tab_link
- element :discussion_tab_content
- element :discussion_tab_link
- end
-
- def click_discussion_tab
- click_element(:discussion_tab_link)
- active_element?(:discussion_tab_content)
- end
-
- def click_designs_tab
- click_element(:designs_tab_link)
- active_element?(:designs_tab_content)
- end
-
def click_remove_related_issue_button
click_element(:remove_related_issue_button)
end
@@ -97,6 +80,10 @@ module QA
select_filter_with_text('Show history only')
end
+ def has_metrics_unfurled?
+ has_element?(:prometheus_graph_widgets, wait: 30)
+ end
+
private
def select_filter_with_text(text)
diff --git a/qa/qa/page/project/menu.rb b/qa/qa/page/project/menu.rb
index 9faf1bd5f8f..16c66ea5761 100644
--- a/qa/qa/page/project/menu.rb
+++ b/qa/qa/page/project/menu.rb
@@ -11,6 +11,7 @@ module QA
include SubMenus::Operations
include SubMenus::Repository
include SubMenus::Settings
+ include SubMenus::Packages
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :activity_link
diff --git a/qa/qa/page/project/operations/incidents/index.rb b/qa/qa/page/project/operations/incidents/index.rb
new file mode 100644
index 00000000000..fd0c5253a7f
--- /dev/null
+++ b/qa/qa/page/project/operations/incidents/index.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Operations
+ module Incidents
+ class Index < Page::Base
+ view 'app/assets/javascripts/incidents/components/incidents_list.vue' do
+ element :create_incident_button
+ end
+
+ def create_incident
+ click_element :create_incident_button
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/operations/kubernetes/add_existing.rb b/qa/qa/page/project/operations/kubernetes/add_existing.rb
index c143b55d057..1b9a451c47d 100644
--- a/qa/qa/page/project/operations/kubernetes/add_existing.rb
+++ b/qa/qa/page/project/operations/kubernetes/add_existing.rb
@@ -20,7 +20,7 @@ module QA
end
def set_api_url(api_url)
- fill_in 'cluster_platform_kubernetes_attributes_api_url', with: api_url
+ fill_in 'cluster_platform_kubernetes_attributes_api_url', with: QA::Runtime::Env.cluster_api_url || api_url
end
def set_ca_certificate(ca_certificate)
diff --git a/qa/qa/page/project/operations/kubernetes/show.rb b/qa/qa/page/project/operations/kubernetes/show.rb
index e1612718883..3bb51d2d579 100644
--- a/qa/qa/page/project/operations/kubernetes/show.rb
+++ b/qa/qa/page/project/operations/kubernetes/show.rb
@@ -10,7 +10,7 @@ module QA
element :ingress_ip_address, 'id="ingress-endpoint"' # rubocop:disable QA/ElementWithPattern
end
- view 'app/views/clusters/clusters/_gitlab_integration_form.html.haml' do
+ view 'app/assets/javascripts/clusters/forms/components/integration_form.vue' do
element :integration_status_toggle, required: true
element :base_domain_field, required: true
element :save_changes_button, required: true
@@ -56,7 +56,7 @@ module QA
def await_installed(application_name)
within_element(application_name) do
- has_element?(:uninstall_button, application: application_name, wait: 300)
+ has_element?(:uninstall_button, application: application_name, wait: 300, skip_finished_loading_check: true)
end
end
diff --git a/qa/qa/page/project/operations/metrics/show.rb b/qa/qa/page/project/operations/metrics/show.rb
index e9e4923a0e2..22d22af5a9a 100644
--- a/qa/qa/page/project/operations/metrics/show.rb
+++ b/qa/qa/page/project/operations/metrics/show.rb
@@ -18,10 +18,14 @@ module QA
view 'app/assets/javascripts/monitoring/components/dashboard_header.vue' do
element :dashboards_filter_dropdown
element :environments_dropdown
- element :edit_dashboard_button
element :range_picker_dropdown
end
+ view 'app/assets/javascripts/monitoring/components/dashboard_actions_menu.vue' do
+ element :actions_menu_dropdown
+ element :edit_dashboard_button_enabled
+ end
+
view 'app/assets/javascripts/monitoring/components/duplicate_dashboard_form.vue' do
element :duplicate_dashboard_filename_field
end
@@ -54,14 +58,16 @@ module QA
end
def has_edit_dashboard_enabled?
- within_element :prometheus_graphs do
- has_element? :edit_dashboard_button
+ click_element :actions_menu_dropdown
+
+ within_element :actions_menu_dropdown do
+ has_element? :edit_dashboard_button_enabled
end
end
def duplicate_dashboard(save_as = 'test_duplication.yml', commit_option = 'Commit to master branch')
- click_element :dashboards_filter_dropdown
- click_on 'Duplicate dashboard'
+ click_element :actions_menu_dropdown
+ click_on 'Duplicate current dashboard'
fill_element :duplicate_dashboard_filename_field, "#{SecureRandom.hex(8)}-#{save_as}"
choose commit_option
within('.modal-content') { click_button(class: 'btn-success') }
diff --git a/qa/qa/page/project/packages/index.rb b/qa/qa/page/project/packages/index.rb
new file mode 100644
index 00000000000..3f8cc6035bc
--- /dev/null
+++ b/qa/qa/page/project/packages/index.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Packages
+ class Index < QA::Page::Base
+ view 'app/views/projects/packages/packages/_legacy_package_list.html.haml' do
+ element :package_row
+ element :package_link
+ end
+
+ def click_package(name)
+ click_element(:package_link, text: name)
+ end
+
+ def has_package?(name)
+ has_element?(:package_link, text: name)
+ end
+
+ def has_no_package?(name)
+ has_no_element?(:package_link, text: name)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/packages/show.rb b/qa/qa/page/project/packages/show.rb
new file mode 100644
index 00000000000..59e9a3752c7
--- /dev/null
+++ b/qa/qa/page/project/packages/show.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Packages
+ class Show < QA::Page::Base
+ view 'app/assets/javascripts/packages/details/components/app.vue' do
+ element :delete_button
+ element :delete_modal_button
+ element :package_information_content
+ end
+
+ def has_package_info?(name, version)
+ has_element?(:package_information_content, text: /#{name}.*#{version}/)
+ end
+
+ def click_delete
+ click_element(:delete_button)
+ wait_for_animated_element(:delete_modal_button)
+ click_element(:delete_modal_button)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/settings/advanced.rb b/qa/qa/page/project/settings/advanced.rb
index d6e004e827e..960d6c221b5 100644
--- a/qa/qa/page/project/settings/advanced.rb
+++ b/qa/qa/page/project/settings/advanced.rb
@@ -17,6 +17,7 @@ module QA
view 'app/views/projects/settings/_archive.html.haml' do
element :archive_project_link
element :unarchive_project_link
+ element :archive_project_content
end
view 'app/views/projects/_export.html.haml' do
@@ -42,13 +43,19 @@ module QA
end
def transfer_project!(project_name, namespace)
- expand_select_list
- # 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'))
+ # Retry added here due to seldom seen inconsistent UI state issue:
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/231242
+ retry_on_exception do
+ click_element_coordinates(:archive_project_content)
+ expand_select_list
+ # 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'))
+ end
+
click_element(:transfer_button)
fill_confirmation_text(project_name)
- click_confirm_button
+ confirm_transfer
end
def click_export_project_link
diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb
index a7a0f6f57b6..7a910233d12 100644
--- a/qa/qa/page/project/settings/ci_cd.rb
+++ b/qa/qa/page/project/settings/ci_cd.rb
@@ -15,25 +15,25 @@ module QA
end
def expand_general_pipelines(&block)
- expand_section(:general_pipelines_settings_content) do
+ expand_content(:general_pipelines_settings_content) do
Settings::GeneralPipelines.perform(&block)
end
end
def expand_runners_settings(&block)
- expand_section(:runners_settings_content) do
+ expand_content(:runners_settings_content) do
Settings::Runners.perform(&block)
end
end
def expand_ci_variables(&block)
- expand_section(:variables_settings_content) do
+ expand_content(:variables_settings_content) do
Settings::CiVariables.perform(&block)
end
end
def expand_auto_devops(&block)
- expand_section(:autodevops_settings_content) do
+ expand_content(:autodevops_settings_content) do
Settings::AutoDevops.perform(&block)
end
end
diff --git a/qa/qa/page/project/settings/ci_variables.rb b/qa/qa/page/project/settings/ci_variables.rb
index de268b14aa2..aef9800e876 100644
--- a/qa/qa/page/project/settings/ci_variables.rb
+++ b/qa/qa/page/project/settings/ci_variables.rb
@@ -23,7 +23,7 @@ module QA
end
def fill_variable(key, value, masked)
- fill_element :ci_variable_key_field, key
+ within_element(:ci_variable_key_field) { find('input').set key }
fill_element :ci_variable_value_field, value
click_ci_variable_save_button
end
diff --git a/qa/qa/page/project/settings/main.rb b/qa/qa/page/project/settings/main.rb
index 880711770c0..3cd558691e1 100644
--- a/qa/qa/page/project/settings/main.rb
+++ b/qa/qa/page/project/settings/main.rb
@@ -37,19 +37,19 @@ module QA
end
def expand_advanced_settings(&block)
- expand_section(:advanced_settings) do
+ expand_content(:advanced_settings) do
Advanced.perform(&block)
end
end
def expand_merge_requests_settings(&block)
- expand_section(:merge_request_settings) do
+ expand_content(:merge_request_settings) do
MergeRequest.perform(&block)
end
end
def expand_visibility_project_features_permissions(&block)
- expand_section(:visibility_features_permissions_content) do
+ expand_content(:visibility_features_permissions_content) do
VisibilityFeaturesPermissions.perform(&block)
end
end
diff --git a/qa/qa/page/project/settings/operations.rb b/qa/qa/page/project/settings/operations.rb
index b39b8f92cc7..12dcb064807 100644
--- a/qa/qa/page/project/settings/operations.rb
+++ b/qa/qa/page/project/settings/operations.rb
@@ -12,7 +12,7 @@ module QA
end
def expand_incidents(&block)
- expand_section(:incidents_settings_content) do
+ expand_content(:incidents_settings_content) do
Settings::Incidents.perform(&block)
end
end
diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb
index 9d302acb058..7315bfb76a5 100644
--- a/qa/qa/page/project/settings/protected_branches.rb
+++ b/qa/qa/page/project/settings/protected_branches.rb
@@ -17,7 +17,7 @@ module QA
element :allowed_to_merge_dropdown
end
- view 'app/views/projects/protected_branches/_update_protected_branch.html.haml' do
+ view 'app/views/shared/projects/protected_branches/_update_protected_branch.html.haml' do
element :allowed_to_merge
end
diff --git a/qa/qa/page/project/settings/repository.rb b/qa/qa/page/project/settings/repository.rb
index fd3a590c2c1..407c131fa73 100644
--- a/qa/qa/page/project/settings/repository.rb
+++ b/qa/qa/page/project/settings/repository.rb
@@ -8,19 +8,19 @@ module QA
include QA::Page::Settings::Common
view 'app/views/projects/protected_branches/shared/_index.html.haml' do
- element :protected_branches_settings
+ element :protected_branches_settings_content
end
view 'app/views/projects/mirrors/_mirror_repos.html.haml' do
- element :mirroring_repositories_settings_section
+ element :mirroring_repositories_settings_content
end
view 'app/views/shared/deploy_tokens/_index.html.haml' do
- element :deploy_tokens_settings
+ element :deploy_tokens_settings_content
end
view 'app/views/shared/deploy_keys/_index.html.haml' do
- element :deploy_keys_settings
+ element :deploy_keys_settings_content
end
view 'app/views/projects/protected_tags/shared/_index.html.haml' do
@@ -28,31 +28,31 @@ module QA
end
def expand_deploy_tokens(&block)
- expand_section(:deploy_tokens_settings) do
+ expand_content(:deploy_tokens_settings_content) do
Settings::DeployTokens.perform(&block)
end
end
def expand_deploy_keys(&block)
- expand_section(:deploy_keys_settings) do
+ expand_content(:deploy_keys_settings_content) do
Settings::DeployKeys.perform(&block)
end
end
def expand_protected_branches(&block)
- expand_section(:protected_branches_settings) do
+ expand_content(:protected_branches_settings_content) do
ProtectedBranches.perform(&block)
end
end
def expand_mirroring_repositories(&block)
- expand_section(:mirroring_repositories_settings_section) do
+ expand_content(:mirroring_repositories_settings_content) do
MirroringRepositories.perform(&block)
end
end
def expand_protected_tags(&block)
- expand_section(:protected_tag_settings_content) do
+ expand_content(:protected_tag_settings_content) do
ProtectedTags.perform(&block)
end
end
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index 2354a0d9332..22c2ed2a0c2 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -143,6 +143,10 @@ module QA
click_element :web_ide_button
end
+ def has_edit_fork_button?
+ has_element?(:web_ide_button, text: 'Edit fork in Web IDE')
+ end
+
def project_name
find_element(:project_name_content).text
end
diff --git a/qa/qa/page/project/snippet/new.rb b/qa/qa/page/project/snippet/new.rb
index 7431d6c1bf8..47200ba5fda 100644
--- a/qa/qa/page/project/snippet/new.rb
+++ b/qa/qa/page/project/snippet/new.rb
@@ -14,6 +14,7 @@ module QA
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
diff --git a/qa/qa/page/project/sub_menus/operations.rb b/qa/qa/page/project/sub_menus/operations.rb
index ff9c8a21174..042994062c7 100644
--- a/qa/qa/page/project/sub_menus/operations.rb
+++ b/qa/qa/page/project/sub_menus/operations.rb
@@ -17,6 +17,7 @@ module QA
element :operations_link
element :operations_environments_link
element :operations_metrics_link
+ element :operations_incidents_link
end
end
end
@@ -45,6 +46,14 @@ module QA
end
end
+ def go_to_operations_incidents
+ hover_operations do
+ within_submenu do
+ click_element(:operations_incidents_link)
+ end
+ end
+ end
+
private
def hover_operations
diff --git a/qa/qa/page/project/sub_menus/packages.rb b/qa/qa/page/project/sub_menus/packages.rb
new file mode 100644
index 00000000000..9ea045a99f5
--- /dev/null
+++ b/qa/qa/page/project/sub_menus/packages.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module SubMenus
+ module Packages
+ extend QA::Page::PageConcern
+
+ def self.included(base)
+ super
+
+ base.class_eval do
+ view 'app/views/layouts/nav/sidebar/_project_packages_link.html.haml' do
+ element :packages_link
+ end
+ end
+ end
+
+ def click_packages_link
+ within_sidebar do
+ click_element :packages_link
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb
index b46d2d32f1f..b962b0c673b 100644
--- a/qa/qa/page/project/web_ide/edit.rb
+++ b/qa/qa/page/project/web_ide/edit.rb
@@ -59,12 +59,25 @@ module QA
element :rename_move_button
end
+ view 'app/views/shared/_confirm_fork_modal.html.haml' do
+ element :fork_project_button
+ element :confirm_fork_modal
+ end
+
+ view 'app/assets/javascripts/ide/components/ide_project_header.vue' do
+ element :project_path_content
+ end
+
def has_file?(file_name)
within_element(:file_list) do
page.has_content? file_name
end
end
+ def has_project_path?(project_path)
+ has_element?(:project_path_content, project_path: project_path)
+ end
+
def create_new_file_from_template(file_name, template)
click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile)
@@ -91,7 +104,7 @@ module QA
end
end
- def commit_changes
+ def commit_changes(open_merge_request: false)
# Clicking :begin_commit_button switches from the
# edit to the commit view
click_element :begin_commit_button
@@ -107,19 +120,23 @@ module QA
has_element?(:commit_button)
end
- # Click :commit_button and keep retrying just in case part of the
- # animation is still in process even when the buttons have the
- # expected visibility.
- commit_success_msg_shown = retry_until(sleep_interval: 5) do
- click_element(:commit_to_current_branch_radio) if has_element?(:commit_to_current_branch_radio)
- click_element(:commit_button) if has_element?(:commit_button)
-
- wait_until(reload: false) do
- has_text?('Your changes have been committed')
+ if open_merge_request
+ click_element(:commit_button, Page::MergeRequest::New)
+ else
+ # Click :commit_button and keep retrying just in case part of the
+ # animation is still in process even when the buttons have the
+ # expected visibility.
+ commit_success_msg_shown = retry_until(sleep_interval: 5) do
+ click_element(:commit_to_current_branch_radio) if has_element?(:commit_to_current_branch_radio)
+ click_element(:commit_button) if has_element?(:commit_button)
+
+ wait_until(reload: false) do
+ has_text?('Your changes have been committed')
+ end
end
- end
- raise "The changes do not appear to have been committed successfully." unless commit_success_msg_shown
+ raise "The changes do not appear to have been committed successfully." unless commit_success_msg_shown
+ end
end
def add_to_modified_content(content)
@@ -136,12 +153,21 @@ module QA
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
+ def add_file(file_name, file_text)
+ click_element(:new_file, Page::Component::WebIDE::Modal::CreateNewFile)
+ fill_element(:file_name_field, file_name)
+ click_button('Create file')
+ wait_until(reload: false) { has_file?(file_name) }
+ within_element(:editor_container) do
+ find('textarea.inputarea').click.set(file_text)
+ end
+ end
+
def rename_file(file_name, new_file_name)
click_element(:file_name_content, text: file_name)
click_element(:dropdown_button)
@@ -149,6 +175,17 @@ module QA
fill_element(:file_name_field, new_file_name)
click_button('Rename file')
end
+
+ def fork_project!
+ wait_until(reload: false) do
+ has_element?(:confirm_fork_modal)
+ end
+ click_element(:fork_project_button)
+ # wait for the fork to be created
+ wait_until(reload: true) do
+ has_element?(:file_list)
+ end
+ end
end
end
end
diff --git a/qa/qa/page/project/wiki/sidebar.rb b/qa/qa/page/project/wiki/sidebar.rb
index dc27c23e4c3..3e1edcbbefb 100644
--- a/qa/qa/page/project/wiki/sidebar.rb
+++ b/qa/qa/page/project/wiki/sidebar.rb
@@ -18,6 +18,10 @@ module QA
base.view 'app/views/shared/wikis/_sidebar_wiki_page.html.haml' do
element :wiki_page_link
end
+
+ base.view 'app/views/shared/wikis/_wiki_directory.html.haml' do
+ element :wiki_directory_content
+ end
end
def click_clone_repository
@@ -35,6 +39,10 @@ module QA
def has_page_listed?(page_title)
has_element? :wiki_page_link, page_name: page_title
end
+
+ def has_directory?(directory)
+ has_element? :wiki_directory_content, text: directory
+ end
end
end
end