Class: ReadMeTemplate

Inherits:
Template show all
Defined in:
lib/generators/templates/common/read_me_template.rb

Instance Method Summary collapse

Methods inherited from Template

#initialize, #parsed_body

Constructor Details

This class inherits a constructor from Template

Instance Method Details

#bodyObject



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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/generators/templates/common/read_me_template.rb', line 4

def body
  "        What is Raider?\n        ===========\n\n        Raider is a tool to make the setup and start of automation projects in ruby easier, with one command you are\n        ready to go\n\n        # Pre-requisites:\n\n        Install RVM:\n        https://rvm.io/rvm/install\n\n        # How to use the framework:\n\n        If you want to run all the tests from your terminal do:\n        *rspec spec/*\n\n        If you want to run all the tests in parallel do:\n        *parallel_rspec spec/*\n\n        # How are specs organized:\n\n        We use 'context' as the highest grouping level to indicate in which part of the application we are as an example:\n\n        *context 'On the login page'/*\n\n        We use 'describe' from the user perspective to describe an action that the user can or cannot take:\n\n        *describe 'A user can'/*\n\n        or\n\n        *describe 'A user cannot'/*\n\n        This saves us repetition and forces us into an structure\n\n        At last we use 'it' for the specific action the user can or cannot perform:\n\n        it 'login with right credentials'\n\n        If we group all of this together it will look like\n\n        ```ruby\n        context 'On the login page' do\n          describe 'A user can' do\n            it 'login with the right credentials' do\n            end\n        \#{'   '}\n          end\n        \#{'  '}\n          describe 'A user cannot' do\n            it 'login with the wrong credentials' do\n            end\n          end\n        end\n        ```\n        \#{'    '}\n        This is readed as 'On the login page a user can login with the right credentials' and 'On the login page a user cannot login with the wrong credentials'\n\n        # How pages are organized:\n\n        ```ruby\#{' '}\n        require_relative '../abstract/base_page'\n\n        class MainPage < BasePage\n\n          using Raider::WatirHelper\n\n          def url(_page)\n            '/'\n          end\n\n          # Actions\n\n          def change_currency(currency)\n            currency_dropdown.select currency\n          end\n\n          # Validations\n\n          def validate_currency(currency)\n            expect(currency_dropdown.include?(currency)).to be true\n          end\n\n          private\n\n          # Elements\n\n          def currency_dropdown\n            browser.select(class: %w[dropdown-menu currency])\n          end\n        end\n        ```\n\n        Pages are organized in Actions (things a user can perform on the page), Validations (assertions), and Elements.\n        Each page has to have a url define, and each page is using the module WatirHelper to add methods on runtime to the Watir elements\n\n  EOF\nend\n"