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>2021-06-24 00:08:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-24 00:08:33 +0300
commit87e9d9675af5df4c703c502b79567baea24f5395 (patch)
tree09e2f7fa5332f3ad8011d7f610c61dd90408067d /qa
parentd04f2be14dc23606353acf9b1bbc6326e40d7f4b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb6
-rw-r--r--qa/qa/fixtures/export.tar.gzbin0 -> 176411 bytes
-rw-r--r--qa/qa/page/component/import/gitlab.rb40
-rw-r--r--qa/qa/page/component/import/selection.rb23
-rw-r--r--qa/qa/page/project/new.rb4
-rw-r--r--qa/qa/resource/import_project.rb35
-rw-r--r--qa/qa/resource/merge_request.rb13
-rw-r--r--qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb24
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb2
-rw-r--r--qa/qa/specs/runner.rb2
10 files changed, 135 insertions, 14 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 2258d04dc0e..0b2157da265 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -107,6 +107,7 @@ module QA
autoload :RegistryRepository, 'qa/resource/registry_repository'
autoload :Package, 'qa/resource/package'
autoload :PipelineSchedules, 'qa/resource/pipeline_schedules'
+ autoload :ImportProject, 'qa/resource/import_project'
module KubernetesCluster
autoload :Base, 'qa/resource/kubernetes_cluster/base'
@@ -530,6 +531,11 @@ module QA
autoload :CommitModal, 'qa/page/component/commit_modal'
autoload :VisibilitySetting, 'qa/page/component/visibility_setting'
+ module Import
+ autoload :Gitlab, 'qa/page/component/import/gitlab'
+ autoload :Selection, 'qa/page/component/import/selection'
+ end
+
module Issuable
autoload :Common, 'qa/page/component/issuable/common'
autoload :Sidebar, 'qa/page/component/issuable/sidebar'
diff --git a/qa/qa/fixtures/export.tar.gz b/qa/qa/fixtures/export.tar.gz
new file mode 100644
index 00000000000..107037a9562
--- /dev/null
+++ b/qa/qa/fixtures/export.tar.gz
Binary files differ
diff --git a/qa/qa/page/component/import/gitlab.rb b/qa/qa/page/component/import/gitlab.rb
new file mode 100644
index 00000000000..2fd2a45b399
--- /dev/null
+++ b/qa/qa/page/component/import/gitlab.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module Import
+ module Gitlab
+ def self.included(base)
+ super
+
+ base.view 'app/views/import/gitlab_projects/new.html.haml' do
+ element :import_project_button
+ end
+
+ base.view 'app/views/import/shared/_new_project_form.html.haml' do
+ element :project_name_field
+ element :project_slug_field
+ end
+ end
+
+ def set_imported_project_name(name)
+ fill_element(:project_name_field, name)
+ end
+
+ def attach_exported_file(path)
+ page.attach_file("file", path, make_visible: { display: 'block' })
+ end
+
+ def click_import_gitlab_project
+ click_element(:import_project_button)
+
+ wait_until(reload: false) do
+ has_notice?("The project was successfully imported.")
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/component/import/selection.rb b/qa/qa/page/component/import/selection.rb
new file mode 100644
index 00000000000..6cacdd84f13
--- /dev/null
+++ b/qa/qa/page/component/import/selection.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Component
+ module Import
+ module Selection
+ def self.included(base)
+ super
+
+ base.view 'app/views/projects/_import_project_pane.html.haml' do
+ element :gitlab_import_button
+ end
+ end
+
+ def click_gitlab
+ click_element(:gitlab_import_button)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb
index 6e5da450def..d3c06119efc 100644
--- a/qa/qa/page/project/new.rb
+++ b/qa/qa/page/project/new.rb
@@ -8,6 +8,10 @@ module QA
include Page::Component::Select2
include Page::Component::VisibilitySetting
+ include Layout::Flash
+ include Page::Component::Import::Selection
+ include Page::Component::Import::Gitlab
+
view 'app/views/projects/_new_project_fields.html.haml' do
element :initialize_with_readme_checkbox
element :project_namespace_select
diff --git a/qa/qa/resource/import_project.rb b/qa/qa/resource/import_project.rb
new file mode 100644
index 00000000000..105d75285f1
--- /dev/null
+++ b/qa/qa/resource/import_project.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+module QA
+ module Resource
+ class ImportProject < Resource::Project
+ attr_writer :file_path
+
+ def initialize
+ @name = "ImportedProject-#{SecureRandom.hex(8)}"
+ @file_path = ::File.join('qa', 'fixtures', 'export.tar.gz')
+ end
+
+ def fabricate!
+ self.import = true
+ super
+
+ group.visit!
+
+ Page::Group::Show.perform(&:go_to_new_project)
+
+ Page::Project::New.perform do |new_project|
+ new_project.click_import_project
+ new_project.click_gitlab
+ new_project.set_imported_project_name(@name)
+ new_project.attach_exported_file(@file_path)
+ new_project.click_import_gitlab_project
+ end
+ end
+
+ def fabricate_via_api!
+ raise NotImplementedError
+ end
+ end
+ end
+end
diff --git a/qa/qa/resource/merge_request.rb b/qa/qa/resource/merge_request.rb
index 0bd29d03cb5..d9703eb889e 100644
--- a/qa/qa/resource/merge_request.rb
+++ b/qa/qa/resource/merge_request.rb
@@ -70,6 +70,8 @@ module QA
end
def fabricate!
+ return fabricate_large_merge_request if Runtime::Scenario.large_setup?
+
populate_target_and_source_if_required
project.visit!
@@ -90,6 +92,8 @@ module QA
end
def fabricate_via_api!
+ return fabricate_large_merge_request if Runtime::Scenario.large_setup?
+
resource_web_url(api_get)
rescue ResourceNotFoundError, NoValueError # rescue if iid not populated
populate_target_and_source_if_required
@@ -144,6 +148,15 @@ module QA
end
end
+ def fabricate_large_merge_request
+ @project = Resource::ImportProject.fabricate_via_browser_ui!
+ # Setting the name here, since otherwise some tests will look for an existing file in
+ # the proejct without ever knowing what is in it.
+ @file_name = "LICENSE"
+ visit("#{project.web_url}/-/merge_requests/1")
+ current_url
+ end
+
# Get MR comments
#
# @return [Array]
diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb
index 636cdadd5b6..1a12558e174 100644
--- a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb
+++ b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb
@@ -61,19 +61,17 @@ module QA
def verify_labels_import
labels = imported_project.labels.map { |label| label.slice(:name, :color) }
- expect(labels).to eq(
- [
- { name: 'bug', color: '#d73a4a' },
- { name: 'custom new label', color: '#fc8f91' },
- { name: 'documentation', color: '#0075ca' },
- { name: 'duplicate', color: '#cfd3d7' },
- { name: 'enhancement', color: '#a2eeef' },
- { name: 'good first issue', color: '#7057ff' },
- { name: 'help wanted', color: '#008672' },
- { name: 'invalid', color: '#e4e669' },
- { name: 'question', color: '#d876e3' },
- { name: 'wontfix', color: '#ffffff' }
- ]
+ expect(labels).to include(
+ { name: 'bug', color: '#d73a4a' },
+ { name: 'custom new label', color: '#fc8f91' },
+ { name: 'documentation', color: '#0075ca' },
+ { name: 'duplicate', color: '#cfd3d7' },
+ { name: 'enhancement', color: '#a2eeef' },
+ { name: 'good first issue', color: '#7057ff' },
+ { name: 'help wanted', color: '#008672' },
+ { name: 'invalid', color: '#e4e669' },
+ { name: 'question', color: '#d876e3' },
+ { name: 'wontfix', color: '#ffffff' }
)
end
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb
index 3574cdbe4ac..c05a3610b99 100644
--- a/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb
@@ -19,7 +19,7 @@ module QA
Flow::Login.sign_in
end
- it 'can be reverted', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1745' do
+ it 'can be reverted', :can_use_large_setup, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1745' do
revertable_merge_request.visit!
Page::MergeRequest::Show.perform do |merge_request|
diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb
index ff690962db8..bd9907611c7 100644
--- a/qa/qa/specs/runner.rb
+++ b/qa/qa/specs/runner.rb
@@ -65,6 +65,8 @@ module QA
args.push(DEFAULT_TEST_PATH_ARGS) unless options.any? { |opt| opt =~ %r{/features/} }
end
+ Runtime::Scenario.define(:large_setup?, args.flatten.include?('can_use_large_setup'))
+
if Runtime::Scenario.attributes[:parallel]
ParallelRunner.run(args.flatten)
elsif Runtime::Scenario.attributes[:loop]