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

import_project.rb « resource « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a490905cbd6423aee8b3f5386cf1d10c41ca154d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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(Runtime::Path.fixtures_path, '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