ruby_raider 3.10.0 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/reek.yml +5 -1
- data/.github/workflows/release.yml +2 -1
- data/.github/workflows/system_tests.yml +1 -1
- data/.reek.yml +13 -0
- data/README.md +44 -4
- data/lib/commands/utility_commands.rb +1 -1
- data/lib/generators/automation/automation_generator.rb +15 -10
- data/lib/generators/automation/templates/appium_caps.tt +2 -4
- data/lib/generators/automation/templates/home.tt +1 -2
- data/lib/generators/automation/templates/login.tt +6 -6
- data/lib/generators/automation/templates/page.tt +10 -3
- data/lib/generators/automation/templates/partials/home_page_selector.tt +4 -6
- data/lib/generators/automation/templates/partials/pdp_page_selector.tt +4 -6
- data/lib/generators/automation/templates/pdp.tt +3 -2
- data/lib/generators/cucumber/cucumber_generator.rb +15 -2
- data/lib/generators/cucumber/templates/feature.tt +5 -0
- data/lib/generators/cucumber/templates/partials/driver_world.tt +9 -0
- data/lib/generators/cucumber/templates/partials/mobile_steps.tt +1 -1
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +20 -0
- data/lib/generators/cucumber/templates/partials/watir_env.tt +16 -0
- data/lib/generators/cucumber/templates/partials/web_steps.tt +8 -0
- data/lib/generators/generator.rb +15 -4
- data/lib/generators/helper_generator.rb +15 -0
- data/lib/generators/invoke_generators.rb +23 -0
- data/lib/generators/menu_generator.rb +26 -14
- data/lib/generators/rspec/rspec_generator.rb +10 -3
- data/lib/generators/rspec/templates/spec.tt +27 -1
- data/lib/generators/template_renderer/template_error.rb +8 -8
- data/lib/generators/templates/common/git_ignore.tt +4 -1
- data/lib/generators/templates/common/partials/mobile_config.tt +1 -0
- data/lib/generators/templates/common/partials/web_config.tt +5 -2
- data/lib/generators/templates/common/read_me.tt +508 -0
- data/lib/generators/templates/helpers/partials/selenium_driver.tt +1 -3
- data/lib/generators/templates/helpers/raider_element.tt +159 -0
- data/lib/generators/templates/helpers/session_state.tt +246 -0
- data/lib/generators/templates/helpers/spec_helper.tt +28 -0
- data/lib/generators/templates/helpers/wait_helper.tt +470 -0
- data/lib/ruby_raider/ffmpeg.rb +7 -7
- data/lib/ruby_raider.rb +2 -0
- data/lib/scaffolding/project_detector.rb +6 -0
- data/lib/scaffolding/scaffolding.rb +4 -0
- data/lib/scaffolding/templates/component.tt +4 -0
- data/lib/scaffolding/templates/page_object.tt +8 -0
- data/lib/version +1 -1
- data/ruby_raider.gemspec +1 -0
- data/sig/generators/generator.rbs +2 -0
- data/sig/scaffolding/project_detector.rbs +1 -0
- data/sig/scaffolding/scaffolding.rbs +1 -0
- data/spec/commands/raider_commands_spec.rb +24 -0
- data/spec/fixtures/watir_master/cucumber_watir/Readme.md.snapshot +175 -0
- data/spec/fixtures/watir_master/cucumber_watir/features/step_definitions/login_steps.rb.snapshot +24 -0
- data/spec/fixtures/watir_master/cucumber_watir/page_objects/abstract/page.rb.snapshot +39 -0
- data/spec/fixtures/watir_master/cucumber_watir/page_objects/pages/login.rb.snapshot +33 -0
- data/spec/fixtures/watir_master/rspec_watir/Readme.md.snapshot +174 -0
- data/spec/fixtures/watir_master/rspec_watir/page_objects/abstract/page.rb.snapshot +39 -0
- data/spec/fixtures/watir_master/rspec_watir/page_objects/pages/login.rb.snapshot +33 -0
- data/spec/fixtures/watir_master/rspec_watir/spec/login_page_spec.rb.snapshot +49 -0
- data/spec/integration/commands/scaffolding_commands_spec.rb +49 -0
- data/spec/integration/commands/utility_commands_spec.rb +8 -0
- data/spec/integration/content/azure_content_spec.rb +4 -0
- data/spec/integration/content/ci_content_spec.rb +11 -0
- data/spec/integration/content/common_content_spec.rb +27 -0
- data/spec/integration/content/config_content_spec.rb +62 -0
- data/spec/integration/content/cucumber_reporter_content_spec.rb +25 -0
- data/spec/integration/content/helper_content_spec.rb +111 -0
- data/spec/integration/content/page_content_spec.rb +75 -4
- data/spec/integration/content/readme_content_spec.rb +149 -0
- data/spec/integration/content/syntax_validation_spec.rb +38 -0
- data/spec/integration/content/test_content_spec.rb +82 -0
- data/spec/integration/end_to_end_spec.rb +73 -28
- data/spec/integration/generators/automation_generator_spec.rb +50 -0
- data/spec/integration/generators/common_generator_spec.rb +20 -0
- data/spec/integration/generators/config_features_spec.rb +2 -2
- data/spec/integration/generators/cucumber_generator_spec.rb +36 -0
- data/spec/integration/generators/helpers_generator_spec.rb +60 -0
- data/spec/integration/generators/invoke_generators_spec.rb +70 -0
- data/spec/integration/generators/rspec_generator_spec.rb +20 -0
- data/spec/integration/helpers/session_state_spec.rb +474 -0
- data/spec/integration/helpers/wait_helper_mobile_spec.rb +281 -0
- data/spec/integration/helpers/wait_helper_spec.rb +496 -0
- data/spec/integration/helpers/wait_helper_support.rb +183 -0
- data/spec/integration/settings_helper.rb +4 -1
- data/spec/integration/spec_helper.rb +2 -2
- data/spec/menus/menu_generator_spec.rb +64 -2
- data/spec/scaffolding/scaffold_project_detector_spec.rb +12 -0
- metadata +31 -2
|
@@ -28,8 +28,8 @@ module LazyProjectGenerator
|
|
|
28
28
|
GENERATED = Set.new
|
|
29
29
|
MUTEX = Mutex.new
|
|
30
30
|
|
|
31
|
-
def ensure_project(framework:, automation:)
|
|
32
|
-
settings = create_settings(framework:, automation:)
|
|
31
|
+
def ensure_project(framework:, automation:, examples: true)
|
|
32
|
+
settings = create_settings(framework:, automation:, examples:)
|
|
33
33
|
project_name = settings[:name]
|
|
34
34
|
|
|
35
35
|
MUTEX.synchronize do
|
|
@@ -21,8 +21,9 @@ RSpec.describe MenuGenerator do
|
|
|
21
21
|
|
|
22
22
|
expect(menu).to have_received(:choice).with(:Selenium, anything)
|
|
23
23
|
expect(menu).to have_received(:choice).with(:Appium, anything)
|
|
24
|
-
expect(menu).to have_received(:choice).with(:Watir, anything)
|
|
25
24
|
expect(menu).to have_received(:choice).with(:Quit, anything)
|
|
25
|
+
expect(menu).not_to have_received(:choice).with(:Watir, anything)
|
|
26
|
+
expect(menu).to have_received(:choice).exactly(3).times
|
|
26
27
|
end
|
|
27
28
|
end
|
|
28
29
|
|
|
@@ -186,7 +187,7 @@ RSpec.describe MenuGenerator do
|
|
|
186
187
|
|
|
187
188
|
menu_generator.send(:select_accessibility, 'Rspec', 'selenium')
|
|
188
189
|
|
|
189
|
-
expect(menu_generator).to have_received(:select_ci).with('Rspec', 'selenium', accessibility: false)
|
|
190
|
+
expect(menu_generator).to have_received(:select_ci).with('Rspec', 'selenium', accessibility: false, examples: true)
|
|
190
191
|
end
|
|
191
192
|
|
|
192
193
|
it 'is skipped for mobile' do
|
|
@@ -206,4 +207,65 @@ RSpec.describe MenuGenerator do
|
|
|
206
207
|
)
|
|
207
208
|
end
|
|
208
209
|
end
|
|
210
|
+
|
|
211
|
+
describe 'example tests question' do
|
|
212
|
+
let(:menu) { double('menu') } # rubocop:disable RSpec/VerifiedDoubles
|
|
213
|
+
|
|
214
|
+
before do
|
|
215
|
+
allow(menu).to receive(:choice)
|
|
216
|
+
allow(menu_generator).to receive(:generate_framework)
|
|
217
|
+
allow(menu_generator).to receive(:system)
|
|
218
|
+
allow(prompt).to receive(:say)
|
|
219
|
+
allow(prompt).to receive(:yes?).and_return(false)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
it 'is asked after the test framework question' do
|
|
223
|
+
allow(prompt).to receive(:select).with('Please select your test framework').and_yield(menu)
|
|
224
|
+
allow(menu).to receive(:choice).with(:Rspec, anything) { |_, action| action.call }
|
|
225
|
+
allow(menu_generator).to receive(:select_examples)
|
|
226
|
+
|
|
227
|
+
menu_generator.choose_test_framework('selenium')
|
|
228
|
+
|
|
229
|
+
expect(menu_generator).to have_received(:select_examples).with('Rspec', 'selenium')
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
it 'offers Yes first, so yes is the default' do
|
|
233
|
+
allow(prompt).to receive(:select).with('Do you want example tests?').and_yield(menu)
|
|
234
|
+
allow(menu).to receive(:choice).with(:Yes, anything) { |_, action| action.call }
|
|
235
|
+
allow(menu_generator).to receive(:select_accessibility)
|
|
236
|
+
|
|
237
|
+
menu_generator.send(:select_examples, 'Rspec', 'selenium')
|
|
238
|
+
|
|
239
|
+
expect(menu).to have_received(:choice).with(:Yes, anything).ordered
|
|
240
|
+
expect(menu).to have_received(:choice).with(:No, anything).ordered
|
|
241
|
+
expect(menu).to have_received(:choice).with(:Quit, anything).ordered
|
|
242
|
+
expect(menu_generator).to have_received(:select_accessibility).with('Rspec', 'selenium', examples: true)
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
it 'carries No through to generate_framework as examples: false' do
|
|
246
|
+
allow(prompt).to receive(:select).with('Do you want example tests?').and_yield(menu)
|
|
247
|
+
allow(menu).to receive(:choice).with(:No, anything) { |_, action| action.call }
|
|
248
|
+
allow(prompt).to receive(:select).with('Add accessibility testing (axe)?').and_yield(menu)
|
|
249
|
+
allow(menu).to receive(:choice).with(:No, anything) { |_, action| action.call }
|
|
250
|
+
allow(prompt).to receive(:select).with('Which CI provider?').and_yield(menu)
|
|
251
|
+
allow(menu).to receive(:choice).with('GitHub Actions', anything) { |_, action| action.call }
|
|
252
|
+
|
|
253
|
+
menu_generator.send(:select_examples, 'Rspec', 'selenium')
|
|
254
|
+
|
|
255
|
+
expect(menu_generator).to have_received(:generate_framework).with(
|
|
256
|
+
hash_including(automation: 'selenium', framework: 'rspec', examples: false)
|
|
257
|
+
)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
it 'carries No through for mobile, which has no accessibility question' do
|
|
261
|
+
allow(prompt).to receive(:select).with('Do you want example tests?').and_yield(menu)
|
|
262
|
+
allow(menu).to receive(:choice).with(:No, anything) { |_, action| action.call }
|
|
263
|
+
|
|
264
|
+
menu_generator.send(:select_examples, 'Cucumber', 'ios')
|
|
265
|
+
|
|
266
|
+
expect(menu_generator).to have_received(:generate_framework).with(
|
|
267
|
+
hash_including(automation: 'ios', framework: 'cucumber', examples: false)
|
|
268
|
+
)
|
|
269
|
+
end
|
|
270
|
+
end
|
|
209
271
|
end
|
|
@@ -84,6 +84,18 @@ RSpec.describe ScaffoldProjectDetector do
|
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
+
describe '.wait_helper?' do
|
|
88
|
+
it 'is true when helpers/wait_helper.rb exists' do
|
|
89
|
+
FileUtils.mkdir_p('helpers')
|
|
90
|
+
File.write('helpers/wait_helper.rb', "# frozen_string_literal: true\n")
|
|
91
|
+
expect(described_class.wait_helper?).to be true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it 'is false when the file does not exist' do
|
|
95
|
+
expect(described_class.wait_helper?).to be false
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
87
99
|
describe '.config' do
|
|
88
100
|
it 'returns empty hash when config missing' do
|
|
89
101
|
expect(described_class.config).to eq({})
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_raider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Agustin Pequeno
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler-audit
|
|
@@ -122,6 +122,20 @@ dependencies:
|
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '3.1'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: selenium-webdriver
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '4.0'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '4.0'
|
|
125
139
|
- !ruby/object:Gem::Dependency
|
|
126
140
|
name: steep
|
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -275,8 +289,11 @@ files:
|
|
|
275
289
|
- lib/generators/templates/helpers/partials/quit_driver.tt
|
|
276
290
|
- lib/generators/templates/helpers/partials/screenshot.tt
|
|
277
291
|
- lib/generators/templates/helpers/partials/selenium_driver.tt
|
|
292
|
+
- lib/generators/templates/helpers/raider_element.tt
|
|
293
|
+
- lib/generators/templates/helpers/session_state.tt
|
|
278
294
|
- lib/generators/templates/helpers/spec_helper.tt
|
|
279
295
|
- lib/generators/templates/helpers/video_helper.tt
|
|
296
|
+
- lib/generators/templates/helpers/wait_helper.tt
|
|
280
297
|
- lib/ruby_raider.rb
|
|
281
298
|
- lib/ruby_raider/ffmpeg.rb
|
|
282
299
|
- lib/scaffolding/name_normalizer.rb
|
|
@@ -324,6 +341,14 @@ files:
|
|
|
324
341
|
- sig/vendor/tty_prompt.rbs
|
|
325
342
|
- spec/commands/raider_commands_spec.rb
|
|
326
343
|
- spec/commands/scaffolding_commands_spec.rb
|
|
344
|
+
- spec/fixtures/watir_master/cucumber_watir/Readme.md.snapshot
|
|
345
|
+
- spec/fixtures/watir_master/cucumber_watir/features/step_definitions/login_steps.rb.snapshot
|
|
346
|
+
- spec/fixtures/watir_master/cucumber_watir/page_objects/abstract/page.rb.snapshot
|
|
347
|
+
- spec/fixtures/watir_master/cucumber_watir/page_objects/pages/login.rb.snapshot
|
|
348
|
+
- spec/fixtures/watir_master/rspec_watir/Readme.md.snapshot
|
|
349
|
+
- spec/fixtures/watir_master/rspec_watir/page_objects/abstract/page.rb.snapshot
|
|
350
|
+
- spec/fixtures/watir_master/rspec_watir/page_objects/pages/login.rb.snapshot
|
|
351
|
+
- spec/fixtures/watir_master/rspec_watir/spec/login_page_spec.rb.snapshot
|
|
327
352
|
- spec/generators/fixtures/templates/test.tt
|
|
328
353
|
- spec/generators/fixtures/templates/test_partial.tt
|
|
329
354
|
- spec/generators/fixtures/video_helper_stubs/selenium-webdriver.rb
|
|
@@ -357,6 +382,10 @@ files:
|
|
|
357
382
|
- spec/integration/generators/helpers_generator_spec.rb
|
|
358
383
|
- spec/integration/generators/invoke_generators_spec.rb
|
|
359
384
|
- spec/integration/generators/rspec_generator_spec.rb
|
|
385
|
+
- spec/integration/helpers/session_state_spec.rb
|
|
386
|
+
- spec/integration/helpers/wait_helper_mobile_spec.rb
|
|
387
|
+
- spec/integration/helpers/wait_helper_spec.rb
|
|
388
|
+
- spec/integration/helpers/wait_helper_support.rb
|
|
360
389
|
- spec/integration/scaffolding_e2e_spec.rb
|
|
361
390
|
- spec/integration/settings_helper.rb
|
|
362
391
|
- spec/integration/spec_helper.rb
|