ruby_raider 0.4.1 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -6
- data/README.md +6 -0
- data/lib/commands/scaffolding_commands.rb +2 -2
- data/lib/commands/utility_commands.rb +8 -0
- data/lib/generators/automation_generator.rb +7 -7
- data/lib/generators/common_generator.rb +2 -0
- data/lib/generators/cucumber_generator.rb +1 -1
- data/lib/generators/helper_generator.rb +6 -0
- data/lib/generators/menu_generator.rb +9 -5
- data/lib/generators/rspec_generator.rb +2 -2
- data/lib/generators/templates/automation/abstract_page.tt +4 -0
- data/lib/generators/templates/automation/appium_caps.tt +7 -0
- data/lib/generators/templates/automation/home_page.tt +1 -5
- data/lib/generators/templates/automation/partials/android_caps.tt +5 -0
- data/lib/generators/templates/automation/partials/cross_platform_caps.tt +14 -0
- data/lib/generators/templates/automation/partials/home_page_selector.tt +8 -0
- data/lib/generators/templates/automation/partials/ios_caps.tt +6 -0
- data/lib/generators/templates/automation/partials/pdp_page_selector.tt +8 -0
- data/lib/generators/templates/automation/pdp_page.tt +1 -5
- data/lib/generators/templates/common/config.tt +5 -2
- data/lib/generators/templates/common/partials/mobile_config.tt +1 -0
- data/lib/generators/templates/common/partials/web_config.tt +2 -0
- data/lib/generators/templates/common/read_me.tt +4 -0
- data/lib/generators/templates/helpers/appium_helper.tt +29 -0
- data/lib/generators/templates/helpers/driver_helper.tt +15 -2
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +8 -5
- data/lib/generators/templates/helpers/raider_helper.tt +3 -0
- data/lib/utilities/utilities.rb +5 -0
- data/ruby_raider.gemspec +2 -1
- data/spec/automation_generator_spec.rb +33 -150
- data/spec/common_generator_spec.rb +58 -105
- data/spec/cucumber_generator_spec.rb +18 -53
- data/spec/helpers_generator_spec.rb +73 -90
- data/spec/rspec_generator_spec.rb +15 -61
- data/spec/scaffolding_commands_spec.rb +162 -0
- data/spec/spec_helper.rb +20 -0
- metadata +26 -6
- data/lib/generators/templates/automation/appium_settings.tt +0 -5
- data/lib/generators/templates/automation/partials/android_settings.tt +0 -8
- data/lib/generators/templates/automation/partials/ios_settings.tt +0 -8
- data/spec/scaffolding_spec.rb +0 -234
@@ -4,122 +4,105 @@ require_relative '../lib/generators/helper_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe HelpersGenerator do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@name = 'rspec-selenium'
|
10
|
-
HelpersGenerator.new(['selenium', 'rspec', @name]).invoke_all
|
11
|
-
end
|
12
|
-
|
7
|
+
shared_examples 'creates common helpers' do |name|
|
13
8
|
it 'creates a raider file' do
|
14
|
-
expect(File.exist
|
9
|
+
expect(File).to exist("#{name}/helpers/raider.rb")
|
15
10
|
end
|
16
11
|
|
17
12
|
it 'creates an allure helper file' do
|
18
|
-
expect(File.exist
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'creates a driver helper file', :watir do
|
22
|
-
expect(File.exist?("#{@name}/helpers/driver_helper.rb")).to be_truthy
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'creates a spec helper file' do
|
26
|
-
expect(File.exist?("#{@name}/helpers/spec_helper.rb")).to be_truthy
|
27
|
-
end
|
28
|
-
|
29
|
-
after(:all) do
|
30
|
-
FileUtils.rm_rf(@name)
|
13
|
+
expect(File).to exist("#{name}/helpers/allure_helper.rb")
|
31
14
|
end
|
32
15
|
end
|
33
16
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
HelpersGenerator.new(['watir', 'rspec', @name]).invoke_all
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'creates a browser helper file', :watir do
|
41
|
-
expect(File.exist?("#{@name}/helpers/browser_helper.rb")).to be_truthy
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'creates a raider file' do
|
45
|
-
expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'creates an allure helper file' do
|
49
|
-
expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
|
50
|
-
end
|
51
|
-
|
52
|
-
after(:all) do
|
53
|
-
FileUtils.rm_rf(@name)
|
17
|
+
shared_examples 'creates selenium helpers' do |name|
|
18
|
+
it 'creates a driver helper file' do
|
19
|
+
expect(File).to exist("#{name}/helpers/driver_helper.rb")
|
54
20
|
end
|
55
21
|
end
|
56
22
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
HelpersGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
|
61
|
-
end
|
62
|
-
|
63
|
-
it 'creates a raider file' do
|
64
|
-
expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
|
23
|
+
shared_examples 'creates watir helpers' do |name|
|
24
|
+
it 'creates a browser helper file' do
|
25
|
+
expect(File).to exist("#{name}/helpers/browser_helper.rb")
|
65
26
|
end
|
27
|
+
end
|
66
28
|
|
67
|
-
|
68
|
-
|
29
|
+
shared_examples 'creates rspec helpers' do |name|
|
30
|
+
it 'creates a spec helper file' do
|
31
|
+
expect(File).to exist("#{name}/helpers/spec_helper.rb")
|
69
32
|
end
|
33
|
+
end
|
70
34
|
|
71
|
-
|
72
|
-
|
35
|
+
shared_examples 'creates cucumber helpers' do |name|
|
36
|
+
it 'does not create a spec helper' do
|
37
|
+
expect(File).not_to exist("#{name}/helpers/spec_helper.rb")
|
73
38
|
end
|
39
|
+
end
|
74
40
|
|
75
|
-
|
76
|
-
|
41
|
+
shared_examples 'creates cross platform helpers' do |name|
|
42
|
+
it 'creates a browser helper file' do
|
43
|
+
expect(File).to exist("#{name}/helpers/appium_helper.rb")
|
77
44
|
end
|
45
|
+
end
|
78
46
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
47
|
+
context 'with rspec and selenium' do
|
48
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
49
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
50
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
51
|
+
end
|
84
52
|
|
85
|
-
|
86
|
-
|
87
|
-
|
53
|
+
context 'with rspec and watir' do
|
54
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
55
|
+
include_examples 'creates watir helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
56
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
57
|
+
end
|
88
58
|
|
89
|
-
|
90
|
-
|
91
|
-
|
59
|
+
context 'with cucumber and selenium' do
|
60
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
61
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
62
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
63
|
+
end
|
92
64
|
|
93
|
-
|
94
|
-
|
95
|
-
|
65
|
+
context 'with cucumber and watir' do
|
66
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
67
|
+
include_examples 'creates watir helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
68
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
69
|
+
end
|
96
70
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
71
|
+
context 'with rspec and appium android' do
|
72
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
73
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
74
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
75
|
+
end
|
101
76
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
77
|
+
context 'with rspec and appium ios' do
|
78
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
79
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
80
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
81
|
+
end
|
107
82
|
|
108
|
-
|
109
|
-
|
110
|
-
|
83
|
+
context 'with cucumber and appium android' do
|
84
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
85
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
86
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
87
|
+
end
|
111
88
|
|
112
|
-
|
113
|
-
|
114
|
-
|
89
|
+
context 'with cucumber and appium ios' do
|
90
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
91
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
92
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
93
|
+
end
|
115
94
|
|
116
|
-
|
117
|
-
|
118
|
-
|
95
|
+
context 'with rspec and appium cross platform' do
|
96
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
97
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
98
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
99
|
+
include_examples 'creates cross platform helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
|
100
|
+
end
|
119
101
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
102
|
+
context 'with cucumber and appium cross platform' do
|
103
|
+
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
104
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
105
|
+
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
106
|
+
include_examples 'creates cross platform helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
124
107
|
end
|
125
108
|
end
|
@@ -4,79 +4,33 @@ require_relative '../lib/generators/rspec_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe RspecGenerator do
|
7
|
-
|
8
|
-
before(:all) do
|
9
|
-
@name = 'rspec-selenium'
|
10
|
-
RspecGenerator.new(['selenium', 'rspec', @name]).invoke_all
|
11
|
-
end
|
12
|
-
|
7
|
+
shared_examples 'creates rspec files' do |project_name, file_name|
|
13
8
|
it 'creates a spec file' do
|
14
|
-
expect(File.exist
|
9
|
+
expect(File).to exist("#{project_name}/spec/#{file_name}_page_spec.rb")
|
15
10
|
end
|
16
11
|
|
17
12
|
it 'creates the base spec file' do
|
18
|
-
expect(File.exist
|
19
|
-
end
|
20
|
-
|
21
|
-
after(:all) do
|
22
|
-
FileUtils.rm_rf(@name)
|
13
|
+
expect(File).to exist("#{project_name}/spec/base_spec.rb")
|
23
14
|
end
|
24
15
|
end
|
25
16
|
|
26
|
-
context 'with
|
27
|
-
|
28
|
-
@name = 'rspec-watir'
|
29
|
-
RspecGenerator.new(['watir', 'rspec', @name]).invoke_all
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'creates a spec file' do
|
33
|
-
expect(File.exist?("#{@name}/spec/login_page_spec.rb")).to be_truthy
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'creates the base spec file' do
|
37
|
-
expect(File.exist?("#{@name}/spec/base_spec.rb")).to be_truthy
|
38
|
-
end
|
39
|
-
|
40
|
-
after(:all) do
|
41
|
-
FileUtils.rm_rf(@name)
|
42
|
-
end
|
17
|
+
context 'with rspec and selenium' do
|
18
|
+
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}", 'login'
|
43
19
|
end
|
44
20
|
|
45
|
-
context 'with
|
46
|
-
|
47
|
-
@name = 'rspec-appium'
|
48
|
-
RspecGenerator.new(['ios', 'rspec', @name]).invoke_all
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'creates a spec file' do
|
52
|
-
expect(File.exist?("#{@name}/spec/pdp_page_spec.rb")).to be_truthy
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'creates the base spec file' do
|
56
|
-
expect(File.exist?("#{@name}/spec/base_spec.rb")).to be_truthy
|
57
|
-
end
|
58
|
-
|
59
|
-
after(:all) do
|
60
|
-
FileUtils.rm_rf(@name)
|
61
|
-
end
|
21
|
+
context 'with rspec and watir' do
|
22
|
+
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}", 'login'
|
62
23
|
end
|
63
24
|
|
64
|
-
context 'with
|
65
|
-
|
66
|
-
|
67
|
-
RspecGenerator.new(['android', 'rspec', @name]).invoke_all
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'creates a spec file' do
|
71
|
-
expect(File.exist?("#{@name}/spec/pdp_page_spec.rb")).to be_truthy
|
72
|
-
end
|
25
|
+
context 'with rspec and appium android' do
|
26
|
+
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}", 'pdp'
|
27
|
+
end
|
73
28
|
|
74
|
-
|
75
|
-
|
76
|
-
|
29
|
+
context 'with rspec and appium ios' do
|
30
|
+
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}", 'pdp'
|
31
|
+
end
|
77
32
|
|
78
|
-
|
79
|
-
|
80
|
-
end
|
33
|
+
context 'with rspec and appium cross platform' do
|
34
|
+
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}", 'pdp'
|
81
35
|
end
|
82
36
|
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require 'yaml'
|
3
|
+
require_relative '../lib/generators/common_generator'
|
4
|
+
require_relative '../lib/commands/scaffolding_commands'
|
5
|
+
require_relative '../lib/scaffolding/scaffolding'
|
6
|
+
require_relative 'spec_helper'
|
7
|
+
|
8
|
+
describe ScaffoldingCommands do
|
9
|
+
let(:scaffold) { described_class }
|
10
|
+
let(:name) { 'test' }
|
11
|
+
|
12
|
+
orig_dir = Dir.pwd
|
13
|
+
|
14
|
+
after do
|
15
|
+
Dir.chdir orig_dir
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with a spec folder' do
|
19
|
+
let(:new_path) { 'test_folder' }
|
20
|
+
|
21
|
+
path = "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
22
|
+
|
23
|
+
before do
|
24
|
+
Dir.chdir path
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'scaffolds for rspec creating a spec' do
|
28
|
+
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
29
|
+
expect(Pathname.new("spec/#{name}_spec.rb")).to be_file
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'scaffolds for rspec creating a page' do
|
33
|
+
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
34
|
+
expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to be_file
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'deletes a spec' do
|
38
|
+
scaffold.new.invoke(:spec, nil, %w[login --delete])
|
39
|
+
expect(Pathname.new('spec/login_spec.rb')).not_to be_file
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'deletes a helper' do
|
43
|
+
scaffold.new.invoke(:helper, nil, %w[driver --delete])
|
44
|
+
expect(Pathname.new('helpers/driver_helper.rb')).not_to be_file
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'creates a page' do
|
48
|
+
scaffold.new.invoke(:page, nil, %W[#{name}])
|
49
|
+
expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to be_file
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'changes the path for specs' do
|
53
|
+
scaffold.new.invoke(:path, nil, %W[#{path} -s])
|
54
|
+
config = YAML.load_file('config/config.yml')
|
55
|
+
expect(config['spec_path']).to eql path
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'updates the url' do
|
59
|
+
scaffold.new.invoke(:url, nil, %w[test.com])
|
60
|
+
config = YAML.load_file('config/config.yml')
|
61
|
+
expect(config['url']).to eql 'test.com'
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'updates the browser' do
|
65
|
+
scaffold.new.invoke(:browser, nil, %w[:firefox])
|
66
|
+
config = YAML.load_file('config/config.yml')
|
67
|
+
expect(config['browser']).to eql ':firefox'
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'updates the browser options' do
|
71
|
+
scaffold.new.invoke(:browser, nil, %w[:firefox --opts headless start-maximized start-fullscreen])
|
72
|
+
config = YAML.load_file('config/config.yml')
|
73
|
+
expect(config['browser_options']).to eql %w[headless start-maximized start-fullscreen]
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'creates a page with a path' do
|
77
|
+
scaffold.new.invoke(:page, nil, %W[#{name} --path #{new_path}])
|
78
|
+
expect(Pathname.new("#{new_path}/#{name}_page.rb")).to be_file
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'creates a spec' do
|
82
|
+
scaffold.new.invoke(:spec, nil, %W[#{name} --path #{new_path}])
|
83
|
+
expect(Pathname.new("#{new_path}/#{name}_spec.rb")).to be_file
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'with a features folder' do
|
88
|
+
let(:new_path) { 'test_folder' }
|
89
|
+
|
90
|
+
path = "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
91
|
+
|
92
|
+
before do
|
93
|
+
Dir.chdir path
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'scaffolds for cucumber creating a feature' do
|
97
|
+
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
98
|
+
expect(Pathname.new("features/#{name}.feature")).to be_file
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'scaffolds for cucumber creating a page' do
|
102
|
+
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
103
|
+
expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to be_file
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'creates a helper' do
|
107
|
+
scaffold.new.invoke(:helper, nil, %W[#{name}])
|
108
|
+
expect(Pathname.new("helpers/#{name}_helper.rb")).to be_file
|
109
|
+
end
|
110
|
+
|
111
|
+
it 'deletes a page' do
|
112
|
+
scaffold.new.invoke(:page, nil, %w[login --delete])
|
113
|
+
expect(Pathname.new('page_objects/pages/login_page.rb')).not_to be_file
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'deletes a feature' do
|
117
|
+
scaffold.new.invoke(:feature, nil, %w[login --delete])
|
118
|
+
expect(Pathname.new('features/login.feature')).not_to be_file
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'changes the path for pages' do
|
122
|
+
scaffold.new.invoke(:path, nil, %W[#{path}])
|
123
|
+
config = YAML.load_file('config/config.yml')
|
124
|
+
expect(config['page_path']).to eql path
|
125
|
+
end
|
126
|
+
|
127
|
+
it 'changes the path for features' do
|
128
|
+
scaffold.new.invoke(:path, nil, %W[#{path} -f])
|
129
|
+
config = YAML.load_file('config/config.yml')
|
130
|
+
expect(config['feature_path']).to eql path
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'updates only the browser options' do
|
134
|
+
scaffold.new.invoke(:browser, nil, %w[:firefox --opts headless])
|
135
|
+
config = YAML.load_file('config/config.yml')
|
136
|
+
expect(config['browser_options']).to eql %w[headless]
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'deletes the browser options when passed with the delete parameter' do
|
140
|
+
scaffold.new.invoke(:browser, nil, %w[:firefox --opts headless --delete])
|
141
|
+
config = YAML.load_file('config/config.yml')
|
142
|
+
expect(config['browser_options']).to be_nil
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'deletes the browser options' do
|
146
|
+
scaffold.new.invoke(:browser, nil, %w[:firefox --opts headless])
|
147
|
+
scaffold.new.invoke(:browser, nil, %w[--delete])
|
148
|
+
config = YAML.load_file('config/config.yml')
|
149
|
+
expect(config['browser_options']).to be_nil
|
150
|
+
end
|
151
|
+
|
152
|
+
it 'creates a feature' do
|
153
|
+
scaffold.new.invoke(:feature, nil, %W[#{name} --path #{new_path}])
|
154
|
+
expect(Pathname.new("#{new_path}/#{name}.feature")).to be_file
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'creates a helper with a path' do
|
158
|
+
scaffold.new.invoke(:helper, nil, %W[#{name} --path #{new_path}])
|
159
|
+
expect(Pathname.new("#{new_path}/#{name}_helper.rb")).to be_file
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,3 +2,23 @@
|
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'rspec'
|
5
|
+
require_relative '../lib/generators/menu_generator'
|
6
|
+
|
7
|
+
AUTOMATION_TYPES = %w[android ios selenium watir cross_platform].freeze
|
8
|
+
FRAMEWORKS = %w[cucumber rspec].freeze
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
config.before(:all) do
|
12
|
+
FRAMEWORKS.each do |framework|
|
13
|
+
AUTOMATION_TYPES.each do |automation|
|
14
|
+
MenuGenerator.new("#{framework}_#{automation}").generate_framework(automation, framework)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
config.after(:all) do
|
20
|
+
FRAMEWORKS.each do |framework|
|
21
|
+
AUTOMATION_TYPES.each { |automation| FileUtils.rm_rf("#{framework}_#{automation}") }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
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: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agustin Pequeno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.27'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-performance
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.15.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.15.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rubocop-rspec
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,14 +155,17 @@ files:
|
|
141
155
|
- lib/generators/rspec_generator.rb
|
142
156
|
- lib/generators/templates/automation/abstract_component.tt
|
143
157
|
- lib/generators/templates/automation/abstract_page.tt
|
144
|
-
- lib/generators/templates/automation/
|
158
|
+
- lib/generators/templates/automation/appium_caps.tt
|
145
159
|
- lib/generators/templates/automation/component.tt
|
146
160
|
- lib/generators/templates/automation/home_page.tt
|
147
161
|
- lib/generators/templates/automation/login_page.tt
|
148
|
-
- lib/generators/templates/automation/partials/
|
162
|
+
- lib/generators/templates/automation/partials/android_caps.tt
|
163
|
+
- lib/generators/templates/automation/partials/cross_platform_caps.tt
|
149
164
|
- lib/generators/templates/automation/partials/element.tt
|
165
|
+
- lib/generators/templates/automation/partials/home_page_selector.tt
|
150
166
|
- lib/generators/templates/automation/partials/initialize_selector.tt
|
151
|
-
- lib/generators/templates/automation/partials/
|
167
|
+
- lib/generators/templates/automation/partials/ios_caps.tt
|
168
|
+
- lib/generators/templates/automation/partials/pdp_page_selector.tt
|
152
169
|
- lib/generators/templates/automation/partials/require_raider.tt
|
153
170
|
- lib/generators/templates/automation/partials/selenium_login.tt
|
154
171
|
- lib/generators/templates/automation/partials/url_methods.tt
|
@@ -158,6 +175,8 @@ files:
|
|
158
175
|
- lib/generators/templates/common/config.tt
|
159
176
|
- lib/generators/templates/common/gemfile.tt
|
160
177
|
- lib/generators/templates/common/partials/automation_gems.tt
|
178
|
+
- lib/generators/templates/common/partials/mobile_config.tt
|
179
|
+
- lib/generators/templates/common/partials/web_config.tt
|
161
180
|
- lib/generators/templates/common/rakefile.tt
|
162
181
|
- lib/generators/templates/common/read_me.tt
|
163
182
|
- lib/generators/templates/cucumber/env.tt
|
@@ -172,6 +191,7 @@ files:
|
|
172
191
|
- lib/generators/templates/cucumber/steps.tt
|
173
192
|
- lib/generators/templates/cucumber/world.tt
|
174
193
|
- lib/generators/templates/helpers/allure_helper.tt
|
194
|
+
- lib/generators/templates/helpers/appium_helper.tt
|
175
195
|
- lib/generators/templates/helpers/browser_helper.tt
|
176
196
|
- lib/generators/templates/helpers/driver_helper.tt
|
177
197
|
- lib/generators/templates/helpers/partials/allure_imports.tt
|
@@ -199,7 +219,7 @@ files:
|
|
199
219
|
- spec/cucumber_generator_spec.rb
|
200
220
|
- spec/helpers_generator_spec.rb
|
201
221
|
- spec/rspec_generator_spec.rb
|
202
|
-
- spec/
|
222
|
+
- spec/scaffolding_commands_spec.rb
|
203
223
|
- spec/spec_helper.rb
|
204
224
|
homepage: https://github.com/RubyRaider/ruby_raider
|
205
225
|
licenses:
|