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.
- checksums.yaml +4 -4
- data/.github/workflows/runtime.yml +38 -0
- data/.github/workflows/system_tests.yml +1 -23
- data/.reek.yml +1 -0
- data/.rspec +1 -0
- data/Gemfile +2 -0
- data/README.md +16 -49
- data/RELEASE.md +22 -0
- data/bin/raider +5 -0
- data/lib/commands/scaffolding_commands.rb +2 -25
- data/lib/commands/utility_commands.rb +23 -3
- data/lib/generators/automation/automation_generator.rb +0 -5
- data/lib/generators/automation/templates/component.tt +1 -0
- data/lib/generators/automation/templates/home.tt +2 -2
- data/lib/generators/automation/templates/login.tt +6 -26
- data/lib/generators/automation/templates/page.tt +23 -18
- data/lib/generators/automation/templates/partials/home_page_selector.tt +1 -2
- data/lib/generators/automation/templates/partials/initialize_selector.tt +0 -8
- data/lib/generators/automation/templates/partials/pdp_page_selector.tt +1 -2
- data/lib/generators/automation/templates/partials/url_methods.tt +8 -2
- data/lib/generators/automation/templates/partials/visit_method.tt +0 -5
- data/lib/generators/automation/templates/pdp.tt +1 -9
- data/lib/generators/common_generator.rb +0 -2
- data/lib/generators/generator.rb +12 -19
- data/lib/generators/helper_generator.rb +21 -19
- data/lib/generators/infrastructure/templates/azure_pipelines.tt +1 -1
- data/lib/generators/infrastructure/templates/github.tt +2 -3
- data/lib/generators/infrastructure/templates/github_appium.tt +0 -8
- data/lib/generators/invoke_generators.rb +4 -23
- data/lib/generators/menu_generator.rb +1 -9
- data/lib/generators/rspec/templates/accessibility_spec.tt +1 -9
- data/lib/generators/rspec/templates/spec.tt +8 -24
- data/lib/generators/template_renderer/partial_cache.rb +3 -1
- data/lib/generators/template_renderer.rb +1 -1
- data/lib/generators/templates/common/gemfile.tt +3 -10
- data/lib/generators/templates/common/git_ignore.tt +0 -5
- data/lib/generators/templates/common/partials/mobile_config.tt +3 -1
- data/lib/generators/templates/common/partials/web_config.tt +10 -1
- data/lib/generators/templates/common/rakefile.tt +0 -15
- data/lib/generators/templates/common/read_me.tt +357 -250
- data/lib/generators/templates/common/rubocop.tt +0 -2
- data/lib/generators/templates/helpers/driver_helper.tt +8 -0
- data/lib/generators/templates/helpers/gesture_helper.tt +78 -0
- data/lib/generators/templates/helpers/network_helper.tt +521 -0
- data/lib/generators/templates/helpers/partials/quit_driver.tt +0 -2
- data/lib/generators/templates/helpers/partials/screenshot.tt +0 -2
- data/lib/generators/templates/helpers/partials/selenium_driver.tt +5 -2
- data/lib/generators/templates/helpers/screenshot_helper.tt +490 -0
- data/lib/generators/templates/helpers/spec_helper.tt +39 -29
- data/lib/generators/templates/helpers/trace_helper.tt +240 -95
- data/lib/generators/templates/helpers/video_helper.tt +3 -8
- data/lib/ruby_raider/runtime/actionability.rb +129 -0
- data/lib/ruby_raider/runtime/actionable.rb +49 -0
- data/lib/ruby_raider/runtime/by_role.rb +55 -0
- data/lib/ruby_raider/runtime/config.rb +79 -0
- data/lib/ruby_raider/runtime/context.rb +38 -0
- data/lib/ruby_raider/runtime/errors.rb +69 -0
- data/lib/ruby_raider/runtime/finders.rb +73 -0
- data/lib/ruby_raider/runtime/js/actionability.js +134 -0
- data/lib/ruby_raider/runtime/js/role_engine.js +315 -0
- data/lib/ruby_raider/runtime/locator_converter.rb +72 -0
- data/lib/ruby_raider/runtime/matchers/base.rb +222 -0
- data/lib/ruby_raider/runtime/matchers/element.rb +183 -0
- data/lib/ruby_raider/runtime/matchers/page.rb +71 -0
- data/lib/ruby_raider/runtime/matchers/presence.rb +41 -0
- data/lib/ruby_raider/runtime/matchers/retrying_block.rb +104 -0
- data/lib/ruby_raider/runtime/observer.rb +170 -0
- data/lib/ruby_raider/runtime/role_finder.rb +83 -0
- data/lib/ruby_raider/runtime/rspec.rb +78 -0
- data/lib/ruby_raider/runtime/selectors.rb +60 -0
- data/lib/ruby_raider/runtime/strict.rb +142 -0
- data/lib/ruby_raider/runtime/wait.rb +84 -0
- data/lib/ruby_raider/runtime.rb +20 -0
- data/lib/scaffolding/name_normalizer.rb +1 -1
- data/lib/scaffolding/project_detector.rb +2 -28
- data/lib/scaffolding/scaffolding.rb +0 -20
- data/lib/scaffolding/templates/component.tt +0 -14
- data/lib/scaffolding/templates/page_object.tt +2 -14
- data/lib/scaffolding/templates/spec.tt +1 -9
- data/lib/utilities/utilities.rb +10 -8
- data/lib/version +1 -1
- data/ruby_raider.gemspec +2 -1
- data/sig/commands/scaffolding_commands.rbs +0 -2
- data/sig/commands/utility_commands.rbs +6 -0
- data/sig/generators/generator.rbs +0 -4
- data/sig/generators/helper_generator.rbs +0 -1
- data/sig/generators/menu_generator.rbs +0 -1
- data/sig/ruby_raider/runtime/actionability.rbs +25 -0
- data/sig/ruby_raider/runtime/actionable.rbs +13 -0
- data/sig/ruby_raider/runtime/by_role.rbs +15 -0
- data/sig/ruby_raider/runtime/config.rbs +26 -0
- data/sig/ruby_raider/runtime/context.rbs +12 -0
- data/sig/ruby_raider/runtime/errors.rbs +36 -0
- data/sig/ruby_raider/runtime/finders.rbs +26 -0
- data/sig/ruby_raider/runtime/locator_converter.rbs +21 -0
- data/sig/ruby_raider/runtime/matchers/base.rbs +64 -0
- data/sig/ruby_raider/runtime/matchers/element.rbs +78 -0
- data/sig/ruby_raider/runtime/matchers/page.rbs +38 -0
- data/sig/ruby_raider/runtime/matchers/presence.rbs +21 -0
- data/sig/ruby_raider/runtime/matchers/retrying_block.rbs +27 -0
- data/sig/ruby_raider/runtime/observer.rbs +46 -0
- data/sig/ruby_raider/runtime/role_finder.rbs +18 -0
- data/sig/ruby_raider/runtime/selectors.rbs +21 -0
- data/sig/ruby_raider/runtime/strict.rbs +35 -0
- data/sig/ruby_raider/runtime/wait.rbs +17 -0
- data/sig/ruby_raider/runtime.rbs +2 -0
- data/sig/scaffolding/project_detector.rbs +0 -4
- data/sig/scaffolding/scaffolding.rbs +0 -5
- data/sig/utilities/utilities.rbs +2 -1
- data/sig/vendor/selenium_webdriver.rbs +71 -0
- data/spec/commands/raider_commands_spec.rb +38 -3
- data/spec/commands/scaffolding_commands_spec.rb +27 -0
- data/spec/commands/utility_commands_spec.rb +53 -0
- data/spec/generators/gesture_helper_spec.rb +123 -0
- data/spec/generators/network_helper_spec.rb +634 -0
- data/spec/generators/screenshot_helper_spec.rb +776 -0
- data/spec/generators/template_renderer_spec.rb +0 -4
- data/spec/generators/trace_helper_spec.rb +489 -97
- data/spec/generators/video_helper_spec.rb +0 -9
- data/spec/integration/commands/browser_update_after_creation_spec.rb +0 -8
- data/spec/integration/commands/scaffolding_commands_spec.rb +12 -70
- data/spec/integration/commands/utility_commands_spec.rb +19 -41
- data/spec/integration/content/azure_content_spec.rb +2 -6
- data/spec/integration/content/ci_content_spec.rb +1 -55
- data/spec/integration/content/common_content_spec.rb +1 -118
- data/spec/integration/content/config_content_spec.rb +34 -31
- data/spec/integration/content/gemfile_content_spec.rb +7 -72
- data/spec/integration/content/helper_content_spec.rb +105 -99
- data/spec/integration/content/page_content_spec.rb +85 -87
- data/spec/integration/content/readme_content_spec.rb +134 -75
- data/spec/integration/content/rspec_reporter_content_spec.rb +2 -2
- data/spec/integration/content/rubocop_content_spec.rb +1 -1
- data/spec/integration/content/syntax_validation_spec.rb +2 -2
- data/spec/integration/content/test_content_spec.rb +23 -147
- data/spec/integration/end_to_end_features_spec.rb +1 -43
- data/spec/integration/end_to_end_spec.rb +319 -326
- data/spec/integration/generators/automation_generator_spec.rb +3 -37
- data/spec/integration/generators/axe_addon_spec.rb +2 -35
- data/spec/integration/generators/azure_generator_spec.rb +1 -1
- data/spec/integration/generators/common_generator_spec.rb +1 -40
- data/spec/integration/generators/config_features_spec.rb +1 -24
- data/spec/integration/generators/github_generator_spec.rb +0 -12
- data/spec/integration/generators/helpers_generator_spec.rb +74 -80
- data/spec/integration/generators/invoke_generators_spec.rb +54 -45
- data/spec/integration/generators/rspec_generator_spec.rb +0 -6
- data/spec/integration/scaffolding_e2e_spec.rb +17 -179
- data/spec/integration/spec_helper.rb +4 -6
- data/spec/integration/trace_format_checker.rb +11 -2
- data/spec/integration/trace_page_server.rb +72 -5
- data/spec/menus/menu_generator_spec.rb +14 -39
- data/spec/runtime/actionability_spec.rb +207 -0
- data/spec/runtime/actionable_spec.rb +125 -0
- data/spec/runtime/browser/actionability_script_browser_spec.rb +150 -0
- data/spec/runtime/browser/actionable_browser_spec.rb +98 -0
- data/spec/runtime/browser/finders_browser_spec.rb +148 -0
- data/spec/runtime/browser/matchers_browser_spec.rb +67 -0
- data/spec/runtime/browser/retrying_block_browser_spec.rb +37 -0
- data/spec/runtime/browser/role_engine_browser_spec.rb +184 -0
- data/spec/runtime/browser/strict_browser_spec.rb +38 -0
- data/spec/runtime/by_role_spec.rb +52 -0
- data/spec/runtime/config_spec.rb +79 -0
- data/spec/runtime/context_spec.rb +73 -0
- data/spec/runtime/errors_spec.rb +89 -0
- data/spec/runtime/finders_spec.rb +165 -0
- data/spec/runtime/fixtures/actionability.html +70 -0
- data/spec/runtime/fixtures/locators.html +46 -0
- data/spec/runtime/fixtures/matchers.html +33 -0
- data/spec/runtime/fixtures/roles.html +162 -0
- data/spec/runtime/matchers/base_spec.rb +165 -0
- data/spec/runtime/matchers/element_spec.rb +277 -0
- data/spec/runtime/matchers/page_spec.rb +102 -0
- data/spec/runtime/matchers/presence_spec.rb +59 -0
- data/spec/runtime/matchers/retrying_block_spec.rb +165 -0
- data/spec/runtime/observer_spec.rb +341 -0
- data/spec/runtime/role_finder_spec.rb +156 -0
- data/spec/runtime/role_query_spec.rb +75 -0
- data/spec/runtime/selectors_spec.rb +135 -0
- data/spec/runtime/strict_spec.rb +257 -0
- data/spec/runtime/support/browser.rb +48 -0
- data/spec/runtime/support/fake_bridge.rb +117 -0
- data/spec/runtime/wait_spec.rb +71 -0
- data/spec/scaffolding/name_normalizer_spec.rb +3 -2
- data/spec/scaffolding/scaffold_project_detector_spec.rb +4 -43
- data/spec/system/selenium_spec.rb +1 -5
- data/spec/system/support/system_test_helper.rb +2 -5
- data/spec/utilities/headless_config_spec.rb +0 -7
- data/spec/utilities/utilities_spec.rb +24 -0
- metadata +113 -48
- data/lib/generators/automation/templates/header.tt +0 -9
- data/lib/generators/cucumber/cucumber_generator.rb +0 -58
- data/lib/generators/cucumber/templates/accessibility_feature.tt +0 -5
- data/lib/generators/cucumber/templates/accessibility_steps.tt +0 -17
- data/lib/generators/cucumber/templates/cucumber.tt +0 -1
- data/lib/generators/cucumber/templates/env.tt +0 -7
- data/lib/generators/cucumber/templates/feature.tt +0 -21
- data/lib/generators/cucumber/templates/partials/appium_env.tt +0 -26
- data/lib/generators/cucumber/templates/partials/driver_world.tt +0 -18
- data/lib/generators/cucumber/templates/partials/mobile_steps.tt +0 -20
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +0 -120
- data/lib/generators/cucumber/templates/partials/watir_env.tt +0 -48
- data/lib/generators/cucumber/templates/partials/watir_world.tt +0 -4
- data/lib/generators/cucumber/templates/partials/web_steps.tt +0 -28
- data/lib/generators/cucumber/templates/steps.tt +0 -5
- data/lib/generators/cucumber/templates/user_factory.tt +0 -15
- data/lib/generators/cucumber/templates/world.tt +0 -7
- data/lib/generators/templates/helpers/browser_helper.tt +0 -31
- data/lib/generators/templates/helpers/raider_element.tt +0 -159
- data/lib/generators/templates/helpers/wait_helper.tt +0 -611
- data/lib/scaffolding/templates/feature.tt +0 -6
- data/lib/scaffolding/templates/steps.tt +0 -19
- data/sig/generators/cucumber/cucumber_generator.rbs +0 -12
- data/spec/fixtures/watir_master/cucumber_watir/Readme.md.snapshot +0 -175
- data/spec/fixtures/watir_master/cucumber_watir/features/step_definitions/login_steps.rb.snapshot +0 -24
- data/spec/fixtures/watir_master/cucumber_watir/page_objects/abstract/page.rb.snapshot +0 -37
- data/spec/fixtures/watir_master/cucumber_watir/page_objects/pages/login.rb.snapshot +0 -33
- data/spec/fixtures/watir_master/rspec_watir/Readme.md.snapshot +0 -174
- data/spec/fixtures/watir_master/rspec_watir/page_objects/abstract/page.rb.snapshot +0 -37
- data/spec/fixtures/watir_master/rspec_watir/page_objects/pages/login.rb.snapshot +0 -33
- data/spec/fixtures/watir_master/rspec_watir/spec/login_page_spec.rb.snapshot +0 -49
- data/spec/integration/content/cucumber_reporter_content_spec.rb +0 -161
- data/spec/integration/generators/cucumber_generator_spec.rb +0 -100
- data/spec/integration/helpers/wait_helper_mobile_spec.rb +0 -281
- data/spec/integration/helpers/wait_helper_spec.rb +0 -679
- data/spec/integration/helpers/wait_helper_support.rb +0 -183
- data/spec/system/watir_spec.rb +0 -38
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rspec'
|
|
4
|
+
require_relative '../../lib/ruby_raider/runtime/wait'
|
|
5
|
+
|
|
6
|
+
RSpec.describe 'Raider::Wait' do
|
|
7
|
+
after { Raider.reset }
|
|
8
|
+
|
|
9
|
+
def clock
|
|
10
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe '.until' do
|
|
14
|
+
it 'returns the block value' do
|
|
15
|
+
expect(Raider::Wait.until(timeout: 1) { :ready }).to eq(:ready)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'polls until the block succeeds' do
|
|
19
|
+
calls = 0
|
|
20
|
+
result = Raider::Wait.until(timeout: 1, interval: 0) { (calls += 1) >= 3 && calls }
|
|
21
|
+
expect([result, calls]).to eq([3, 3])
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'raises with the thrown reason on the deadline' do
|
|
25
|
+
expect { Raider::Wait.until(timeout: 0.05, interval: 0) { throw :not_ready, 'still moving' } }
|
|
26
|
+
.to raise_error(Raider::TimeoutError, 'still moving')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it 'raises a default reason when nothing was thrown' do
|
|
30
|
+
expect { Raider::Wait.until(timeout: 0.05, interval: 0) { false } }
|
|
31
|
+
.to raise_error(Raider::TimeoutError, 'condition not met')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'uses Raider.timeout when none is given' do
|
|
35
|
+
Raider.timeout = 0.05
|
|
36
|
+
expect { Raider::Wait.until(interval: 0) { nil } }.to raise_error(Raider::TimeoutError)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'restores the deadline afterwards' do
|
|
40
|
+
Raider::Wait.until(timeout: 1) { Raider::Wait.deadline }
|
|
41
|
+
expect(Raider::Wait.deadline).to be_nil
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
describe 'eventually' do
|
|
46
|
+
it 'is gone' do
|
|
47
|
+
expect(Raider.respond_to?(:eventually)).to be(false)
|
|
48
|
+
expect(Raider::Wait.respond_to?(:eventually)).to be(false)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe '.immediately' do
|
|
53
|
+
it 'returns the block value and flags the block as immediate' do
|
|
54
|
+
expect(Raider::Wait.immediate?).to be(false)
|
|
55
|
+
expect(Raider::Wait.immediately { Raider::Wait.immediate? }).to be(true)
|
|
56
|
+
expect(Raider::Wait.immediate?).to be(false)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
it 'stays immediate when an inner call leaves' do
|
|
60
|
+
Raider::Wait.immediately do
|
|
61
|
+
Raider::Wait.immediately { :inner }
|
|
62
|
+
expect(Raider::Wait.immediate?).to be(true)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'restores the flag when the block raises' do
|
|
67
|
+
expect { Raider::Wait.immediately { raise ArgumentError } }.to raise_error(ArgumentError)
|
|
68
|
+
expect(Raider::Wait.immediate?).to be(false)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -12,8 +12,9 @@ RSpec.describe NameNormalizer do
|
|
|
12
12
|
expect(described_class.normalize('login_spec')).to eq('login')
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
it '
|
|
16
|
-
expect(described_class.normalize('login_steps')).to eq('
|
|
15
|
+
it 'keeps a _steps or _feature ending' do
|
|
16
|
+
expect(described_class.normalize('login_steps')).to eq('login_steps')
|
|
17
|
+
expect(described_class.normalize('login_feature')).to eq('login_feature')
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
it 'strips _helper suffix' do
|
|
@@ -26,42 +26,15 @@ RSpec.describe ScaffoldProjectDetector do
|
|
|
26
26
|
expect(described_class.detect_automation).to eq('selenium')
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
it 'detects rspec framework' do
|
|
30
|
-
expect(described_class.detect_framework).to eq('rspec')
|
|
31
|
-
end
|
|
32
|
-
|
|
33
29
|
it 'reports selenium?' do
|
|
34
30
|
expect(described_class.selenium?).to be true
|
|
35
31
|
end
|
|
36
32
|
end
|
|
37
33
|
|
|
38
|
-
context 'with watir project' do
|
|
39
|
-
before do
|
|
40
|
-
File.write('Gemfile', "gem 'watir'\ngem 'rspec'\n")
|
|
41
|
-
FileUtils.mkdir_p('spec')
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it 'detects watir automation' do
|
|
45
|
-
expect(described_class.detect_automation).to eq('watir')
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
it 'detects rspec framework' do
|
|
49
|
-
expect(described_class.detect_framework).to eq('rspec')
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it 'reports watir?' do
|
|
53
|
-
expect(described_class.watir?).to be true
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
34
|
context 'with no Gemfile' do
|
|
58
35
|
it 'defaults to selenium' do
|
|
59
36
|
expect(described_class.detect_automation).to eq('selenium')
|
|
60
37
|
end
|
|
61
|
-
|
|
62
|
-
it 'defaults to rspec' do
|
|
63
|
-
expect(described_class.detect_framework).to eq('rspec')
|
|
64
|
-
end
|
|
65
38
|
end
|
|
66
39
|
|
|
67
40
|
describe '.validate_project' do
|
|
@@ -84,16 +57,8 @@ RSpec.describe ScaffoldProjectDetector do
|
|
|
84
57
|
end
|
|
85
58
|
end
|
|
86
59
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
FileUtils.mkdir_p('helpers')
|
|
90
|
-
File.write('helpers/wait_helper.rb', "# frozen_string_literal: true\n")
|
|
91
|
-
expect(described_class.wait_helper?).to be true
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'is false when the file does not exist' do
|
|
95
|
-
expect(described_class.wait_helper?).to be false
|
|
96
|
-
end
|
|
60
|
+
it 'no longer detects a wait helper' do
|
|
61
|
+
expect(described_class).not_to respond_to(:wait_helper?)
|
|
97
62
|
end
|
|
98
63
|
|
|
99
64
|
describe '.config' do
|
|
@@ -120,12 +85,8 @@ RSpec.describe ScaffoldProjectDetector do
|
|
|
120
85
|
FileUtils.mkdir_p('spec')
|
|
121
86
|
end
|
|
122
87
|
|
|
123
|
-
it 'returns
|
|
124
|
-
|
|
125
|
-
expect(result[:automation]).to eq('selenium')
|
|
126
|
-
expect(result[:framework]).to eq('rspec')
|
|
127
|
-
expect(result[:has_spec]).to be true
|
|
128
|
-
expect(result[:has_features]).to be false
|
|
88
|
+
it 'returns the automation and whether there is a spec folder, and nothing else' do
|
|
89
|
+
expect(described_class.detect).to eq(automation: 'selenium', has_spec: true)
|
|
129
90
|
end
|
|
130
91
|
end
|
|
131
92
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require_relative '../../lib/ruby_raider'
|
|
4
4
|
require_relative 'support/system_test_helper'
|
|
5
5
|
|
|
6
|
-
FRAMEWORKS = %w[
|
|
6
|
+
FRAMEWORKS = %w[rspec].freeze
|
|
7
7
|
|
|
8
8
|
describe 'Selenium based frameworks' do
|
|
9
9
|
include SystemTestHelper
|
|
@@ -31,8 +31,4 @@ describe 'Selenium based frameworks' do
|
|
|
31
31
|
context 'with rspec' do
|
|
32
32
|
include_examples 'runs tests successfully', 'rspec'
|
|
33
33
|
end
|
|
34
|
-
|
|
35
|
-
context 'with cucumber' do
|
|
36
|
-
include_examples 'runs tests successfully', 'cucumber'
|
|
37
|
-
end
|
|
38
34
|
end
|
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
require 'open3'
|
|
4
4
|
|
|
5
5
|
module SystemTestHelper
|
|
6
|
-
def test_command_for(
|
|
7
|
-
|
|
8
|
-
when 'cucumber' then 'bundle exec cucumber features --format pretty'
|
|
9
|
-
else 'bundle exec rspec spec --format documentation'
|
|
10
|
-
end
|
|
6
|
+
def test_command_for(_framework)
|
|
7
|
+
'bundle exec rspec spec --format documentation'
|
|
11
8
|
end
|
|
12
9
|
|
|
13
10
|
def run_tests_with(framework, automation)
|
|
@@ -31,13 +31,6 @@ RSpec.describe 'Headless config support in driver templates' do
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
describe 'browser helper template (watir)' do
|
|
35
|
-
it 'checks config headless key' do
|
|
36
|
-
content = File.read(File.expand_path('../../lib/generators/templates/helpers/browser_helper.tt', __dir__))
|
|
37
|
-
expect(content).to include("config['headless']")
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
34
|
describe 'headless via config.yml' do
|
|
42
35
|
it 'config key is used when YAML has headless: true' do
|
|
43
36
|
FileUtils.mkdir_p('config')
|
|
@@ -104,6 +104,30 @@ RSpec.describe Utilities do
|
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
+
describe '.strict=' do
|
|
108
|
+
it 'sets strict to false' do
|
|
109
|
+
described_class.strict = false
|
|
110
|
+
expect(YAML.load_file(config_path)['strict']).to be false
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
it 'sets strict to true' do
|
|
114
|
+
described_class.strict = true
|
|
115
|
+
expect(YAML.load_file(config_path)['strict']).to be true
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
describe '.actionability=' do
|
|
120
|
+
it 'sets actionability to true' do
|
|
121
|
+
described_class.actionability = true
|
|
122
|
+
expect(YAML.load_file(config_path)['actionability']).to be true
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
it 'sets actionability to false' do
|
|
126
|
+
described_class.actionability = false
|
|
127
|
+
expect(YAML.load_file(config_path)['actionability']).to be false
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
107
131
|
describe '.viewport=' do
|
|
108
132
|
it 'sets viewport dimensions' do
|
|
109
133
|
described_class.viewport = '375x812'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_raider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Agustin Pequeno
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler-audit
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0.9'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: chunky_png
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.4'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.4'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: rake
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -143,33 +157,39 @@ dependencies:
|
|
|
143
157
|
- !ruby/object:Gem::Version
|
|
144
158
|
version: '4'
|
|
145
159
|
- !ruby/object:Gem::Dependency
|
|
146
|
-
name:
|
|
160
|
+
name: steep
|
|
147
161
|
requirement: !ruby/object:Gem::Requirement
|
|
148
162
|
requirements:
|
|
149
163
|
- - "~>"
|
|
150
164
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '
|
|
165
|
+
version: '1.9'
|
|
152
166
|
type: :development
|
|
153
167
|
prerelease: false
|
|
154
168
|
version_requirements: !ruby/object:Gem::Requirement
|
|
155
169
|
requirements:
|
|
156
170
|
- - "~>"
|
|
157
171
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '
|
|
172
|
+
version: '1.9'
|
|
159
173
|
- !ruby/object:Gem::Dependency
|
|
160
|
-
name:
|
|
174
|
+
name: selenium-webdriver
|
|
161
175
|
requirement: !ruby/object:Gem::Requirement
|
|
162
176
|
requirements:
|
|
163
|
-
- - "
|
|
177
|
+
- - ">="
|
|
164
178
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '
|
|
166
|
-
|
|
179
|
+
version: '4.30'
|
|
180
|
+
- - "<"
|
|
181
|
+
- !ruby/object:Gem::Version
|
|
182
|
+
version: '5'
|
|
183
|
+
type: :runtime
|
|
167
184
|
prerelease: false
|
|
168
185
|
version_requirements: !ruby/object:Gem::Requirement
|
|
169
186
|
requirements:
|
|
170
|
-
- - "
|
|
187
|
+
- - ">="
|
|
171
188
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: '
|
|
189
|
+
version: '4.30'
|
|
190
|
+
- - "<"
|
|
191
|
+
- !ruby/object:Gem::Version
|
|
192
|
+
version: '5'
|
|
173
193
|
- !ruby/object:Gem::Dependency
|
|
174
194
|
name: thor
|
|
175
195
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -214,11 +234,13 @@ files:
|
|
|
214
234
|
- ".github/workflows/reek.yml"
|
|
215
235
|
- ".github/workflows/release.yml"
|
|
216
236
|
- ".github/workflows/rubocop.yml"
|
|
237
|
+
- ".github/workflows/runtime.yml"
|
|
217
238
|
- ".github/workflows/security.yml"
|
|
218
239
|
- ".github/workflows/steep.yml"
|
|
219
240
|
- ".github/workflows/system_tests.yml"
|
|
220
241
|
- ".gitignore"
|
|
221
242
|
- ".reek.yml"
|
|
243
|
+
- ".rspec"
|
|
222
244
|
- ".rubocop.yml"
|
|
223
245
|
- ".ruby-version"
|
|
224
246
|
- CODE_OF_CONDUCT.md
|
|
@@ -244,7 +266,6 @@ files:
|
|
|
244
266
|
- lib/generators/automation/templates/account.tt
|
|
245
267
|
- lib/generators/automation/templates/appium_caps.tt
|
|
246
268
|
- lib/generators/automation/templates/component.tt
|
|
247
|
-
- lib/generators/automation/templates/header.tt
|
|
248
269
|
- lib/generators/automation/templates/home.tt
|
|
249
270
|
- lib/generators/automation/templates/login.tt
|
|
250
271
|
- lib/generators/automation/templates/page.tt
|
|
@@ -256,22 +277,6 @@ files:
|
|
|
256
277
|
- lib/generators/automation/templates/partials/visit_method.tt
|
|
257
278
|
- lib/generators/automation/templates/pdp.tt
|
|
258
279
|
- lib/generators/common_generator.rb
|
|
259
|
-
- lib/generators/cucumber/cucumber_generator.rb
|
|
260
|
-
- lib/generators/cucumber/templates/accessibility_feature.tt
|
|
261
|
-
- lib/generators/cucumber/templates/accessibility_steps.tt
|
|
262
|
-
- lib/generators/cucumber/templates/cucumber.tt
|
|
263
|
-
- lib/generators/cucumber/templates/env.tt
|
|
264
|
-
- lib/generators/cucumber/templates/feature.tt
|
|
265
|
-
- lib/generators/cucumber/templates/partials/appium_env.tt
|
|
266
|
-
- lib/generators/cucumber/templates/partials/driver_world.tt
|
|
267
|
-
- lib/generators/cucumber/templates/partials/mobile_steps.tt
|
|
268
|
-
- lib/generators/cucumber/templates/partials/selenium_env.tt
|
|
269
|
-
- lib/generators/cucumber/templates/partials/watir_env.tt
|
|
270
|
-
- lib/generators/cucumber/templates/partials/watir_world.tt
|
|
271
|
-
- lib/generators/cucumber/templates/partials/web_steps.tt
|
|
272
|
-
- lib/generators/cucumber/templates/steps.tt
|
|
273
|
-
- lib/generators/cucumber/templates/user_factory.tt
|
|
274
|
-
- lib/generators/cucumber/templates/world.tt
|
|
275
280
|
- lib/generators/generator.rb
|
|
276
281
|
- lib/generators/helper_generator.rb
|
|
277
282
|
- lib/generators/infrastructure/azure_generator.rb
|
|
@@ -301,31 +306,51 @@ files:
|
|
|
301
306
|
- lib/generators/templates/common/rspec.tt
|
|
302
307
|
- lib/generators/templates/common/rubocop.tt
|
|
303
308
|
- lib/generators/templates/helpers/appium_helper.tt
|
|
304
|
-
- lib/generators/templates/helpers/browser_helper.tt
|
|
305
309
|
- lib/generators/templates/helpers/driver_helper.tt
|
|
310
|
+
- lib/generators/templates/helpers/gesture_helper.tt
|
|
311
|
+
- lib/generators/templates/helpers/network_helper.tt
|
|
306
312
|
- lib/generators/templates/helpers/partials/appium_driver.tt
|
|
307
313
|
- lib/generators/templates/helpers/partials/browserstack_config.tt
|
|
308
314
|
- lib/generators/templates/helpers/partials/driver_and_options.tt
|
|
309
315
|
- lib/generators/templates/helpers/partials/quit_driver.tt
|
|
310
316
|
- lib/generators/templates/helpers/partials/screenshot.tt
|
|
311
317
|
- lib/generators/templates/helpers/partials/selenium_driver.tt
|
|
312
|
-
- lib/generators/templates/helpers/
|
|
318
|
+
- lib/generators/templates/helpers/screenshot_helper.tt
|
|
313
319
|
- lib/generators/templates/helpers/session_state.tt
|
|
314
320
|
- lib/generators/templates/helpers/spec_helper.tt
|
|
315
321
|
- lib/generators/templates/helpers/trace_helper.tt
|
|
316
322
|
- lib/generators/templates/helpers/video_helper.tt
|
|
317
|
-
- lib/generators/templates/helpers/wait_helper.tt
|
|
318
323
|
- lib/ruby_raider.rb
|
|
319
324
|
- lib/ruby_raider/ffmpeg.rb
|
|
325
|
+
- lib/ruby_raider/runtime.rb
|
|
326
|
+
- lib/ruby_raider/runtime/actionability.rb
|
|
327
|
+
- lib/ruby_raider/runtime/actionable.rb
|
|
328
|
+
- lib/ruby_raider/runtime/by_role.rb
|
|
329
|
+
- lib/ruby_raider/runtime/config.rb
|
|
330
|
+
- lib/ruby_raider/runtime/context.rb
|
|
331
|
+
- lib/ruby_raider/runtime/errors.rb
|
|
332
|
+
- lib/ruby_raider/runtime/finders.rb
|
|
333
|
+
- lib/ruby_raider/runtime/js/actionability.js
|
|
334
|
+
- lib/ruby_raider/runtime/js/role_engine.js
|
|
335
|
+
- lib/ruby_raider/runtime/locator_converter.rb
|
|
336
|
+
- lib/ruby_raider/runtime/matchers/base.rb
|
|
337
|
+
- lib/ruby_raider/runtime/matchers/element.rb
|
|
338
|
+
- lib/ruby_raider/runtime/matchers/page.rb
|
|
339
|
+
- lib/ruby_raider/runtime/matchers/presence.rb
|
|
340
|
+
- lib/ruby_raider/runtime/matchers/retrying_block.rb
|
|
341
|
+
- lib/ruby_raider/runtime/observer.rb
|
|
342
|
+
- lib/ruby_raider/runtime/role_finder.rb
|
|
343
|
+
- lib/ruby_raider/runtime/rspec.rb
|
|
344
|
+
- lib/ruby_raider/runtime/selectors.rb
|
|
345
|
+
- lib/ruby_raider/runtime/strict.rb
|
|
346
|
+
- lib/ruby_raider/runtime/wait.rb
|
|
320
347
|
- lib/scaffolding/name_normalizer.rb
|
|
321
348
|
- lib/scaffolding/project_detector.rb
|
|
322
349
|
- lib/scaffolding/scaffolding.rb
|
|
323
350
|
- lib/scaffolding/templates/component.tt
|
|
324
|
-
- lib/scaffolding/templates/feature.tt
|
|
325
351
|
- lib/scaffolding/templates/helper.tt
|
|
326
352
|
- lib/scaffolding/templates/page_object.tt
|
|
327
353
|
- lib/scaffolding/templates/spec.tt
|
|
328
|
-
- lib/scaffolding/templates/steps.tt
|
|
329
354
|
- lib/utilities/desktop_downloader.rb
|
|
330
355
|
- lib/utilities/logger.rb
|
|
331
356
|
- lib/utilities/logo.rb
|
|
@@ -337,7 +362,6 @@ files:
|
|
|
337
362
|
- sig/commands/utility_commands.rbs
|
|
338
363
|
- sig/generators/automation/automation_generator.rbs
|
|
339
364
|
- sig/generators/common_generator.rbs
|
|
340
|
-
- sig/generators/cucumber/cucumber_generator.rbs
|
|
341
365
|
- sig/generators/generator.rbs
|
|
342
366
|
- sig/generators/helper_generator.rbs
|
|
343
367
|
- sig/generators/infrastructure/azure_generator.rbs
|
|
@@ -351,6 +375,25 @@ files:
|
|
|
351
375
|
- sig/generators/template_renderer/template_error.rbs
|
|
352
376
|
- sig/ruby_raider.rbs
|
|
353
377
|
- sig/ruby_raider/ffmpeg.rbs
|
|
378
|
+
- sig/ruby_raider/runtime.rbs
|
|
379
|
+
- sig/ruby_raider/runtime/actionability.rbs
|
|
380
|
+
- sig/ruby_raider/runtime/actionable.rbs
|
|
381
|
+
- sig/ruby_raider/runtime/by_role.rbs
|
|
382
|
+
- sig/ruby_raider/runtime/config.rbs
|
|
383
|
+
- sig/ruby_raider/runtime/context.rbs
|
|
384
|
+
- sig/ruby_raider/runtime/errors.rbs
|
|
385
|
+
- sig/ruby_raider/runtime/finders.rbs
|
|
386
|
+
- sig/ruby_raider/runtime/locator_converter.rbs
|
|
387
|
+
- sig/ruby_raider/runtime/matchers/base.rbs
|
|
388
|
+
- sig/ruby_raider/runtime/matchers/element.rbs
|
|
389
|
+
- sig/ruby_raider/runtime/matchers/page.rbs
|
|
390
|
+
- sig/ruby_raider/runtime/matchers/presence.rbs
|
|
391
|
+
- sig/ruby_raider/runtime/matchers/retrying_block.rbs
|
|
392
|
+
- sig/ruby_raider/runtime/observer.rbs
|
|
393
|
+
- sig/ruby_raider/runtime/role_finder.rbs
|
|
394
|
+
- sig/ruby_raider/runtime/selectors.rbs
|
|
395
|
+
- sig/ruby_raider/runtime/strict.rbs
|
|
396
|
+
- sig/ruby_raider/runtime/wait.rbs
|
|
354
397
|
- sig/scaffolding/name_normalizer.rbs
|
|
355
398
|
- sig/scaffolding/project_detector.rbs
|
|
356
399
|
- sig/scaffolding/scaffolding.rbs
|
|
@@ -358,21 +401,18 @@ files:
|
|
|
358
401
|
- sig/utilities/logger.rbs
|
|
359
402
|
- sig/utilities/logo.rbs
|
|
360
403
|
- sig/utilities/utilities.rbs
|
|
404
|
+
- sig/vendor/selenium_webdriver.rbs
|
|
361
405
|
- sig/vendor/thor.rbs
|
|
362
406
|
- sig/vendor/tty_prompt.rbs
|
|
363
407
|
- spec/commands/raider_commands_spec.rb
|
|
364
408
|
- spec/commands/scaffolding_commands_spec.rb
|
|
365
|
-
- spec/
|
|
366
|
-
- spec/fixtures/watir_master/cucumber_watir/features/step_definitions/login_steps.rb.snapshot
|
|
367
|
-
- spec/fixtures/watir_master/cucumber_watir/page_objects/abstract/page.rb.snapshot
|
|
368
|
-
- spec/fixtures/watir_master/cucumber_watir/page_objects/pages/login.rb.snapshot
|
|
369
|
-
- spec/fixtures/watir_master/rspec_watir/Readme.md.snapshot
|
|
370
|
-
- spec/fixtures/watir_master/rspec_watir/page_objects/abstract/page.rb.snapshot
|
|
371
|
-
- spec/fixtures/watir_master/rspec_watir/page_objects/pages/login.rb.snapshot
|
|
372
|
-
- spec/fixtures/watir_master/rspec_watir/spec/login_page_spec.rb.snapshot
|
|
409
|
+
- spec/commands/utility_commands_spec.rb
|
|
373
410
|
- spec/generators/fixtures/templates/test.tt
|
|
374
411
|
- spec/generators/fixtures/templates/test_partial.tt
|
|
375
412
|
- spec/generators/fixtures/video_helper_stubs/selenium-webdriver.rb
|
|
413
|
+
- spec/generators/gesture_helper_spec.rb
|
|
414
|
+
- spec/generators/network_helper_spec.rb
|
|
415
|
+
- spec/generators/screenshot_helper_spec.rb
|
|
376
416
|
- spec/generators/template_renderer_spec.rb
|
|
377
417
|
- spec/generators/trace_helper_spec.rb
|
|
378
418
|
- spec/generators/video_helper_spec.rb
|
|
@@ -384,7 +424,6 @@ files:
|
|
|
384
424
|
- spec/integration/content/common_content_spec.rb
|
|
385
425
|
- spec/integration/content/config_content_spec.rb
|
|
386
426
|
- spec/integration/content/content_helper.rb
|
|
387
|
-
- spec/integration/content/cucumber_reporter_content_spec.rb
|
|
388
427
|
- spec/integration/content/gemfile_content_spec.rb
|
|
389
428
|
- spec/integration/content/helper_content_spec.rb
|
|
390
429
|
- spec/integration/content/page_content_spec.rb
|
|
@@ -401,27 +440,53 @@ files:
|
|
|
401
440
|
- spec/integration/generators/azure_generator_spec.rb
|
|
402
441
|
- spec/integration/generators/common_generator_spec.rb
|
|
403
442
|
- spec/integration/generators/config_features_spec.rb
|
|
404
|
-
- spec/integration/generators/cucumber_generator_spec.rb
|
|
405
443
|
- spec/integration/generators/github_generator_spec.rb
|
|
406
444
|
- spec/integration/generators/helpers_generator_spec.rb
|
|
407
445
|
- spec/integration/generators/invoke_generators_spec.rb
|
|
408
446
|
- spec/integration/generators/rspec_generator_spec.rb
|
|
409
447
|
- spec/integration/helpers/session_state_spec.rb
|
|
410
|
-
- spec/integration/helpers/wait_helper_mobile_spec.rb
|
|
411
|
-
- spec/integration/helpers/wait_helper_spec.rb
|
|
412
|
-
- spec/integration/helpers/wait_helper_support.rb
|
|
413
448
|
- spec/integration/scaffolding_e2e_spec.rb
|
|
414
449
|
- spec/integration/settings_helper.rb
|
|
415
450
|
- spec/integration/spec_helper.rb
|
|
416
451
|
- spec/integration/trace_format_checker.rb
|
|
417
452
|
- spec/integration/trace_page_server.rb
|
|
418
453
|
- spec/menus/menu_generator_spec.rb
|
|
454
|
+
- spec/runtime/actionability_spec.rb
|
|
455
|
+
- spec/runtime/actionable_spec.rb
|
|
456
|
+
- spec/runtime/browser/actionability_script_browser_spec.rb
|
|
457
|
+
- spec/runtime/browser/actionable_browser_spec.rb
|
|
458
|
+
- spec/runtime/browser/finders_browser_spec.rb
|
|
459
|
+
- spec/runtime/browser/matchers_browser_spec.rb
|
|
460
|
+
- spec/runtime/browser/retrying_block_browser_spec.rb
|
|
461
|
+
- spec/runtime/browser/role_engine_browser_spec.rb
|
|
462
|
+
- spec/runtime/browser/strict_browser_spec.rb
|
|
463
|
+
- spec/runtime/by_role_spec.rb
|
|
464
|
+
- spec/runtime/config_spec.rb
|
|
465
|
+
- spec/runtime/context_spec.rb
|
|
466
|
+
- spec/runtime/errors_spec.rb
|
|
467
|
+
- spec/runtime/finders_spec.rb
|
|
468
|
+
- spec/runtime/fixtures/actionability.html
|
|
469
|
+
- spec/runtime/fixtures/locators.html
|
|
470
|
+
- spec/runtime/fixtures/matchers.html
|
|
471
|
+
- spec/runtime/fixtures/roles.html
|
|
472
|
+
- spec/runtime/matchers/base_spec.rb
|
|
473
|
+
- spec/runtime/matchers/element_spec.rb
|
|
474
|
+
- spec/runtime/matchers/page_spec.rb
|
|
475
|
+
- spec/runtime/matchers/presence_spec.rb
|
|
476
|
+
- spec/runtime/matchers/retrying_block_spec.rb
|
|
477
|
+
- spec/runtime/observer_spec.rb
|
|
478
|
+
- spec/runtime/role_finder_spec.rb
|
|
479
|
+
- spec/runtime/role_query_spec.rb
|
|
480
|
+
- spec/runtime/selectors_spec.rb
|
|
481
|
+
- spec/runtime/strict_spec.rb
|
|
482
|
+
- spec/runtime/support/browser.rb
|
|
483
|
+
- spec/runtime/support/fake_bridge.rb
|
|
484
|
+
- spec/runtime/wait_spec.rb
|
|
419
485
|
- spec/scaffolding/name_normalizer_spec.rb
|
|
420
486
|
- spec/scaffolding/scaffold_project_detector_spec.rb
|
|
421
487
|
- spec/scaffolding/scaffolding_features_spec.rb
|
|
422
488
|
- spec/system/selenium_spec.rb
|
|
423
489
|
- spec/system/support/system_test_helper.rb
|
|
424
|
-
- spec/system/watir_spec.rb
|
|
425
490
|
- spec/utilities/desktop_downloader_spec.rb
|
|
426
491
|
- spec/utilities/ffmpeg_spec.rb
|
|
427
492
|
- spec/utilities/headless_config_spec.rb
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../generator'
|
|
4
|
-
|
|
5
|
-
class CucumberGenerator < Generator
|
|
6
|
-
def generate_feature
|
|
7
|
-
return unless examples?
|
|
8
|
-
|
|
9
|
-
template('feature.tt', "#{name}/features/#{template_name}.feature")
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def generate_steps
|
|
13
|
-
return unless examples?
|
|
14
|
-
|
|
15
|
-
template('steps.tt', "#{name}/features/step_definitions/#{template_name}_steps.rb")
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# A skeleton keeps an empty step_definitions/ for the steps it will grow with `raider g steps`
|
|
19
|
-
def generate_empty_steps_folder
|
|
20
|
-
return if examples?
|
|
21
|
-
|
|
22
|
-
create_file("#{name}/features/step_definitions/.keep", '')
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def generate_user_factory
|
|
26
|
-
return unless examples?
|
|
27
|
-
|
|
28
|
-
template('user_factory.tt', "#{name}/models/user_factory.rb")
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def generate_env_file
|
|
32
|
-
template('env.tt', "#{name}/features/support/env.rb")
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def generate_world
|
|
36
|
-
template('world.tt', "#{name}/features/support/world.rb")
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def generate_cucumber_file
|
|
40
|
-
template('cucumber.tt', "#{name}/cucumber.yml")
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def generate_accessibility_feature
|
|
44
|
-
return unless axe_addon? && web? && examples?
|
|
45
|
-
|
|
46
|
-
template('accessibility_feature.tt', "#{name}/features/accessibility.feature")
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def generate_accessibility_steps
|
|
50
|
-
return unless axe_addon? && web? && examples?
|
|
51
|
-
|
|
52
|
-
template('accessibility_steps.tt', "#{name}/features/step_definitions/accessibility_steps.rb")
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def template_name
|
|
56
|
-
@template_name ||= mobile? ? 'home' : 'login'
|
|
57
|
-
end
|
|
58
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Given('I am on the home page') do
|
|
4
|
-
<%- if watir? -%>
|
|
5
|
-
browser.goto 'https://raider-test-site.onrender.com/'
|
|
6
|
-
<%- else -%>
|
|
7
|
-
driver.get 'https://raider-test-site.onrender.com/'
|
|
8
|
-
<%- end -%>
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
Then('the page should be accessible') do
|
|
12
|
-
<%- if watir? -%>
|
|
13
|
-
expect(browser.driver).to be_axe_clean
|
|
14
|
-
<%- else -%>
|
|
15
|
-
expect(driver).to be_axe_clean
|
|
16
|
-
<%- end -%>
|
|
17
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
default: --format pretty --format rerun --out rerun.txt --publish-quiet --retry 0
|