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.
- checksums.yaml +4 -4
- data/.github/workflows/integration.yml +4 -6
- data/.github/workflows/reek.yml +6 -5
- data/.github/workflows/release.yml +175 -0
- data/.github/workflows/rubocop.yml +7 -6
- data/.github/workflows/system_tests.yml +83 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +24 -0
- data/README.md +3 -1
- data/RELEASE.md +412 -0
- data/RELEASE_QUICK_GUIDE.md +77 -0
- data/bin/release +186 -0
- data/lib/adopter/adopt_menu.rb +150 -0
- data/lib/adopter/converters/base_converter.rb +85 -0
- data/lib/adopter/converters/identity_converter.rb +56 -0
- data/lib/adopter/migration_plan.rb +75 -0
- data/lib/adopter/migrator.rb +96 -0
- data/lib/adopter/plan_builder.rb +278 -0
- data/lib/adopter/project_analyzer.rb +256 -0
- data/lib/adopter/project_detector.rb +159 -0
- data/lib/commands/adopt_commands.rb +43 -0
- data/lib/generators/automation/templates/account.tt +9 -5
- data/lib/generators/automation/templates/appium_caps.tt +60 -6
- data/lib/generators/automation/templates/home.tt +4 -4
- data/lib/generators/automation/templates/login.tt +61 -4
- data/lib/generators/automation/templates/page.tt +13 -7
- data/lib/generators/automation/templates/partials/home_page_selector.tt +4 -4
- data/lib/generators/automation/templates/partials/initialize_selector.tt +3 -1
- data/lib/generators/automation/templates/partials/pdp_page_selector.tt +4 -4
- data/lib/generators/automation/templates/partials/visit_method.tt +11 -1
- data/lib/generators/automation/templates/pdp.tt +1 -1
- data/lib/generators/cucumber/templates/env.tt +6 -4
- data/lib/generators/cucumber/templates/partials/capybara_env.tt +20 -0
- data/lib/generators/cucumber/templates/partials/capybara_world.tt +6 -0
- data/lib/generators/cucumber/templates/partials/mobile_steps.tt +2 -2
- data/lib/generators/cucumber/templates/partials/web_steps.tt +4 -3
- data/lib/generators/cucumber/templates/steps.tt +2 -2
- data/lib/generators/cucumber/templates/world.tt +5 -3
- data/lib/generators/generator.rb +14 -2
- data/lib/generators/helper_generator.rb +16 -3
- data/lib/generators/infrastructure/github_generator.rb +6 -0
- data/lib/generators/infrastructure/templates/github.tt +11 -7
- data/lib/generators/infrastructure/templates/github_appium.tt +108 -0
- data/lib/generators/infrastructure/templates/gitlab.tt +5 -2
- data/lib/generators/invoke_generators.rb +1 -0
- data/lib/generators/menu_generator.rb +2 -0
- data/lib/generators/minitest/minitest_generator.rb +23 -0
- data/lib/generators/minitest/templates/test.tt +93 -0
- data/lib/generators/rspec/templates/spec.tt +12 -10
- data/lib/generators/template_renderer/partial_cache.rb +116 -0
- data/lib/generators/template_renderer/partial_resolver.rb +103 -0
- data/lib/generators/template_renderer/template_error.rb +50 -0
- data/lib/generators/template_renderer.rb +90 -0
- data/lib/generators/templates/common/config.tt +2 -2
- data/lib/generators/templates/common/gemfile.tt +15 -3
- data/lib/generators/templates/common/partials/web_config.tt +1 -1
- data/lib/generators/templates/common/read_me.tt +3 -1
- data/lib/generators/templates/helpers/allure_helper.tt +2 -2
- data/lib/generators/templates/helpers/browser_helper.tt +1 -0
- data/lib/generators/templates/helpers/capybara_helper.tt +28 -0
- data/lib/generators/templates/helpers/driver_helper.tt +1 -1
- data/lib/generators/templates/helpers/partials/allure_imports.tt +3 -1
- data/lib/generators/templates/helpers/partials/allure_requirements.tt +3 -1
- data/lib/generators/templates/helpers/partials/appium_driver.tt +46 -0
- data/lib/generators/templates/helpers/partials/axe_driver.tt +10 -0
- data/lib/generators/templates/helpers/partials/browserstack_config.tt +13 -0
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +6 -114
- data/lib/generators/templates/helpers/partials/quit_driver.tt +3 -1
- data/lib/generators/templates/helpers/partials/screenshot.tt +3 -1
- data/lib/generators/templates/helpers/partials/selenium_driver.tt +25 -0
- data/lib/generators/templates/helpers/spec_helper.tt +17 -4
- data/lib/generators/templates/helpers/test_helper.tt +26 -0
- data/lib/generators/templates/helpers/visual_spec_helper.tt +1 -1
- data/lib/ruby_raider.rb +5 -0
- data/lib/version +1 -1
- data/spec/adopter/adopt_menu_spec.rb +176 -0
- data/spec/adopter/converters/identity_converter_spec.rb +145 -0
- data/spec/adopter/migration_plan_spec.rb +113 -0
- data/spec/adopter/migrator_spec.rb +277 -0
- data/spec/adopter/plan_builder_spec.rb +298 -0
- data/spec/adopter/project_analyzer_spec.rb +337 -0
- data/spec/adopter/project_detector_spec.rb +295 -0
- data/spec/generators/fixtures/templates/test.tt +1 -0
- data/spec/generators/fixtures/templates/test_partial.tt +1 -0
- data/spec/generators/template_renderer_spec.rb +298 -0
- data/spec/integration/commands/scaffolding_commands_spec.rb +2 -2
- data/spec/integration/commands/utility_commands_spec.rb +2 -2
- data/spec/integration/end_to_end_spec.rb +325 -0
- data/spec/integration/generators/automation_generator_spec.rb +11 -11
- data/spec/integration/generators/common_generator_spec.rb +40 -40
- data/spec/integration/generators/cucumber_generator_spec.rb +7 -7
- data/spec/integration/generators/github_generator_spec.rb +8 -8
- data/spec/integration/generators/gitlab_generator_spec.rb +8 -8
- data/spec/integration/generators/helpers_generator_spec.rb +73 -35
- data/spec/integration/generators/minitest_generator_spec.rb +70 -0
- data/spec/integration/generators/rspec_generator_spec.rb +7 -7
- data/spec/integration/settings_helper.rb +1 -1
- data/spec/integration/spec_helper.rb +20 -2
- data/spec/system/capybara_spec.rb +42 -0
- data/spec/system/selenium_spec.rb +19 -17
- data/spec/system/support/system_test_helper.rb +35 -0
- data/spec/system/watir_spec.rb +19 -17
- metadata +46 -16
- data/.github/workflows/push_gem.yml +0 -37
- data/.github/workflows/selenium.yml +0 -22
- data/.github/workflows/watir.yml +0 -22
- data/lib/generators/automation/templates/partials/android_caps.tt +0 -17
- data/lib/generators/automation/templates/partials/cross_platform_caps.tt +0 -25
- data/lib/generators/automation/templates/partials/ios_caps.tt +0 -18
- data/lib/generators/automation/templates/partials/selenium_account.tt +0 -9
- data/lib/generators/automation/templates/partials/selenium_login.tt +0 -34
- data/lib/generators/automation/templates/partials/watir_account.tt +0 -7
- 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', "#{
|
|
51
|
-
include_examples 'creates web visual framework', "#{
|
|
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', "#{
|
|
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', "#{
|
|
60
|
-
include_examples 'creates web visual framework', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
53
|
-
include_examples 'creates a config file', "#{
|
|
54
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
59
|
-
include_examples 'creates a config file', "#{
|
|
60
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
65
|
-
include_examples 'creates a config file', "#{
|
|
66
|
-
include_examples 'creates an options file', "#{
|
|
67
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
72
|
-
include_examples 'creates a config file', "#{
|
|
73
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
78
|
-
include_examples 'creates a config file', "#{
|
|
79
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
84
|
-
include_examples 'creates a capabilities file', "#{
|
|
85
|
-
include_examples "doesn't create a config file", "#{
|
|
86
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
91
|
-
include_examples 'creates a capabilities file', "#{
|
|
92
|
-
include_examples "doesn't create a config file", "#{
|
|
93
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
98
|
-
include_examples 'creates a capabilities file', "#{
|
|
99
|
-
include_examples "doesn't create a config file", "#{
|
|
100
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
105
|
-
include_examples 'creates a capabilities file', "#{
|
|
106
|
-
include_examples "doesn't create a config file", "#{
|
|
107
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
112
|
-
include_examples 'creates a capabilities file', "#{
|
|
113
|
-
include_examples 'creates a config file', "#{
|
|
114
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
119
|
-
include_examples 'creates a capabilities file', "#{
|
|
120
|
-
include_examples 'creates a config file', "#{
|
|
121
|
-
include_examples 'creates a gitignore file', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
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', "#{
|
|
57
|
-
include_examples 'creates factories for web projects', "#{
|
|
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', "#{
|
|
62
|
-
include_examples 'creates factories for web projects', "#{
|
|
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', "#{
|
|
21
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
26
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
31
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
36
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
21
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
26
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
31
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
36
|
-
include_examples 'does not select any infrastructure option', "#{
|
|
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', "#{
|
|
51
|
-
include_examples 'creates selenium helpers', "#{
|
|
52
|
-
include_examples 'creates rspec helpers', "#{
|
|
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', "#{
|
|
57
|
-
include_examples 'creates watir helpers', "#{
|
|
58
|
-
include_examples 'creates rspec helpers', "#{
|
|
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', "#{
|
|
63
|
-
include_examples 'creates selenium helpers', "#{
|
|
64
|
-
include_examples 'creates rspec helpers', "#{
|
|
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', "#{
|
|
69
|
-
include_examples 'creates selenium helpers', "#{
|
|
70
|
-
include_examples 'creates cucumber helpers', "#{
|
|
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', "#{
|
|
75
|
-
include_examples 'creates watir helpers', "#{
|
|
76
|
-
include_examples 'creates cucumber helpers', "#{
|
|
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', "#{
|
|
81
|
-
include_examples 'creates selenium helpers', "#{
|
|
82
|
-
include_examples 'creates rspec helpers', "#{
|
|
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', "#{
|
|
87
|
-
include_examples 'creates selenium helpers', "#{
|
|
88
|
-
include_examples 'creates rspec helpers', "#{
|
|
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', "#{
|
|
93
|
-
include_examples 'creates selenium helpers', "#{
|
|
94
|
-
include_examples 'creates cucumber helpers', "#{
|
|
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', "#{
|
|
99
|
-
include_examples 'creates selenium helpers', "#{
|
|
100
|
-
include_examples 'creates cucumber helpers', "#{
|
|
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', "#{
|
|
105
|
-
include_examples 'creates selenium helpers', "#{
|
|
106
|
-
include_examples 'creates rspec helpers', "#{
|
|
107
|
-
include_examples 'creates cross platform helpers', "#{
|
|
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', "#{
|
|
112
|
-
include_examples 'creates selenium helpers', "#{
|
|
113
|
-
include_examples 'creates cucumber helpers', "#{
|
|
114
|
-
include_examples 'creates cross platform helpers', "#{
|
|
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', "#{
|
|
24
|
+
include_examples 'creates factory files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
25
25
|
include_examples 'creates rspec files examples',
|
|
26
|
-
"#{
|
|
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', "#{
|
|
30
|
+
include_examples 'creates factory files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
31
31
|
include_examples 'creates rspec files examples',
|
|
32
|
-
"#{
|
|
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
|
-
"#{
|
|
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
|
-
"#{
|
|
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
|
-
"#{
|
|
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
|