ruby_raider 0.4.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -6
- data/README.md +5 -1
- data/Rakefile +2 -2
- data/lib/commands/scaffolding_commands.rb +2 -2
- data/lib/generators/automation_generator.rb +14 -10
- data/lib/generators/cucumber_generator.rb +10 -2
- data/lib/generators/menu_generator.rb +10 -6
- data/lib/generators/rspec_generator.rb +9 -1
- data/lib/generators/templates/automation/abstract_component.tt +2 -0
- data/lib/generators/templates/automation/abstract_page.tt +0 -1
- data/lib/generators/templates/automation/appium_settings.tt +5 -8
- data/lib/generators/templates/automation/component.tt +1 -1
- data/lib/generators/templates/automation/home_page.tt +9 -5
- data/lib/generators/templates/automation/login_page.tt +0 -2
- data/lib/generators/templates/automation/partials/android_settings.tt +8 -0
- data/lib/generators/templates/automation/partials/element.tt +3 -3
- data/lib/generators/templates/automation/partials/initialize_selector.tt +4 -0
- data/lib/generators/templates/automation/partials/ios_settings.tt +8 -0
- data/lib/generators/templates/automation/partials/selenium_login.tt +3 -3
- data/lib/generators/templates/automation/partials/watir_login.tt +3 -3
- data/lib/generators/templates/automation/pdp_page.tt +22 -0
- data/lib/generators/templates/cucumber/feature.tt +9 -0
- data/lib/generators/templates/cucumber/partials/appium_env.tt +7 -5
- data/lib/generators/templates/cucumber/partials/driver_world.tt +1 -0
- data/lib/generators/templates/cucumber/partials/mobile_steps.tt +8 -11
- data/lib/generators/templates/cucumber/partials/watir_world.tt +1 -0
- data/lib/generators/templates/cucumber/partials/web_steps.tt +1 -1
- data/lib/generators/templates/cucumber/world.tt +5 -0
- data/lib/generators/templates/helpers/driver_helper.tt +0 -1
- data/lib/generators/templates/helpers/partials/select_driver.tt +5 -4
- data/lib/generators/templates/rspec/spec.tt +8 -13
- data/ruby_raider.gemspec +2 -1
- data/spec/automation_generator_spec.rb +36 -154
- data/spec/common_generator_spec.rb +27 -112
- data/spec/cucumber_generator_spec.rb +15 -54
- data/spec/helpers_generator_spec.rb +57 -94
- data/spec/rspec_generator_spec.rb +13 -44
- data/spec/scaffolding_commands_spec.rb +162 -0
- data/spec/spec_helper.rb +20 -0
- metadata +23 -5
- data/lib/generators/templates/automation/confirmation_page.tt +0 -19
- data/lib/generators/templates/automation/partials/appium_login.tt +0 -28
- data/spec/scaffolding_spec.rb +0 -234
@@ -4,189 +4,71 @@ require_relative '../lib/generators/automation_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe AutomationGenerator do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@name = 'rspec-selenium'
|
10
|
-
AutomationGenerator.new(['selenium', 'rspec', @name]).invoke_all
|
11
|
-
end
|
12
|
-
|
7
|
+
shared_examples 'creates web automation files' do |name|
|
13
8
|
it 'creates a login page file' do
|
14
|
-
expect(File.exist
|
9
|
+
expect(File).to exist("#{name}/page_objects/pages/login_page.rb")
|
15
10
|
end
|
16
11
|
|
17
12
|
it 'creates an abstract page file' do
|
18
|
-
expect(File.exist
|
13
|
+
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
19
14
|
end
|
20
15
|
|
21
16
|
it 'creates an abstract component file' do
|
22
|
-
expect(File.exist
|
17
|
+
expect(File).to exist("#{name}/page_objects/abstract/abstract_component.rb")
|
23
18
|
end
|
24
19
|
|
25
20
|
it 'creates a component file' do
|
26
|
-
expect(File.exist
|
27
|
-
end
|
28
|
-
|
29
|
-
after(:all) do
|
30
|
-
FileUtils.rm_rf(@name)
|
21
|
+
expect(File).to exist("#{name}/page_objects/components/header_component.rb")
|
31
22
|
end
|
32
23
|
end
|
33
24
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
AutomationGenerator.new(['watir', 'rspec', @name]).invoke_all
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'creates a login page file' do
|
41
|
-
expect(File.exist?("#{@name}/page_objects/pages/login_page.rb")).to be_truthy
|
25
|
+
shared_examples 'creates mobile automation files' do |name|
|
26
|
+
it 'creates a home page file' do
|
27
|
+
expect(File).to exist("#{name}/page_objects/pages/home_page.rb")
|
42
28
|
end
|
43
29
|
|
44
30
|
it 'creates an abstract page file' do
|
45
|
-
expect(File.exist
|
31
|
+
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
46
32
|
end
|
47
33
|
|
48
|
-
it 'creates
|
49
|
-
expect(File.exist
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'creates a component file' do
|
53
|
-
expect(File.exist?("#{@name}/page_objects/components/header_component.rb")).to be_truthy
|
54
|
-
end
|
55
|
-
|
56
|
-
after(:all) do
|
57
|
-
FileUtils.rm_rf(@name)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
context 'with appium' do
|
62
|
-
before(:all) do
|
63
|
-
@name = 'rspec-appium'
|
64
|
-
AutomationGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'creates a login page file' do
|
68
|
-
expect(File.exist?("#{@name}/page_objects/pages/login_page.rb")).to be_truthy
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'creates an abstract page file' do
|
72
|
-
expect(File.exist?("#{@name}/page_objects/abstract/abstract_page.rb")).to be_truthy
|
73
|
-
end
|
74
|
-
|
75
|
-
it "doesn't creates an abstract component file" do
|
76
|
-
expect(File.exist?("#{@name}/page_objects/abstract/abstract_component.rb")).to be_falsey
|
77
|
-
end
|
78
|
-
|
79
|
-
it "doesn't creates a component file" do
|
80
|
-
expect(File.exist?("#{@name}/page_objects/components/header_component.rb")).to be_falsey
|
81
|
-
end
|
82
|
-
|
83
|
-
it 'creates a login page file' do
|
84
|
-
expect(File.exist?("#{@name}/page_objects/pages/home_page.rb")).to be_truthy
|
85
|
-
end
|
86
|
-
|
87
|
-
it 'creates a confirmation page file' do
|
88
|
-
expect(File.exist?("#{@name}/page_objects/pages/confirmation_page.rb")).to be_truthy
|
34
|
+
it 'creates a pdp page file' do
|
35
|
+
expect(File).to exist("#{name}/page_objects/pages/pdp_page.rb")
|
89
36
|
end
|
90
37
|
|
91
38
|
it 'creates an appium config file' do
|
92
|
-
expect(File.exist
|
93
|
-
end
|
94
|
-
|
95
|
-
after(:all) do
|
96
|
-
FileUtils.rm_rf(@name)
|
97
|
-
end
|
98
|
-
|
99
|
-
context 'with cucumber and selenium' do
|
100
|
-
before(:all) do
|
101
|
-
@name = 'cucumber-selenium'
|
102
|
-
AutomationGenerator.new(['selenium', 'cucumber', @name]).invoke_all
|
103
|
-
end
|
104
|
-
|
105
|
-
it 'creates a login page file' do
|
106
|
-
expect(File.exist?("#{@name}/page_objects/pages/login_page.rb")).to be_truthy
|
107
|
-
end
|
108
|
-
|
109
|
-
it 'creates an abstract page file' do
|
110
|
-
expect(File.exist?("#{@name}/page_objects/abstract/abstract_page.rb")).to be_truthy
|
111
|
-
end
|
112
|
-
|
113
|
-
it 'creates an abstract component file' do
|
114
|
-
expect(File.exist?("#{@name}/page_objects/abstract/abstract_component.rb")).to be_truthy
|
115
|
-
end
|
116
|
-
|
117
|
-
it 'creates a component file' do
|
118
|
-
expect(File.exist?("#{@name}/page_objects/components/header_component.rb")).to be_truthy
|
119
|
-
end
|
120
|
-
|
121
|
-
after(:all) do
|
122
|
-
FileUtils.rm_rf(@name)
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
context 'with cucumber and watir' do
|
127
|
-
before(:all) do
|
128
|
-
@name = 'cucumber-watir'
|
129
|
-
AutomationGenerator.new(['watir', 'cucumber', @name]).invoke_all
|
130
|
-
end
|
131
|
-
|
132
|
-
it 'creates a login page file' do
|
133
|
-
expect(File.exist?("#{@name}/page_objects/pages/login_page.rb")).to be_truthy
|
134
|
-
end
|
135
|
-
|
136
|
-
it 'creates an abstract page file' do
|
137
|
-
expect(File.exist?("#{@name}/page_objects/abstract/abstract_page.rb")).to be_truthy
|
138
|
-
end
|
139
|
-
|
140
|
-
it 'creates an abstract component file' do
|
141
|
-
expect(File.exist?("#{@name}/page_objects/abstract/abstract_component.rb")).to be_truthy
|
142
|
-
end
|
143
|
-
|
144
|
-
it 'creates a component file' do
|
145
|
-
expect(File.exist?("#{@name}/page_objects/components/header_component.rb")).to be_truthy
|
146
|
-
end
|
147
|
-
|
148
|
-
after(:all) do
|
149
|
-
FileUtils.rm_rf(@name)
|
150
|
-
end
|
39
|
+
expect(File).to exist("#{name}/appium.txt")
|
151
40
|
end
|
41
|
+
end
|
152
42
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
AutomationGenerator.new(['appium_ios', 'cucumber', @name]).invoke_all
|
157
|
-
end
|
158
|
-
|
159
|
-
it 'creates a login page file' do
|
160
|
-
expect(File.exist?("#{@name}/page_objects/pages/login_page.rb")).to be_truthy
|
161
|
-
end
|
43
|
+
context 'with rspec and selenium' do
|
44
|
+
include_examples 'creates web automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
45
|
+
end
|
162
46
|
|
163
|
-
|
164
|
-
|
165
|
-
|
47
|
+
context 'with rspec and watir' do
|
48
|
+
include_examples 'creates web automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
49
|
+
end
|
166
50
|
|
167
|
-
|
168
|
-
|
169
|
-
|
51
|
+
context 'with cucumber and selenium' do
|
52
|
+
include_examples 'creates web automation files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
53
|
+
end
|
170
54
|
|
171
|
-
|
172
|
-
|
173
|
-
|
55
|
+
context 'with cucumber and watir' do
|
56
|
+
include_examples 'creates web automation files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
57
|
+
end
|
174
58
|
|
175
|
-
|
176
|
-
|
177
|
-
|
59
|
+
context 'with rspec and appium android' do
|
60
|
+
include_examples 'creates mobile automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
61
|
+
end
|
178
62
|
|
179
|
-
|
180
|
-
|
181
|
-
|
63
|
+
context 'with rspec and appium ios' do
|
64
|
+
include_examples 'creates mobile automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
65
|
+
end
|
182
66
|
|
183
|
-
|
184
|
-
|
185
|
-
|
67
|
+
context 'with cucumber and appium android' do
|
68
|
+
include_examples 'creates mobile automation files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
69
|
+
end
|
186
70
|
|
187
|
-
|
188
|
-
|
189
|
-
end
|
190
|
-
end
|
71
|
+
context 'with cucumber and appium ios' do
|
72
|
+
include_examples 'creates mobile automation files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
191
73
|
end
|
192
74
|
end
|
@@ -4,138 +4,53 @@ require_relative '../lib/generators/common_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe CommonGenerator do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@name = 'rspec-selenium'
|
10
|
-
CommonGenerator.new(['selenium', 'rspec', @name]).invoke_all
|
11
|
-
end
|
12
|
-
|
7
|
+
shared_examples 'creates common files' do |name|
|
13
8
|
it 'creates a config file' do
|
14
|
-
expect(File.exist
|
9
|
+
expect(File).to exist("#{name}/config/config.yml")
|
15
10
|
end
|
16
11
|
|
17
12
|
it 'creates a rake file' do
|
18
|
-
expect(File.exist
|
13
|
+
expect(File).to exist("#{name}/Rakefile")
|
19
14
|
end
|
20
15
|
|
21
16
|
it 'creates a readMe file' do
|
22
|
-
expect(File.exist
|
17
|
+
expect(File).to exist("#{name}/Readme.md")
|
23
18
|
end
|
24
19
|
|
25
20
|
it 'creates a gemfile file' do
|
26
|
-
expect(File.exist
|
27
|
-
end
|
28
|
-
|
29
|
-
after(:all) do
|
30
|
-
FileUtils.rm_rf(@name)
|
21
|
+
expect(File).to exist("#{name}/Gemfile")
|
31
22
|
end
|
32
23
|
end
|
33
24
|
|
34
|
-
context 'with
|
35
|
-
|
36
|
-
@name = 'rspec-watir'
|
37
|
-
CommonGenerator.new(['watir', 'rspec', @name]).invoke_all
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'creates a config file' do
|
41
|
-
expect(File.exist?("#{@name}/config/config.yml")).to be_truthy
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'creates a rake file' do
|
45
|
-
expect(File.exist?("#{@name}/Rakefile")).to be_truthy
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'creates a readMe file' do
|
49
|
-
expect(File.exist?("#{@name}/Readme.md")).to be_truthy
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'creates a gemfile file' do
|
53
|
-
expect(File.exist?("#{@name}/Gemfile")).to be_truthy
|
54
|
-
end
|
55
|
-
|
56
|
-
after(:all) do
|
57
|
-
FileUtils.rm_rf(@name)
|
58
|
-
end
|
25
|
+
context 'with rspec and selenium' do
|
26
|
+
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
59
27
|
end
|
60
28
|
|
61
|
-
context 'with
|
62
|
-
|
63
|
-
|
64
|
-
CommonGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'creates a config file' do
|
68
|
-
expect(File.exist?("#{@name}/config/config.yml")).to be_truthy
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'creates a rake file' do
|
72
|
-
expect(File.exist?("#{@name}/Rakefile")).to be_truthy
|
73
|
-
end
|
74
|
-
|
75
|
-
it 'creates a readMe file' do
|
76
|
-
expect(File.exist?("#{@name}/Readme.md")).to be_truthy
|
77
|
-
end
|
78
|
-
|
79
|
-
it 'creates a gemfile file' do
|
80
|
-
expect(File.exist?("#{@name}/Gemfile")).to be_truthy
|
81
|
-
end
|
82
|
-
|
83
|
-
after(:all) do
|
84
|
-
FileUtils.rm_rf(@name)
|
85
|
-
end
|
86
|
-
|
87
|
-
context 'with cucumber and selenium' do
|
88
|
-
before(:all) do
|
89
|
-
@name = 'cucumber-selenium'
|
90
|
-
CommonGenerator.new(['selenium', 'cucumber', @name]).invoke_all
|
91
|
-
end
|
92
|
-
|
93
|
-
it 'creates a config file' do
|
94
|
-
expect(File.exist?("#{@name}/config/config.yml")).to be_truthy
|
95
|
-
end
|
96
|
-
|
97
|
-
it 'creates a rake file' do
|
98
|
-
expect(File.exist?("#{@name}/Rakefile")).to be_truthy
|
99
|
-
end
|
100
|
-
|
101
|
-
it 'creates a readMe file' do
|
102
|
-
expect(File.exist?("#{@name}/Readme.md")).to be_truthy
|
103
|
-
end
|
104
|
-
|
105
|
-
it 'creates a gemfile file' do
|
106
|
-
expect(File.exist?("#{@name}/Gemfile")).to be_truthy
|
107
|
-
end
|
108
|
-
|
109
|
-
after(:all) do
|
110
|
-
FileUtils.rm_rf(@name)
|
111
|
-
end
|
112
|
-
end
|
29
|
+
context 'with rspec and watir' do
|
30
|
+
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
31
|
+
end
|
113
32
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
CommonGenerator.new(['watir', 'cucumber', @name]).invoke_all
|
118
|
-
end
|
33
|
+
context 'with cucumber and selenium' do
|
34
|
+
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
35
|
+
end
|
119
36
|
|
120
|
-
|
121
|
-
|
122
|
-
|
37
|
+
context 'with cucumber and watir' do
|
38
|
+
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
39
|
+
end
|
123
40
|
|
124
|
-
|
125
|
-
|
126
|
-
|
41
|
+
context 'with rspec and appium android' do
|
42
|
+
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
43
|
+
end
|
127
44
|
|
128
|
-
|
129
|
-
|
130
|
-
|
45
|
+
context 'with rspec and appium ios' do
|
46
|
+
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
47
|
+
end
|
131
48
|
|
132
|
-
|
133
|
-
|
134
|
-
|
49
|
+
context 'with cucumber and appium android' do
|
50
|
+
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
51
|
+
end
|
135
52
|
|
136
|
-
|
137
|
-
|
138
|
-
end
|
139
|
-
end
|
53
|
+
context 'with cucumber and appium ios' do
|
54
|
+
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
140
55
|
end
|
141
56
|
end
|
@@ -4,76 +4,37 @@ require_relative '../lib/generators/cucumber_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe CucumberGenerator do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@name = 'cucumber-selenium'
|
10
|
-
CucumberGenerator.new(['selenium', 'cucumber', @name]).invoke_all
|
11
|
-
end
|
12
|
-
|
7
|
+
shared_examples 'creates cucumber files' do |project_name, file_name|
|
13
8
|
it 'creates a feature file' do
|
14
|
-
expect(File.exist
|
9
|
+
expect(File).to exist("#{project_name}/features/#{file_name}.feature")
|
15
10
|
end
|
16
11
|
|
17
12
|
it 'creates a step definitions file' do
|
18
|
-
expect(File.exist
|
13
|
+
expect(File).to exist("#{project_name}/features/step_definitions/#{file_name}_steps.rb")
|
19
14
|
end
|
20
15
|
|
21
16
|
it 'creates an env file' do
|
22
|
-
expect(File.exist
|
17
|
+
expect(File).to exist("#{project_name}/features/support/env.rb")
|
23
18
|
end
|
24
19
|
|
25
20
|
it 'does not create a spec file' do
|
26
|
-
expect(File.exist
|
27
|
-
end
|
28
|
-
|
29
|
-
after(:all) do
|
30
|
-
FileUtils.rm_rf(@name)
|
21
|
+
expect(File).not_to exist("#{project_name}/spec/home_spec.rb")
|
31
22
|
end
|
32
23
|
end
|
33
24
|
|
34
|
-
context 'with
|
35
|
-
|
36
|
-
@name = 'cucumber-watir'
|
37
|
-
CucumberGenerator.new(['watir', 'cucumber', @name]).invoke_all
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'creates a feature file' do
|
41
|
-
expect(File.exist?("#{@name}/features/login.feature")).to be_truthy
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'creates a step definitions file' do
|
45
|
-
expect(File.exist?("#{@name}/features/step_definitions/login_steps.rb")).to be_truthy
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'creates an env file' do
|
49
|
-
expect(File.exist?("#{@name}/features/support/env.rb")).to be_truthy
|
50
|
-
end
|
51
|
-
|
52
|
-
after(:all) do
|
53
|
-
FileUtils.rm_rf(@name)
|
54
|
-
end
|
25
|
+
context 'with cucumber and appium android' do
|
26
|
+
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}", 'home'
|
55
27
|
end
|
56
28
|
|
57
|
-
context 'with appium' do
|
58
|
-
|
59
|
-
|
60
|
-
CucumberGenerator.new(['appium_ios', 'cucumber', @name]).invoke_all
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'creates a feature file' do
|
64
|
-
expect(File.exist?("#{@name}/features/login.feature")).to be_truthy
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'creates a step definitions file' do
|
68
|
-
expect(File.exist?("#{@name}/features/step_definitions/login_steps.rb")).to be_truthy
|
69
|
-
end
|
29
|
+
context 'with cucumber and appium ios' do
|
30
|
+
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}", 'home'
|
31
|
+
end
|
70
32
|
|
71
|
-
|
72
|
-
|
73
|
-
|
33
|
+
context 'with cucumber and selenium' do
|
34
|
+
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}", 'login'
|
35
|
+
end
|
74
36
|
|
75
|
-
|
76
|
-
|
77
|
-
end
|
37
|
+
context 'with cucumber and watir' do
|
38
|
+
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}", 'login'
|
78
39
|
end
|
79
40
|
end
|
@@ -4,122 +4,85 @@ require_relative '../lib/generators/helper_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe HelpersGenerator do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@name = 'rspec-selenium'
|
10
|
-
HelpersGenerator.new(['selenium', 'rspec', @name]).invoke_all
|
11
|
-
end
|
12
|
-
|
7
|
+
shared_examples 'creates common helpers' do |name|
|
13
8
|
it 'creates a raider file' do
|
14
|
-
expect(File.exist
|
9
|
+
expect(File).to exist("#{name}/helpers/raider.rb")
|
15
10
|
end
|
16
11
|
|
17
12
|
it 'creates an allure helper file' do
|
18
|
-
expect(File.exist
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'creates a driver helper file', :watir do
|
22
|
-
expect(File.exist?("#{@name}/helpers/driver_helper.rb")).to be_truthy
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'creates a spec helper file' do
|
26
|
-
expect(File.exist?("#{@name}/helpers/spec_helper.rb")).to be_truthy
|
27
|
-
end
|
28
|
-
|
29
|
-
after(:all) do
|
30
|
-
FileUtils.rm_rf(@name)
|
13
|
+
expect(File).to exist("#{name}/helpers/allure_helper.rb")
|
31
14
|
end
|
32
15
|
end
|
33
16
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
HelpersGenerator.new(['watir', 'rspec', @name]).invoke_all
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'creates a browser helper file', :watir do
|
41
|
-
expect(File.exist?("#{@name}/helpers/browser_helper.rb")).to be_truthy
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'creates a raider file' do
|
45
|
-
expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'creates an allure helper file' do
|
49
|
-
expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
|
50
|
-
end
|
51
|
-
|
52
|
-
after(:all) do
|
53
|
-
FileUtils.rm_rf(@name)
|
17
|
+
shared_examples 'creates selenium helpers' do |name|
|
18
|
+
it 'creates a driver helper file' do
|
19
|
+
expect(File).to exist("#{name}/helpers/driver_helper.rb")
|
54
20
|
end
|
55
21
|
end
|
56
22
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
HelpersGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'creates a raider file' do
|
64
|
-
expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'creates an allure helper file' do
|
68
|
-
expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
|
23
|
+
shared_examples 'creates watir helpers' do |name|
|
24
|
+
it 'creates a browser helper file' do
|
25
|
+
expect(File).to exist("#{name}/helpers/browser_helper.rb")
|
69
26
|
end
|
27
|
+
end
|
70
28
|
|
71
|
-
|
72
|
-
|
29
|
+
shared_examples 'creates rspec helpers' do |name|
|
30
|
+
it 'creates a spec helper file' do
|
31
|
+
expect(File).to exist("#{name}/helpers/spec_helper.rb")
|
73
32
|
end
|
33
|
+
end
|
74
34
|
|
75
|
-
|
76
|
-
|
35
|
+
shared_examples 'creates cucumber helpers' do |name|
|
36
|
+
it 'does not create a spec helper' do
|
37
|
+
expect(File).not_to exist("#{name}/helpers/spec_helper.rb")
|
77
38
|
end
|
39
|
+
end
|
78
40
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
it 'creates an allure helper file' do
|
86
|
-
expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'creates a driver helper file', :watir do
|
90
|
-
expect(File.exist?("#{@name}/helpers/driver_helper.rb")).to be_truthy
|
91
|
-
end
|
41
|
+
context 'with rspec and selenium' do
|
42
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
43
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
44
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
45
|
+
end
|
92
46
|
|
93
|
-
|
94
|
-
|
95
|
-
|
47
|
+
context 'with rspec and watir' do
|
48
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
49
|
+
include_examples 'creates watir helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
50
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
51
|
+
end
|
96
52
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
53
|
+
context 'with cucumber and selenium' do
|
54
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
55
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
56
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
57
|
+
end
|
101
58
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
59
|
+
context 'with cucumber and watir' do
|
60
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
61
|
+
include_examples 'creates watir helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
62
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
63
|
+
end
|
107
64
|
|
108
|
-
|
109
|
-
|
110
|
-
|
65
|
+
context 'with rspec and appium android' do
|
66
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
67
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
68
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
69
|
+
end
|
111
70
|
|
112
|
-
|
113
|
-
|
114
|
-
|
71
|
+
context 'with rspec and appium ios' do
|
72
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
73
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
74
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
75
|
+
end
|
115
76
|
|
116
|
-
|
117
|
-
|
118
|
-
|
77
|
+
context 'with cucumber and appium android' do
|
78
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
79
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
80
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
81
|
+
end
|
119
82
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
83
|
+
context 'with cucumber and appium ios' do
|
84
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
85
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
86
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
124
87
|
end
|
125
88
|
end
|