ruby_raider 3.13.0 → 4.0.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.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/runtime.yml +38 -0
  3. data/.github/workflows/system_tests.yml +1 -23
  4. data/.reek.yml +1 -0
  5. data/.rspec +1 -0
  6. data/Gemfile +2 -0
  7. data/README.md +16 -49
  8. data/RELEASE.md +22 -0
  9. data/bin/raider +5 -0
  10. data/lib/commands/scaffolding_commands.rb +2 -25
  11. data/lib/commands/utility_commands.rb +23 -3
  12. data/lib/generators/automation/automation_generator.rb +0 -5
  13. data/lib/generators/automation/templates/component.tt +1 -0
  14. data/lib/generators/automation/templates/home.tt +2 -2
  15. data/lib/generators/automation/templates/login.tt +6 -26
  16. data/lib/generators/automation/templates/page.tt +23 -18
  17. data/lib/generators/automation/templates/partials/home_page_selector.tt +1 -2
  18. data/lib/generators/automation/templates/partials/initialize_selector.tt +0 -8
  19. data/lib/generators/automation/templates/partials/pdp_page_selector.tt +1 -2
  20. data/lib/generators/automation/templates/partials/url_methods.tt +8 -2
  21. data/lib/generators/automation/templates/partials/visit_method.tt +0 -5
  22. data/lib/generators/automation/templates/pdp.tt +1 -9
  23. data/lib/generators/common_generator.rb +0 -2
  24. data/lib/generators/generator.rb +12 -19
  25. data/lib/generators/helper_generator.rb +21 -19
  26. data/lib/generators/infrastructure/templates/azure_pipelines.tt +1 -1
  27. data/lib/generators/infrastructure/templates/github.tt +2 -3
  28. data/lib/generators/infrastructure/templates/github_appium.tt +0 -8
  29. data/lib/generators/invoke_generators.rb +4 -23
  30. data/lib/generators/menu_generator.rb +1 -9
  31. data/lib/generators/rspec/templates/accessibility_spec.tt +1 -9
  32. data/lib/generators/rspec/templates/spec.tt +8 -24
  33. data/lib/generators/template_renderer/partial_cache.rb +3 -1
  34. data/lib/generators/template_renderer.rb +1 -1
  35. data/lib/generators/templates/common/gemfile.tt +3 -10
  36. data/lib/generators/templates/common/git_ignore.tt +0 -5
  37. data/lib/generators/templates/common/partials/mobile_config.tt +3 -1
  38. data/lib/generators/templates/common/partials/web_config.tt +10 -1
  39. data/lib/generators/templates/common/rakefile.tt +0 -15
  40. data/lib/generators/templates/common/read_me.tt +357 -250
  41. data/lib/generators/templates/common/rubocop.tt +0 -2
  42. data/lib/generators/templates/helpers/driver_helper.tt +8 -0
  43. data/lib/generators/templates/helpers/gesture_helper.tt +78 -0
  44. data/lib/generators/templates/helpers/network_helper.tt +521 -0
  45. data/lib/generators/templates/helpers/partials/quit_driver.tt +0 -2
  46. data/lib/generators/templates/helpers/partials/screenshot.tt +0 -2
  47. data/lib/generators/templates/helpers/partials/selenium_driver.tt +5 -2
  48. data/lib/generators/templates/helpers/screenshot_helper.tt +490 -0
  49. data/lib/generators/templates/helpers/spec_helper.tt +39 -29
  50. data/lib/generators/templates/helpers/trace_helper.tt +240 -95
  51. data/lib/generators/templates/helpers/video_helper.tt +3 -8
  52. data/lib/ruby_raider/runtime/actionability.rb +129 -0
  53. data/lib/ruby_raider/runtime/actionable.rb +49 -0
  54. data/lib/ruby_raider/runtime/by_role.rb +55 -0
  55. data/lib/ruby_raider/runtime/config.rb +79 -0
  56. data/lib/ruby_raider/runtime/context.rb +38 -0
  57. data/lib/ruby_raider/runtime/errors.rb +69 -0
  58. data/lib/ruby_raider/runtime/finders.rb +73 -0
  59. data/lib/ruby_raider/runtime/js/actionability.js +134 -0
  60. data/lib/ruby_raider/runtime/js/role_engine.js +315 -0
  61. data/lib/ruby_raider/runtime/locator_converter.rb +72 -0
  62. data/lib/ruby_raider/runtime/matchers/base.rb +222 -0
  63. data/lib/ruby_raider/runtime/matchers/element.rb +183 -0
  64. data/lib/ruby_raider/runtime/matchers/page.rb +71 -0
  65. data/lib/ruby_raider/runtime/matchers/presence.rb +41 -0
  66. data/lib/ruby_raider/runtime/matchers/retrying_block.rb +104 -0
  67. data/lib/ruby_raider/runtime/observer.rb +170 -0
  68. data/lib/ruby_raider/runtime/role_finder.rb +83 -0
  69. data/lib/ruby_raider/runtime/rspec.rb +78 -0
  70. data/lib/ruby_raider/runtime/selectors.rb +60 -0
  71. data/lib/ruby_raider/runtime/strict.rb +142 -0
  72. data/lib/ruby_raider/runtime/wait.rb +84 -0
  73. data/lib/ruby_raider/runtime.rb +20 -0
  74. data/lib/scaffolding/name_normalizer.rb +1 -1
  75. data/lib/scaffolding/project_detector.rb +2 -28
  76. data/lib/scaffolding/scaffolding.rb +0 -20
  77. data/lib/scaffolding/templates/component.tt +0 -14
  78. data/lib/scaffolding/templates/page_object.tt +2 -14
  79. data/lib/scaffolding/templates/spec.tt +1 -9
  80. data/lib/utilities/utilities.rb +10 -8
  81. data/lib/version +1 -1
  82. data/ruby_raider.gemspec +2 -1
  83. data/sig/commands/scaffolding_commands.rbs +0 -2
  84. data/sig/commands/utility_commands.rbs +6 -0
  85. data/sig/generators/generator.rbs +0 -4
  86. data/sig/generators/helper_generator.rbs +0 -1
  87. data/sig/generators/menu_generator.rbs +0 -1
  88. data/sig/ruby_raider/runtime/actionability.rbs +25 -0
  89. data/sig/ruby_raider/runtime/actionable.rbs +13 -0
  90. data/sig/ruby_raider/runtime/by_role.rbs +15 -0
  91. data/sig/ruby_raider/runtime/config.rbs +26 -0
  92. data/sig/ruby_raider/runtime/context.rbs +12 -0
  93. data/sig/ruby_raider/runtime/errors.rbs +36 -0
  94. data/sig/ruby_raider/runtime/finders.rbs +26 -0
  95. data/sig/ruby_raider/runtime/locator_converter.rbs +21 -0
  96. data/sig/ruby_raider/runtime/matchers/base.rbs +64 -0
  97. data/sig/ruby_raider/runtime/matchers/element.rbs +78 -0
  98. data/sig/ruby_raider/runtime/matchers/page.rbs +38 -0
  99. data/sig/ruby_raider/runtime/matchers/presence.rbs +21 -0
  100. data/sig/ruby_raider/runtime/matchers/retrying_block.rbs +27 -0
  101. data/sig/ruby_raider/runtime/observer.rbs +46 -0
  102. data/sig/ruby_raider/runtime/role_finder.rbs +18 -0
  103. data/sig/ruby_raider/runtime/selectors.rbs +21 -0
  104. data/sig/ruby_raider/runtime/strict.rbs +35 -0
  105. data/sig/ruby_raider/runtime/wait.rbs +17 -0
  106. data/sig/ruby_raider/runtime.rbs +2 -0
  107. data/sig/scaffolding/project_detector.rbs +0 -4
  108. data/sig/scaffolding/scaffolding.rbs +0 -5
  109. data/sig/utilities/utilities.rbs +2 -1
  110. data/sig/vendor/selenium_webdriver.rbs +71 -0
  111. data/spec/commands/raider_commands_spec.rb +38 -3
  112. data/spec/commands/scaffolding_commands_spec.rb +27 -0
  113. data/spec/commands/utility_commands_spec.rb +53 -0
  114. data/spec/generators/gesture_helper_spec.rb +123 -0
  115. data/spec/generators/network_helper_spec.rb +634 -0
  116. data/spec/generators/screenshot_helper_spec.rb +776 -0
  117. data/spec/generators/template_renderer_spec.rb +0 -4
  118. data/spec/generators/trace_helper_spec.rb +489 -97
  119. data/spec/generators/video_helper_spec.rb +0 -9
  120. data/spec/integration/commands/browser_update_after_creation_spec.rb +0 -8
  121. data/spec/integration/commands/scaffolding_commands_spec.rb +12 -70
  122. data/spec/integration/commands/utility_commands_spec.rb +19 -41
  123. data/spec/integration/content/azure_content_spec.rb +2 -6
  124. data/spec/integration/content/ci_content_spec.rb +1 -55
  125. data/spec/integration/content/common_content_spec.rb +1 -118
  126. data/spec/integration/content/config_content_spec.rb +34 -31
  127. data/spec/integration/content/gemfile_content_spec.rb +7 -72
  128. data/spec/integration/content/helper_content_spec.rb +105 -99
  129. data/spec/integration/content/page_content_spec.rb +85 -87
  130. data/spec/integration/content/readme_content_spec.rb +134 -75
  131. data/spec/integration/content/rspec_reporter_content_spec.rb +2 -2
  132. data/spec/integration/content/rubocop_content_spec.rb +1 -1
  133. data/spec/integration/content/syntax_validation_spec.rb +2 -2
  134. data/spec/integration/content/test_content_spec.rb +23 -147
  135. data/spec/integration/end_to_end_features_spec.rb +1 -43
  136. data/spec/integration/end_to_end_spec.rb +319 -326
  137. data/spec/integration/generators/automation_generator_spec.rb +3 -37
  138. data/spec/integration/generators/axe_addon_spec.rb +2 -35
  139. data/spec/integration/generators/azure_generator_spec.rb +1 -1
  140. data/spec/integration/generators/common_generator_spec.rb +1 -40
  141. data/spec/integration/generators/config_features_spec.rb +1 -24
  142. data/spec/integration/generators/github_generator_spec.rb +0 -12
  143. data/spec/integration/generators/helpers_generator_spec.rb +74 -80
  144. data/spec/integration/generators/invoke_generators_spec.rb +54 -45
  145. data/spec/integration/generators/rspec_generator_spec.rb +0 -6
  146. data/spec/integration/scaffolding_e2e_spec.rb +17 -179
  147. data/spec/integration/spec_helper.rb +4 -6
  148. data/spec/integration/trace_format_checker.rb +11 -2
  149. data/spec/integration/trace_page_server.rb +72 -5
  150. data/spec/menus/menu_generator_spec.rb +14 -39
  151. data/spec/runtime/actionability_spec.rb +207 -0
  152. data/spec/runtime/actionable_spec.rb +125 -0
  153. data/spec/runtime/browser/actionability_script_browser_spec.rb +150 -0
  154. data/spec/runtime/browser/actionable_browser_spec.rb +98 -0
  155. data/spec/runtime/browser/finders_browser_spec.rb +148 -0
  156. data/spec/runtime/browser/matchers_browser_spec.rb +67 -0
  157. data/spec/runtime/browser/retrying_block_browser_spec.rb +37 -0
  158. data/spec/runtime/browser/role_engine_browser_spec.rb +184 -0
  159. data/spec/runtime/browser/strict_browser_spec.rb +38 -0
  160. data/spec/runtime/by_role_spec.rb +52 -0
  161. data/spec/runtime/config_spec.rb +79 -0
  162. data/spec/runtime/context_spec.rb +73 -0
  163. data/spec/runtime/errors_spec.rb +89 -0
  164. data/spec/runtime/finders_spec.rb +165 -0
  165. data/spec/runtime/fixtures/actionability.html +70 -0
  166. data/spec/runtime/fixtures/locators.html +46 -0
  167. data/spec/runtime/fixtures/matchers.html +33 -0
  168. data/spec/runtime/fixtures/roles.html +162 -0
  169. data/spec/runtime/matchers/base_spec.rb +165 -0
  170. data/spec/runtime/matchers/element_spec.rb +277 -0
  171. data/spec/runtime/matchers/page_spec.rb +102 -0
  172. data/spec/runtime/matchers/presence_spec.rb +59 -0
  173. data/spec/runtime/matchers/retrying_block_spec.rb +165 -0
  174. data/spec/runtime/observer_spec.rb +341 -0
  175. data/spec/runtime/role_finder_spec.rb +156 -0
  176. data/spec/runtime/role_query_spec.rb +75 -0
  177. data/spec/runtime/selectors_spec.rb +135 -0
  178. data/spec/runtime/strict_spec.rb +257 -0
  179. data/spec/runtime/support/browser.rb +48 -0
  180. data/spec/runtime/support/fake_bridge.rb +117 -0
  181. data/spec/runtime/wait_spec.rb +71 -0
  182. data/spec/scaffolding/name_normalizer_spec.rb +3 -2
  183. data/spec/scaffolding/scaffold_project_detector_spec.rb +4 -43
  184. data/spec/system/selenium_spec.rb +1 -5
  185. data/spec/system/support/system_test_helper.rb +2 -5
  186. data/spec/utilities/headless_config_spec.rb +0 -7
  187. data/spec/utilities/utilities_spec.rb +24 -0
  188. metadata +113 -48
  189. data/lib/generators/automation/templates/header.tt +0 -9
  190. data/lib/generators/cucumber/cucumber_generator.rb +0 -58
  191. data/lib/generators/cucumber/templates/accessibility_feature.tt +0 -5
  192. data/lib/generators/cucumber/templates/accessibility_steps.tt +0 -17
  193. data/lib/generators/cucumber/templates/cucumber.tt +0 -1
  194. data/lib/generators/cucumber/templates/env.tt +0 -7
  195. data/lib/generators/cucumber/templates/feature.tt +0 -21
  196. data/lib/generators/cucumber/templates/partials/appium_env.tt +0 -26
  197. data/lib/generators/cucumber/templates/partials/driver_world.tt +0 -18
  198. data/lib/generators/cucumber/templates/partials/mobile_steps.tt +0 -20
  199. data/lib/generators/cucumber/templates/partials/selenium_env.tt +0 -120
  200. data/lib/generators/cucumber/templates/partials/watir_env.tt +0 -48
  201. data/lib/generators/cucumber/templates/partials/watir_world.tt +0 -4
  202. data/lib/generators/cucumber/templates/partials/web_steps.tt +0 -28
  203. data/lib/generators/cucumber/templates/steps.tt +0 -5
  204. data/lib/generators/cucumber/templates/user_factory.tt +0 -15
  205. data/lib/generators/cucumber/templates/world.tt +0 -7
  206. data/lib/generators/templates/helpers/browser_helper.tt +0 -31
  207. data/lib/generators/templates/helpers/raider_element.tt +0 -159
  208. data/lib/generators/templates/helpers/wait_helper.tt +0 -611
  209. data/lib/scaffolding/templates/feature.tt +0 -6
  210. data/lib/scaffolding/templates/steps.tt +0 -19
  211. data/sig/generators/cucumber/cucumber_generator.rbs +0 -12
  212. data/spec/fixtures/watir_master/cucumber_watir/Readme.md.snapshot +0 -175
  213. data/spec/fixtures/watir_master/cucumber_watir/features/step_definitions/login_steps.rb.snapshot +0 -24
  214. data/spec/fixtures/watir_master/cucumber_watir/page_objects/abstract/page.rb.snapshot +0 -37
  215. data/spec/fixtures/watir_master/cucumber_watir/page_objects/pages/login.rb.snapshot +0 -33
  216. data/spec/fixtures/watir_master/rspec_watir/Readme.md.snapshot +0 -174
  217. data/spec/fixtures/watir_master/rspec_watir/page_objects/abstract/page.rb.snapshot +0 -37
  218. data/spec/fixtures/watir_master/rspec_watir/page_objects/pages/login.rb.snapshot +0 -33
  219. data/spec/fixtures/watir_master/rspec_watir/spec/login_page_spec.rb.snapshot +0 -49
  220. data/spec/integration/content/cucumber_reporter_content_spec.rb +0 -161
  221. data/spec/integration/generators/cucumber_generator_spec.rb +0 -100
  222. data/spec/integration/helpers/wait_helper_mobile_spec.rb +0 -281
  223. data/spec/integration/helpers/wait_helper_spec.rb +0 -679
  224. data/spec/integration/helpers/wait_helper_support.rb +0 -183
  225. data/spec/system/watir_spec.rb +0 -38
@@ -55,67 +55,6 @@ describe 'Test file content' do
55
55
  end
56
56
  end
57
57
 
58
- shared_examples 'watir rspec spec' do |project_name|
59
- subject(:spec) { read_generated(project_name, 'spec/login_page_spec.rb') }
60
-
61
- it 'instantiates Login with browser' do
62
- expect(spec).to include('Login.new(browser)')
63
- end
64
-
65
- it 'uses visit method' do
66
- expect(spec).to include('.visit')
67
- expect(spec).not_to include('.visit_page')
68
- end
69
- end
70
-
71
- # --- Cucumber features and steps ---
72
-
73
- shared_examples 'valid cucumber feature' do |project_name|
74
- subject(:feature) { read_generated(project_name, 'features/login.feature') }
75
-
76
- it 'has Feature keyword' do
77
- expect(feature).to match(/Feature:/)
78
- end
79
-
80
- it 'has Scenario keyword' do
81
- expect(feature).to match(/Scenario:/)
82
- end
83
-
84
- it 'has Given/When/Then steps' do
85
- expect(feature).to match(/Given/)
86
- expect(feature).to match(/When/)
87
- expect(feature).to match(/Then/)
88
- end
89
- end
90
-
91
- shared_examples 'valid cucumber env' do |project_name|
92
- subject(:env) { read_generated(project_name, 'features/support/env.rb') }
93
-
94
- it 'has valid Ruby syntax' do
95
- expect(env).to have_valid_ruby_syntax
96
- end
97
- end
98
-
99
- shared_examples 'valid cucumber world' do |project_name|
100
- subject(:world) { read_generated(project_name, 'features/support/world.rb') }
101
-
102
- it 'has valid Ruby syntax' do
103
- expect(world).to have_valid_ruby_syntax
104
- end
105
- end
106
-
107
- shared_examples 'valid cucumber config' do |project_name|
108
- subject(:config) { read_generated(project_name, 'cucumber.yml') }
109
-
110
- it 'has default profile' do
111
- expect(config).to include('default:')
112
- end
113
-
114
- it 'uses the pretty and rerun formatters, with the reporter activated from env.rb' do
115
- expect(config.strip).to eq('default: --format pretty --format rerun --out rerun.txt --publish-quiet --retry 0')
116
- end
117
- end
118
-
119
58
  shared_examples 'logged in example' do |project_name|
120
59
  it 'adds a :logged_in example that reuses the saved login and keeps the login example' do
121
60
  spec = read_generated(project_name, 'spec/login_page_spec.rb')
@@ -124,19 +63,6 @@ describe 'Test file content' do
124
63
  end
125
64
  end
126
65
 
127
- shared_examples 'logged in scenario' do |project_name|
128
- it 'adds a @logged_in scenario and keeps the login scenario' do
129
- feature = read_generated(project_name, 'features/login.feature')
130
- expect(feature).to include("@logged_in\nScenario: A logged-in user opens the account page",
131
- "Given I'm a registered user\n", 'Scenario: A user can login')
132
- end
133
-
134
- it 'defines the step that picks the user without logging in' do
135
- steps = read_generated(project_name, 'features/step_definitions/login_steps.rb')
136
- expect(steps).to include(%q(Given("I'm a {user}") do |user|))
137
- end
138
- end
139
-
140
66
  # --- RSpec contexts ---
141
67
 
142
68
  context 'with rspec and selenium' do
@@ -145,91 +71,41 @@ describe 'Test file content' do
145
71
  include_examples 'selenium rspec spec', name
146
72
  include_examples 'logged in example', name
147
73
  end
148
-
149
- context 'with rspec and watir' do
150
- name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
151
- include_examples 'valid rspec spec', name
152
- include_examples 'watir rspec spec', name
153
- include_examples 'logged in example', name
154
- end
155
-
156
- # --- Cucumber contexts ---
157
-
158
- context 'with cucumber and selenium' do
159
- name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
160
- include_examples 'valid cucumber feature', name
161
- include_examples 'valid cucumber env', name
162
- include_examples 'valid cucumber world', name
163
- include_examples 'valid cucumber config', name
164
- include_examples 'logged in scenario', name
165
- end
166
-
167
- context 'with cucumber and watir' do
168
- name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
169
- include_examples 'valid cucumber feature', name
170
- include_examples 'valid cucumber env', name
171
- include_examples 'valid cucumber world', name
172
- include_examples 'valid cucumber config', name
173
- include_examples 'logged in scenario', name
174
- end
175
74
  end
176
75
 
177
- describe 'Cucumber world WaitHelper wiring' do
178
- %w[selenium ios android cross_platform].each do |automation|
179
- it "makes WaitHelper available to steps in #{automation}" do
180
- world = read_generated("cucumber_#{automation}", 'features/support/world.rb')
181
- expect(world).to include("require_relative '../../helpers/wait_helper'", 'World(WaitHelper)')
182
- end
183
- end
184
-
185
- it 'leaves the watir world without WaitHelper' do
186
- expect(read_generated('cucumber_watir', 'features/support/world.rb')).not_to include('WaitHelper')
76
+ describe 'Accessibility spec' do
77
+ it 'wraps the axe check in an immediate find' do
78
+ name = 'content_axe_rspec_selenium'
79
+ InvokeGenerators.generate_framework(automation: 'selenium', framework: 'rspec', name:, accessibility: true)
80
+ expect(read_generated(name, 'spec/accessibility_spec.rb'))
81
+ .to include('Raider::Wait.immediately { expect(driver).to be_axe_clean }')
82
+ ensure
83
+ FileUtils.rm_rf(name)
187
84
  end
188
85
  end
189
86
 
190
- describe 'Example tests on the wait helper' do
191
- it 'wraps every assertion of the selenium rspec spec in eventually' do
87
+ describe 'Example tests' do
88
+ it 'asserts the selenium rspec spec with have_text and no eventually' do
192
89
  spec = read_generated('rspec_selenium', 'spec/login_page_spec.rb')
193
- expect(spec.scan('eventually { expect(').size).to eq(3)
194
- expect(spec.scan(/^ +expect\(/)).to be_empty
195
- end
196
-
197
- it "wraps the selenium cucumber Then step's assertion in eventually" do
198
- steps = read_generated('cucumber_selenium', 'features/step_definitions/login_steps.rb')
199
- expect(steps).to include('eventually { expect(account_page.header.customer_name).to eq ')
90
+ expect(spec.scan('expect { account_page.welcome_message }.to have_text("Welcome back #{user[\'name\']}")').size).to eq(2)
91
+ expect(spec).to include("expect { login_page.welcome_message }.to have_text('Login or register')")
92
+ expect(spec).not_to include('eventually')
200
93
  end
201
94
 
202
95
  %w[ios android cross_platform].each do |automation|
203
- it "wraps the #{automation} rspec assertion in eventually" do
96
+ it "asserts the #{automation} rspec spec with have_text and no eventually" do
204
97
  spec = read_generated("rspec_#{automation}", 'spec/pdp_page_spec.rb')
205
- expect(spec).to include("eventually { expect(pdp_page.add_to_cart_text).to eq 'Add to Cart' }")
98
+ expect(spec).to include("expect { pdp_page.add_to_cart_button }.to have_text('Add to Cart')")
99
+ expect(spec).not_to include('eventually')
206
100
  end
207
101
 
208
- it "wraps the #{automation} cucumber Then step's assertion in eventually" do
209
- steps = read_generated("cucumber_#{automation}", 'features/step_definitions/home_steps.rb')
210
- expect(steps).to include("eventually { expect(pdp_page.add_to_cart_text).to eq 'Add to Cart' }")
211
- end
212
- end
213
- end
214
-
215
- # The Watir output must stay as master generated it (1274a66), plus the 3.12.1 lint fixes; the snapshots in
216
- # spec/fixtures/watir_master were generated from that commit's lib.
217
- # To regenerate: `git archive 1274a66 lib` into a scratch dir, generate rspec and cucumber Watir projects there,
218
- # then apply only the Readme deprecation-line delta (the `> **Deprecated:**` line under the heading block) and
219
- # the 3.12.1 changes: RuboCop lint fixes (page.rb loses its extra blank lines, login_steps.rb ends with a newline)
220
- # plus the frozen_string_literal comments the syntax spec requires (Style/FrozenStringLiteralComment is disabled
221
- # in the generated .rubocop.yml, so RuboCop does not ask for them) on the Watir page, world and user_factory files.
222
- describe 'Watir example output' do
223
- snapshots = File.expand_path('../../fixtures/watir_master', __dir__)
224
-
225
- { 'rspec_watir' => %w[page_objects/pages/login.rb page_objects/abstract/page.rb spec/login_page_spec.rb Readme.md],
226
- 'cucumber_watir' => %w[page_objects/pages/login.rb page_objects/abstract/page.rb
227
- features/step_definitions/login_steps.rb Readme.md] }.each do |project, files|
228
- files.each do |file|
229
- it "keeps #{project}/#{file} as master generates it" do
230
- expected = File.read(File.join(snapshots, project, "#{file}.snapshot"))
231
- expect(read_generated(project, file)).to eq(expected)
232
- end
102
+ it "writes the #{automation} page objects in plain Appium" do
103
+ home = read_generated("rspec_#{automation}", 'page_objects/pages/home.rb')
104
+ pdp = read_generated("rspec_#{automation}", 'page_objects/pages/pdp.rb')
105
+ expect(home).to include('first_product.click')
106
+ expect(home).not_to match(/\btap\(/)
107
+ expect(pdp).to include('def add_to_cart_button').and match(/\b(driver\.find_element|element)\(/)
108
+ expect(pdp).not_to include('add_to_cart_text')
233
109
  end
234
110
  end
235
111
  end
@@ -117,18 +117,12 @@ describe 'End-to-End Feature Validation' do
117
117
  expect(helper).to include('config.verbose_retry = true')
118
118
  expect(helper).to include("ENV.fetch('RETRY_COUNT', 0)")
119
119
  end
120
-
121
- it 'cucumber projects have --retry in cucumber.yml' do
122
- cucumber_yml = read_generated("#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}", 'cucumber.yml')
123
- expect(cucumber_yml).to include('--retry')
124
- end
125
120
  end
126
121
 
127
122
  # --- Feature: Tag-based rake tasks (C5) ---
128
123
 
129
124
  context 'Tag-based rake tasks' do
130
125
  let(:rspec_project) { "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}" }
131
- let(:cucumber_project) { "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}" }
132
126
 
133
127
  it 'rspec Rakefile has smoke task' do
134
128
  rakefile = read_generated(rspec_project, 'Rakefile')
@@ -142,11 +136,6 @@ describe 'End-to-End Feature Validation' do
142
136
  expect(rakefile).to include("'--tag regression'")
143
137
  end
144
138
 
145
- it 'cucumber Rakefile has smoke task with cucumber tags' do
146
- rakefile = read_generated(cucumber_project, 'Rakefile')
147
- expect(rakefile).to include("'--tags @smoke'")
148
- end
149
-
150
139
  it 'rspec smoke rake task works', :slow do
151
140
  skip 'Bundle install needed' unless bundle_install(rspec_project)
152
141
 
@@ -159,7 +148,6 @@ describe 'End-to-End Feature Validation' do
159
148
 
160
149
  context 'Re-run failed tests' do
161
150
  let(:rspec_project) { "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}" }
162
- let(:cucumber_project) { "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}" }
163
151
 
164
152
  it 'rspec projects have .rspec file' do
165
153
  expect(File).to exist("#{rspec_project}/.rspec")
@@ -179,10 +167,6 @@ describe 'End-to-End Feature Validation' do
179
167
  gitignore = read_generated(rspec_project, '.gitignore')
180
168
  expect(gitignore).to include('spec/examples.txt')
181
169
  end
182
-
183
- it 'cucumber projects do not have .rspec file' do
184
- expect(File).not_to exist("#{cucumber_project}/.rspec")
185
- end
186
170
  end
187
171
 
188
172
  # --- Feature: Accessibility addon (axe) ---
@@ -193,14 +177,10 @@ describe 'End-to-End Feature Validation' do
193
177
  automation: 'selenium', framework: 'rspec', name: 'e2e_axe_rspec',
194
178
  accessibility: true
195
179
  )
196
- InvokeGenerators.generate_framework(
197
- automation: 'selenium', framework: 'cucumber', name: 'e2e_axe_cucumber',
198
- accessibility: true
199
- )
200
180
  end
201
181
 
202
182
  after(:all) do # rubocop:disable RSpec/BeforeAfterAll
203
- %w[e2e_axe_rspec e2e_axe_cucumber].each { |n| FileUtils.rm_rf(n) }
183
+ FileUtils.rm_rf('e2e_axe_rspec')
204
184
  end
205
185
 
206
186
  describe 'axe + RSpec' do
@@ -220,28 +200,6 @@ describe 'End-to-End Feature Validation' do
220
200
  expect { RubyVM::InstructionSequence.compile(content) }.not_to raise_error
221
201
  end
222
202
  end
223
-
224
- describe 'axe + Cucumber' do
225
- it 'creates accessibility.feature' do
226
- expect(File).to exist('e2e_axe_cucumber/features/accessibility.feature')
227
- end
228
-
229
- it 'creates accessibility_steps.rb' do
230
- expect(File).to exist('e2e_axe_cucumber/features/step_definitions/accessibility_steps.rb')
231
- end
232
-
233
- it 'includes axe gems in Gemfile' do
234
- gemfile = File.read('e2e_axe_cucumber/Gemfile')
235
- expect(gemfile).to include('axe')
236
- end
237
-
238
- it 'all Ruby files have valid syntax' do
239
- ruby_files('e2e_axe_cucumber').each do |file|
240
- content = File.read(file)
241
- expect(content).to have_valid_ruby_syntax, "#{file} has invalid syntax"
242
- end
243
- end
244
- end
245
203
  end
246
204
 
247
205
  # --- Feature: GitHub Actions CI ---