ruby_raider 1.1.4 → 2.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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/integration.yml +4 -6
  3. data/.github/workflows/reek.yml +6 -5
  4. data/.github/workflows/release.yml +175 -0
  5. data/.github/workflows/rubocop.yml +7 -6
  6. data/.github/workflows/system_tests.yml +83 -0
  7. data/.gitignore +1 -1
  8. data/.rubocop.yml +24 -0
  9. data/README.md +3 -1
  10. data/RELEASE.md +412 -0
  11. data/RELEASE_QUICK_GUIDE.md +77 -0
  12. data/bin/release +186 -0
  13. data/lib/adopter/adopt_menu.rb +150 -0
  14. data/lib/adopter/converters/base_converter.rb +85 -0
  15. data/lib/adopter/converters/identity_converter.rb +56 -0
  16. data/lib/adopter/migration_plan.rb +75 -0
  17. data/lib/adopter/migrator.rb +96 -0
  18. data/lib/adopter/plan_builder.rb +278 -0
  19. data/lib/adopter/project_analyzer.rb +256 -0
  20. data/lib/adopter/project_detector.rb +159 -0
  21. data/lib/commands/adopt_commands.rb +43 -0
  22. data/lib/generators/automation/templates/account.tt +9 -5
  23. data/lib/generators/automation/templates/appium_caps.tt +60 -6
  24. data/lib/generators/automation/templates/home.tt +4 -4
  25. data/lib/generators/automation/templates/login.tt +61 -4
  26. data/lib/generators/automation/templates/page.tt +13 -7
  27. data/lib/generators/automation/templates/partials/home_page_selector.tt +4 -4
  28. data/lib/generators/automation/templates/partials/initialize_selector.tt +3 -1
  29. data/lib/generators/automation/templates/partials/pdp_page_selector.tt +4 -4
  30. data/lib/generators/automation/templates/partials/visit_method.tt +11 -1
  31. data/lib/generators/automation/templates/pdp.tt +1 -1
  32. data/lib/generators/cucumber/templates/env.tt +6 -4
  33. data/lib/generators/cucumber/templates/partials/capybara_env.tt +20 -0
  34. data/lib/generators/cucumber/templates/partials/capybara_world.tt +6 -0
  35. data/lib/generators/cucumber/templates/partials/mobile_steps.tt +2 -2
  36. data/lib/generators/cucumber/templates/partials/web_steps.tt +4 -3
  37. data/lib/generators/cucumber/templates/steps.tt +2 -2
  38. data/lib/generators/cucumber/templates/world.tt +5 -3
  39. data/lib/generators/generator.rb +14 -2
  40. data/lib/generators/helper_generator.rb +16 -3
  41. data/lib/generators/infrastructure/github_generator.rb +6 -0
  42. data/lib/generators/infrastructure/templates/github.tt +11 -7
  43. data/lib/generators/infrastructure/templates/github_appium.tt +108 -0
  44. data/lib/generators/infrastructure/templates/gitlab.tt +5 -2
  45. data/lib/generators/invoke_generators.rb +1 -0
  46. data/lib/generators/menu_generator.rb +2 -0
  47. data/lib/generators/minitest/minitest_generator.rb +23 -0
  48. data/lib/generators/minitest/templates/test.tt +93 -0
  49. data/lib/generators/rspec/templates/spec.tt +12 -10
  50. data/lib/generators/template_renderer/partial_cache.rb +116 -0
  51. data/lib/generators/template_renderer/partial_resolver.rb +103 -0
  52. data/lib/generators/template_renderer/template_error.rb +50 -0
  53. data/lib/generators/template_renderer.rb +90 -0
  54. data/lib/generators/templates/common/config.tt +2 -2
  55. data/lib/generators/templates/common/gemfile.tt +15 -3
  56. data/lib/generators/templates/common/partials/web_config.tt +1 -1
  57. data/lib/generators/templates/common/read_me.tt +3 -1
  58. data/lib/generators/templates/helpers/allure_helper.tt +2 -2
  59. data/lib/generators/templates/helpers/browser_helper.tt +1 -0
  60. data/lib/generators/templates/helpers/capybara_helper.tt +28 -0
  61. data/lib/generators/templates/helpers/driver_helper.tt +1 -1
  62. data/lib/generators/templates/helpers/partials/allure_imports.tt +3 -1
  63. data/lib/generators/templates/helpers/partials/allure_requirements.tt +3 -1
  64. data/lib/generators/templates/helpers/partials/appium_driver.tt +46 -0
  65. data/lib/generators/templates/helpers/partials/axe_driver.tt +10 -0
  66. data/lib/generators/templates/helpers/partials/browserstack_config.tt +13 -0
  67. data/lib/generators/templates/helpers/partials/driver_and_options.tt +6 -114
  68. data/lib/generators/templates/helpers/partials/quit_driver.tt +3 -1
  69. data/lib/generators/templates/helpers/partials/screenshot.tt +3 -1
  70. data/lib/generators/templates/helpers/partials/selenium_driver.tt +25 -0
  71. data/lib/generators/templates/helpers/spec_helper.tt +17 -4
  72. data/lib/generators/templates/helpers/test_helper.tt +26 -0
  73. data/lib/generators/templates/helpers/visual_spec_helper.tt +1 -1
  74. data/lib/ruby_raider.rb +5 -0
  75. data/lib/version +1 -1
  76. data/spec/adopter/adopt_menu_spec.rb +176 -0
  77. data/spec/adopter/converters/identity_converter_spec.rb +145 -0
  78. data/spec/adopter/migration_plan_spec.rb +113 -0
  79. data/spec/adopter/migrator_spec.rb +277 -0
  80. data/spec/adopter/plan_builder_spec.rb +298 -0
  81. data/spec/adopter/project_analyzer_spec.rb +337 -0
  82. data/spec/adopter/project_detector_spec.rb +295 -0
  83. data/spec/generators/fixtures/templates/test.tt +1 -0
  84. data/spec/generators/fixtures/templates/test_partial.tt +1 -0
  85. data/spec/generators/template_renderer_spec.rb +298 -0
  86. data/spec/integration/commands/scaffolding_commands_spec.rb +2 -2
  87. data/spec/integration/commands/utility_commands_spec.rb +2 -2
  88. data/spec/integration/end_to_end_spec.rb +325 -0
  89. data/spec/integration/generators/automation_generator_spec.rb +11 -11
  90. data/spec/integration/generators/common_generator_spec.rb +40 -40
  91. data/spec/integration/generators/cucumber_generator_spec.rb +7 -7
  92. data/spec/integration/generators/github_generator_spec.rb +8 -8
  93. data/spec/integration/generators/gitlab_generator_spec.rb +8 -8
  94. data/spec/integration/generators/helpers_generator_spec.rb +73 -35
  95. data/spec/integration/generators/minitest_generator_spec.rb +70 -0
  96. data/spec/integration/generators/rspec_generator_spec.rb +7 -7
  97. data/spec/integration/settings_helper.rb +1 -1
  98. data/spec/integration/spec_helper.rb +20 -2
  99. data/spec/system/capybara_spec.rb +42 -0
  100. data/spec/system/selenium_spec.rb +19 -17
  101. data/spec/system/support/system_test_helper.rb +35 -0
  102. data/spec/system/watir_spec.rb +19 -17
  103. metadata +46 -16
  104. data/.github/workflows/push_gem.yml +0 -37
  105. data/.github/workflows/selenium.yml +0 -22
  106. data/.github/workflows/watir.yml +0 -22
  107. data/lib/generators/automation/templates/partials/android_caps.tt +0 -17
  108. data/lib/generators/automation/templates/partials/cross_platform_caps.tt +0 -25
  109. data/lib/generators/automation/templates/partials/ios_caps.tt +0 -18
  110. data/lib/generators/automation/templates/partials/selenium_account.tt +0 -9
  111. data/lib/generators/automation/templates/partials/selenium_login.tt +0 -34
  112. data/lib/generators/automation/templates/partials/watir_account.tt +0 -7
  113. data/lib/generators/automation/templates/partials/watir_login.tt +0 -32
@@ -47,40 +47,40 @@ describe AutomationGenerator do
47
47
  end
48
48
 
49
49
  context 'with rspec and selenium' do
50
- include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
51
- include_examples 'creates web visual framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
50
+ include_examples 'creates web automation framework', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
51
+ include_examples 'creates web visual framework', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
52
52
  end
53
53
 
54
54
  context 'with rspec and watir' do
55
- include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
55
+ include_examples 'creates web automation framework', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
56
56
  end
57
57
 
58
58
  context 'with cucumber and selenium' do
59
- include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
60
- include_examples 'creates web visual framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
59
+ include_examples 'creates web automation framework', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
60
+ include_examples 'creates web visual framework', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::APPLITOOLS}"
61
61
  end
62
62
 
63
63
  context 'with cucumber and watir' do
64
- include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
64
+ include_examples 'creates web automation framework', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
65
65
  end
66
66
 
67
67
  context 'with rspec and appium android' do
68
- include_examples 'creates mobile automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
68
+ include_examples 'creates mobile automation framework', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
69
69
  end
70
70
 
71
71
  context 'with rspec and appium ios' do
72
- include_examples 'creates mobile automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
72
+ include_examples 'creates mobile automation framework', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
73
73
  end
74
74
 
75
75
  context 'with cucumber and appium android' do
76
- include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
76
+ include_examples 'creates mobile automation framework', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
77
77
  end
78
78
 
79
79
  context 'with cucumber and appium ios' do
80
- include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
80
+ include_examples 'creates mobile automation framework', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
81
81
  end
82
82
 
83
83
  context 'with cucumber and appium cross platform' do
84
- include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
84
+ include_examples 'creates mobile automation framework', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
85
85
  end
86
86
  end
@@ -49,75 +49,75 @@ describe CommonGenerator do
49
49
  end
50
50
 
51
51
  context 'with rspec and selenium' do
52
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
53
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
54
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
52
+ include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
53
+ include_examples 'creates a config file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
54
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
55
55
  end
56
56
 
57
57
  context 'with rspec and watir' do
58
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
59
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
60
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
58
+ include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
59
+ include_examples 'creates a config file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
60
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
61
61
  end
62
62
 
63
63
  context 'with rspec, selenium and applitools' do
64
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
65
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
66
- include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
67
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
64
+ include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
65
+ include_examples 'creates a config file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
66
+ include_examples 'creates an options file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
67
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
68
68
  end
69
69
 
70
70
  context 'with cucumber and selenium' do
71
- include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
72
- include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
73
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
71
+ include_examples 'creates common files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
72
+ include_examples 'creates a config file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
73
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
74
74
  end
75
75
 
76
76
  context 'with cucumber and watir' do
77
- include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
78
- include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
79
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
77
+ include_examples 'creates common files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
78
+ include_examples 'creates a config file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
79
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
80
80
  end
81
81
 
82
82
  context 'with rspec and appium android' do
83
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
84
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
85
- include_examples "doesn't create a config file", "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
86
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
83
+ include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
84
+ include_examples 'creates a capabilities file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
85
+ include_examples "doesn't create a config file", "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
86
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
87
87
  end
88
88
 
89
89
  context 'with rspec and appium ios' do
90
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
91
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
92
- include_examples "doesn't create a config file", "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
93
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
90
+ include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
91
+ include_examples 'creates a capabilities file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
92
+ include_examples "doesn't create a config file", "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
93
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
94
94
  end
95
95
 
96
96
  context 'with cucumber and appium android' do
97
- include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
98
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
99
- include_examples "doesn't create a config file", "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
100
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
97
+ include_examples 'creates common files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
98
+ include_examples 'creates a capabilities file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
99
+ include_examples "doesn't create a config file", "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
100
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
101
101
  end
102
102
 
103
103
  context 'with cucumber and appium ios' do
104
- include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
105
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
106
- include_examples "doesn't create a config file", "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
107
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
104
+ include_examples 'creates common files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
105
+ include_examples 'creates a capabilities file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
106
+ include_examples "doesn't create a config file", "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
107
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
108
108
  end
109
109
 
110
110
  context 'with cucumber and appium cross platform' do
111
- include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
112
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
113
- include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
114
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
111
+ include_examples 'creates common files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
112
+ include_examples 'creates a capabilities file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
113
+ include_examples 'creates a config file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
114
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
115
115
  end
116
116
 
117
117
  context 'with rspec and appium cross platform' do
118
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
119
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
120
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
121
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
118
+ include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
119
+ include_examples 'creates a capabilities file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
120
+ include_examples 'creates a config file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
121
+ include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
122
122
  end
123
123
  end
@@ -41,24 +41,24 @@ describe CucumberGenerator do
41
41
  end
42
42
 
43
43
  context 'with cucumber and appium android' do
44
- include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}", 'home'
44
+ include_examples 'creates cucumber files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}", 'home'
45
45
  end
46
46
 
47
47
  context 'with cucumber and appium ios' do
48
- include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}", 'home'
48
+ include_examples 'creates cucumber files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}", 'home'
49
49
  end
50
50
 
51
51
  context 'with cucumber and appium cross platform' do
52
- include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}", 'home'
52
+ include_examples 'creates cucumber files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}", 'home'
53
53
  end
54
54
 
55
55
  context 'with cucumber and selenium' do
56
- include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}", 'login'
57
- include_examples 'creates factories for web projects', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}", 'login'
56
+ include_examples 'creates cucumber files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}", 'login'
57
+ include_examples 'creates factories for web projects', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}", 'login'
58
58
  end
59
59
 
60
60
  context 'with cucumber and watir' do
61
- include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}", 'login'
62
- include_examples 'creates factories for web projects', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}", 'login'
61
+ include_examples 'creates cucumber files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}", 'login'
62
+ include_examples 'creates factories for web projects', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}", 'login'
63
63
  end
64
64
  end
@@ -17,22 +17,22 @@ describe GithubGenerator do
17
17
  end
18
18
 
19
19
  context 'with rspec and selenium' do
20
- include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[1]}"
21
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
20
+ include_examples 'selects github as an infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}_#{CI_PLATFORMS[1]}"
21
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
22
22
  end
23
23
 
24
24
  context 'with rspec and watir' do
25
- include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[1]}"
26
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
25
+ include_examples 'selects github as an infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}_#{CI_PLATFORMS[1]}"
26
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
27
27
  end
28
28
 
29
29
  context 'with cucumber and selenium' do
30
- include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[1]}"
31
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
30
+ include_examples 'selects github as an infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}_#{CI_PLATFORMS[1]}"
31
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
32
32
  end
33
33
 
34
34
  context 'with cucumber and watir' do
35
- include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[1]}"
36
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
35
+ include_examples 'selects github as an infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}_#{CI_PLATFORMS[1]}"
36
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
37
37
  end
38
38
  end
@@ -17,22 +17,22 @@ describe GitlabGenerator do
17
17
  end
18
18
 
19
19
  context 'with rspec and selenium' do
20
- include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[2]}"
21
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
20
+ include_examples 'selects gitlab as an infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}_#{CI_PLATFORMS[2]}"
21
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
22
22
  end
23
23
 
24
24
  context 'with rspec and watir' do
25
- include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[2]}"
26
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
25
+ include_examples 'selects gitlab as an infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}_#{CI_PLATFORMS[2]}"
26
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
27
27
  end
28
28
 
29
29
  context 'with cucumber and selenium' do
30
- include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[2]}"
31
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
30
+ include_examples 'selects gitlab as an infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}_#{CI_PLATFORMS[2]}"
31
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
32
32
  end
33
33
 
34
34
  context 'with cucumber and watir' do
35
- include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[2]}"
36
- include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
35
+ include_examples 'selects gitlab as an infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}_#{CI_PLATFORMS[2]}"
36
+ include_examples 'does not select any infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
37
37
  end
38
38
  end
@@ -47,70 +47,108 @@ describe HelpersGenerator do
47
47
  end
48
48
 
49
49
  context 'with rspec and selenium' do
50
- include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
51
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
52
- include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
50
+ include_examples 'creates common helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
51
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
52
+ include_examples 'creates rspec helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
53
53
  end
54
54
 
55
55
  context 'with rspec and watir' do
56
- include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
57
- include_examples 'creates watir helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
58
- include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
56
+ include_examples 'creates common helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
57
+ include_examples 'creates watir helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
58
+ include_examples 'creates rspec helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
59
59
  end
60
60
 
61
61
  context 'with rspec, selenium and applitools' do
62
- include_examples 'creates common visual helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
63
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
64
- include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
62
+ include_examples 'creates common visual helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
63
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
64
+ include_examples 'creates rspec helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::APPLITOOLS}"
65
65
  end
66
66
 
67
67
  context 'with cucumber and selenium' do
68
- include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
69
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
70
- include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
68
+ include_examples 'creates common helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
69
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
70
+ include_examples 'creates cucumber helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
71
71
  end
72
72
 
73
73
  context 'with cucumber and watir' do
74
- include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
75
- include_examples 'creates watir helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
76
- include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
74
+ include_examples 'creates common helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
75
+ include_examples 'creates watir helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
76
+ include_examples 'creates cucumber helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
77
77
  end
78
78
 
79
79
  context 'with rspec and appium android' do
80
- include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
81
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
82
- include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
80
+ include_examples 'creates common helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
81
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
82
+ include_examples 'creates rspec helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
83
83
  end
84
84
 
85
85
  context 'with rspec and appium ios' do
86
- include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
87
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
88
- include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
86
+ include_examples 'creates common helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
87
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
88
+ include_examples 'creates rspec helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
89
89
  end
90
90
 
91
91
  context 'with cucumber and appium android' do
92
- include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
93
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
94
- include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
92
+ include_examples 'creates common helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
93
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
94
+ include_examples 'creates cucumber helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
95
95
  end
96
96
 
97
97
  context 'with cucumber and appium ios' do
98
- include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
99
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
100
- include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
98
+ include_examples 'creates common helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
99
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
100
+ include_examples 'creates cucumber helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::IOS}"
101
101
  end
102
102
 
103
103
  context 'with rspec and appium cross platform' do
104
- include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
105
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
106
- include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
107
- include_examples 'creates cross platform helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
104
+ include_examples 'creates common helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
105
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
106
+ include_examples 'creates rspec helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
107
+ include_examples 'creates cross platform helpers', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}"
108
108
  end
109
109
 
110
110
  context 'with cucumber and appium cross platform' do
111
- include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
112
- include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
113
- include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
114
- include_examples 'creates cross platform helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
111
+ include_examples 'creates common helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
112
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
113
+ include_examples 'creates cucumber helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
114
+ include_examples 'creates cross platform helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
115
+ end
116
+
117
+ shared_examples 'creates minitest helpers' do |name|
118
+ it 'creates a test helper file' do
119
+ expect(File).to exist("#{name}/helpers/test_helper.rb")
120
+ end
121
+
122
+ it 'does not create a spec helper' do
123
+ expect(File).not_to exist("#{name}/helpers/spec_helper.rb")
124
+ end
125
+ end
126
+
127
+ shared_examples 'creates capybara helpers' do |name|
128
+ it 'creates a capybara helper file' do
129
+ expect(File).to exist("#{name}/helpers/capybara_helper.rb")
130
+ end
131
+
132
+ it 'does not create a driver helper' do
133
+ expect(File).not_to exist("#{name}/helpers/driver_helper.rb")
134
+ end
135
+ end
136
+
137
+ context 'with minitest and selenium' do
138
+ include_examples 'creates common helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
139
+ include_examples 'creates selenium helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
140
+ include_examples 'creates minitest helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
141
+ end
142
+
143
+ context 'with minitest and watir' do
144
+ include_examples 'creates common helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
145
+ include_examples 'creates watir helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
146
+ include_examples 'creates minitest helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
147
+ end
148
+
149
+ context 'with minitest and capybara' do
150
+ include_examples 'creates common helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
151
+ include_examples 'creates capybara helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
152
+ include_examples 'creates minitest helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
115
153
  end
116
154
  end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../lib/generators/minitest/minitest_generator'
4
+ require_relative '../spec_helper'
5
+
6
+ describe MinitestGenerator do
7
+ shared_examples 'creates factory files' do |project_name|
8
+ it 'creates a model factory file' do
9
+ expect(File).to exist("#{project_name}/models/model_factory.rb")
10
+ end
11
+
12
+ it 'creates the data for the factory' do
13
+ expect(File).to exist("#{project_name}/models/data/users.yml")
14
+ end
15
+ end
16
+
17
+ shared_examples 'creates minitest files examples' do |project_name, file_name|
18
+ it 'creates a test file' do
19
+ expect(File).to exist("#{project_name}/test/test_#{file_name}_page.rb")
20
+ end
21
+ end
22
+
23
+ shared_examples 'creates test helper' do |project_name|
24
+ it 'creates a test helper file' do
25
+ expect(File).to exist("#{project_name}/helpers/test_helper.rb")
26
+ end
27
+ end
28
+
29
+ context 'with minitest and selenium' do
30
+ include_examples 'creates factory files', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
31
+ include_examples 'creates minitest files examples',
32
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}", 'login'
33
+ include_examples 'creates test helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
34
+ end
35
+
36
+ context 'with minitest and watir' do
37
+ include_examples 'creates factory files', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
38
+ include_examples 'creates minitest files examples',
39
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}", 'login'
40
+ include_examples 'creates test helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
41
+ end
42
+
43
+ context 'with minitest and capybara' do
44
+ include_examples 'creates factory files', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
45
+ include_examples 'creates minitest files examples',
46
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}", 'login'
47
+ include_examples 'creates test helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
48
+ end
49
+
50
+ context 'with minitest and appium android' do
51
+ include_examples 'creates minitest files examples',
52
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::ANDROID}", 'pdp'
53
+ end
54
+
55
+ context 'with minitest and appium ios' do
56
+ include_examples 'creates minitest files examples',
57
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::IOS}", 'pdp'
58
+ end
59
+
60
+ context 'with minitest and appium cross platform' do
61
+ include_examples 'creates minitest files examples',
62
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CROSS_PLATFORM}", 'pdp'
63
+ end
64
+
65
+ context 'with minitest and axe' do
66
+ include_examples 'creates minitest files examples',
67
+ "#{FrameworkIndex::MINITEST}_#{AutomationIndex::AXE}", 'login'
68
+ include_examples 'creates test helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::AXE}"
69
+ end
70
+ end
@@ -21,29 +21,29 @@ describe RspecGenerator do
21
21
  end
22
22
 
23
23
  context 'with rspec and selenium' do
24
- include_examples 'creates factory files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
24
+ include_examples 'creates factory files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
25
25
  include_examples 'creates rspec files examples',
26
- "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}", 'login'
26
+ "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}", 'login'
27
27
  end
28
28
 
29
29
  context 'with rspec and watir' do
30
- include_examples 'creates factory files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
30
+ include_examples 'creates factory files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
31
31
  include_examples 'creates rspec files examples',
32
- "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}", 'login'
32
+ "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}", 'login'
33
33
  end
34
34
 
35
35
  context 'with rspec and appium android' do
36
36
  include_examples 'creates rspec files examples',
37
- "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}", 'pdp'
37
+ "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}", 'pdp'
38
38
  end
39
39
 
40
40
  context 'with rspec and appium ios' do
41
41
  include_examples 'creates rspec files examples',
42
- "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}", 'pdp'
42
+ "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}", 'pdp'
43
43
  end
44
44
 
45
45
  context 'with rspec and appium cross platform' do
46
46
  include_examples 'creates rspec files examples',
47
- "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}", 'pdp'
47
+ "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CROSS_PLATFORM}", 'pdp'
48
48
  end
49
49
  end
@@ -10,7 +10,7 @@ module SettingsHelper
10
10
  automation:,
11
11
  framework:,
12
12
  ci_platform:,
13
- name: ci_platform ? "#{framework}_#{automation}_#{ci_platform}" : "#{framework}_#{automation}",
13
+ name: ci_platform ? "#{framework}_#{automation}_#{ci_platform}" : "#{framework}_#{automation}"
14
14
  }
15
15
  end
16
16
  end
@@ -5,10 +5,28 @@ require 'rspec'
5
5
  require_relative '../../lib/generators/invoke_generators'
6
6
  require_relative 'settings_helper'
7
7
 
8
- AUTOMATION_TYPES = %w[android ios selenium watir cross_platform axe applitools].freeze
9
- FRAMEWORKS = %w[cucumber rspec].freeze
8
+ AUTOMATION_TYPES = %w[android ios selenium watir cross_platform axe applitools capybara].freeze
9
+ FRAMEWORKS = %w[cucumber rspec minitest].freeze
10
10
  CI_PLATFORMS = [nil, 'github', 'gitlab'].freeze
11
11
 
12
+ # Named constants for readable spec references — no more fragile numeric indices
13
+ module FrameworkIndex
14
+ CUCUMBER = FRAMEWORKS[0]
15
+ RSPEC = FRAMEWORKS[1]
16
+ MINITEST = FRAMEWORKS[2]
17
+ end
18
+
19
+ module AutomationIndex
20
+ ANDROID = AUTOMATION_TYPES[0]
21
+ IOS = AUTOMATION_TYPES[1]
22
+ SELENIUM = AUTOMATION_TYPES[2]
23
+ WATIR = AUTOMATION_TYPES[3]
24
+ CROSS_PLATFORM = AUTOMATION_TYPES[4]
25
+ AXE = AUTOMATION_TYPES[5]
26
+ APPLITOOLS = AUTOMATION_TYPES[6]
27
+ CAPYBARA = AUTOMATION_TYPES[7]
28
+ end
29
+
12
30
  RSpec.configure do |config|
13
31
  config.include(InvokeGenerators)
14
32
  config.include(SettingsHelper)
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../lib/ruby_raider'
4
+ require_relative 'support/system_test_helper'
5
+
6
+ FRAMEWORKS = %w[cucumber rspec minitest].freeze unless defined?(FRAMEWORKS)
7
+
8
+ describe 'Capybara based frameworks' do
9
+ include SystemTestHelper
10
+
11
+ before(:all) do # rubocop:disable RSpec/BeforeAfterAll
12
+ FRAMEWORKS.each do |framework|
13
+ RubyRaider::Raider
14
+ .new.invoke(:new, nil, %W[capybara_#{framework} -p framework:#{framework} automation:capybara])
15
+ end
16
+ end
17
+
18
+ after(:all) do # rubocop:disable RSpec/BeforeAfterAll
19
+ FRAMEWORKS.each { |framework| FileUtils.rm_rf("capybara_#{framework}") }
20
+ end
21
+
22
+ shared_examples 'runs tests successfully' do |framework|
23
+ it 'installs dependencies and runs tests without errors' do
24
+ result = run_tests_with(framework, 'capybara')
25
+ expect(result[:success]).to be(true),
26
+ "Tests failed for capybara_#{framework}.\n" \
27
+ "STDOUT: #{result[:stdout]}\nSTDERR: #{result[:stderr]}"
28
+ end
29
+ end
30
+
31
+ context 'with rspec' do
32
+ include_examples 'runs tests successfully', 'rspec'
33
+ end
34
+
35
+ context 'with cucumber' do
36
+ include_examples 'runs tests successfully', 'cucumber'
37
+ end
38
+
39
+ context 'with minitest' do
40
+ include_examples 'runs tests successfully', 'minitest'
41
+ end
42
+ end