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

wiki.rb « resource « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 45d5da9346d3726894d9b39f4ea6bf24c54aed92 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
# frozen_string_literal: true

module QA
  module Resource
    class Wiki < Base
      attr_accessor :title, :content, :message

      attribute :project do
        Project.fabricate! do |resource|
          resource.name = 'project-for-wikis'
          resource.description = 'project for adding wikis'
        end
      end

      attribute :repository_http_location do
        Page::Project::Wiki::Show.perform(&:click_clone_repository)

        Page::Project::Wiki::GitAccess.perform do |git_access|
          git_access.choose_repository_clone_http
          git_access.repository_location
        end
      end

      attribute :repository_ssh_location do
        Page::Project::Wiki::Show.perform(&:click_clone_repository)

        Page::Project::Wiki::GitAccess.perform do |git_access|
          git_access.choose_repository_clone_ssh
          git_access.repository_location
        end
      end

      def fabricate!
        project.visit!

        Page::Project::Menu.perform { |menu_side| menu_side.click_wiki }

        Page::Project::Wiki::New.perform do |wiki_new|
          wiki_new.click_create_your_first_page_button
          wiki_new.set_title(@title)
          wiki_new.set_content(@content)
          wiki_new.set_message(@message)
          wiki_new.create_new_page
        end
      end
    end
  end
end