summaryrefslogtreecommitdiff
path: root/qa/qa/resource/wiki.rb
blob: 0a776f22e25577e4ee040f2a1244011f951c9589 (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
# 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

      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