ruby_raider 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -5
- data/lib/generators/templates/common/read_me.tt +32 -73
- data/lib/ruby_raider.rb +11 -7
- data/lib/utilities/utilities.rb +12 -3
- data/ruby_raider.gemspec +2 -2
- data/spec/ruby_raider_spec.rb +79 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 151af21fd6a33598fc5fef983b3d8277817e438445f8576d6f6135ce13d7cc4b
|
4
|
+
data.tar.gz: 0665e396c6246632ab922e62fac8dd3ef66701815b95bb8cdc03fa215b7a57b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 613640d0d946f4337bec680bdac7c86e4ae6f00534b7286d6e35a59788197b4f37dd110a4ee3990247e8b2dffee2f7eafc6d92de1b9a6f3216ae88343cd0cc43
|
7
|
+
data.tar.gz: 3391b2d3debb45de3d923954f64d8c866fb813f276312128c81a4fde78964a56084142ca6266399277b9c4280296da36f495ff3c9e754a4ef90fb16659fd3736
|
data/README.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
1
|
+
# Ruby Raider
|
2
|
+
|
3
|
+
This is a gem to make setup and start of UI automation projects easier
|
4
|
+
You can find more information and updates on releases in : https://ruby-raider.com/
|
4
5
|
|
5
6
|
Just do:
|
6
7
|
|
7
8
|
**gem install ruby_raider**
|
8
9
|
|
9
|
-
then do:
|
10
|
+
then do:
|
10
11
|
|
11
|
-
**raider new [name_of_project]**
|
12
|
+
**raider new [name_of_project]**
|
12
13
|
|
13
14
|
and you will have a new project in the folder you are in
|
14
15
|
|
@@ -21,3 +22,36 @@ Currently we only support:
|
|
21
22
|
In order to run the appium tests, download the example [app](https://github.com/cloudgrey-io/the-app/releases/tag/v1.10.0)
|
22
23
|
|
23
24
|
This works in all the platforms (Tested on Mac OS, Linux and Windows)
|
25
|
+
|
26
|
+
**Ruby raider provides the following list of commands**
|
27
|
+
```
|
28
|
+
raider browser [BROWSER] # Sets the default browser for a project
|
29
|
+
|
30
|
+
raider feature [FEATURE_NAME] # Creates a new feature
|
31
|
+
|
32
|
+
raider help [COMMAND] # Describe available commands or one specific command
|
33
|
+
|
34
|
+
raider new [PROJECT_NAME] # Creates a new framework based on settings picked
|
35
|
+
|
36
|
+
raider page [PAGE_NAME] # Creates a new page object
|
37
|
+
|
38
|
+
raider path [PATH] # Sets the default path for scaffolding
|
39
|
+
|
40
|
+
raider raid # It runs all the tests in a project
|
41
|
+
|
42
|
+
raider spec [SPEC_NAME] # Creates a new spec
|
43
|
+
|
44
|
+
raider url [URL] # Sets the default url for a project
|
45
|
+
```
|
46
|
+
|
47
|
+
It's possible to add the option --path or -p if you want to specify where to create your features, pages and specs.
|
48
|
+
And also it's possible to delete them using --delete or -d.
|
49
|
+
|
50
|
+
If you want to set the default path for the creation of your features, specs or pages you can do:
|
51
|
+
|
52
|
+
```
|
53
|
+
raider path [PATH_NAME] --feature or -f
|
54
|
+
raider path [PATH_NAME] --spec or -s
|
55
|
+
```
|
56
|
+
|
57
|
+
If you don't specify an option path will assume you want to change the default path for pages
|
@@ -1,97 +1,56 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Ruby Raider
|
2
|
+
This is a gem to make setup and start of UI automation projects easier
|
3
|
+
You can find more information and updates on releases in : https://ruby-raider.com/
|
3
4
|
|
4
|
-
|
5
|
+
Just do:
|
5
6
|
|
6
|
-
|
7
|
+
**gem install ruby_raider**
|
7
8
|
|
8
|
-
|
9
|
-
https://rvm.io/rvm/install
|
9
|
+
then do:
|
10
10
|
|
11
|
-
|
11
|
+
**raider new [name_of_project]**
|
12
12
|
|
13
|
-
|
14
|
-
*rspec spec/*
|
13
|
+
and you will have a new project in the folder you are in
|
15
14
|
|
16
|
-
|
17
|
-
*parallel_rspec spec/*
|
15
|
+
Currently we only support:
|
18
16
|
|
19
|
-
|
17
|
+
* Gerating a Selenium with both Cucumber and Rspec framework
|
18
|
+
* Gerating a Watir with both Cucumber and Rspec framework
|
19
|
+
* Generating an Appium project with Rspec and Cucumber on IOS
|
20
20
|
|
21
|
-
|
21
|
+
In order to run the appium tests, download the example [app](https://github.com/cloudgrey-io/the-app/releases/tag/v1.10.0)
|
22
22
|
|
23
|
-
|
23
|
+
This works in all the platforms (Tested on Mac OS, Linux and Windows)
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
*describe 'A user can'/*
|
28
|
-
|
29
|
-
or
|
30
|
-
|
31
|
-
*describe 'A user cannot'/*
|
32
|
-
|
33
|
-
This saves us repetition and forces us into an structure
|
34
|
-
|
35
|
-
At last we use 'it' for the specific action the user can or cannot perform:
|
36
|
-
|
37
|
-
it 'login with right credentials'
|
38
|
-
|
39
|
-
If we group all of this together it will look like
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
context 'On the login page' do
|
43
|
-
describe 'A user can' do
|
44
|
-
it 'login with the right credentials' do
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe 'A user cannot' do
|
49
|
-
it 'login with the wrong credentials' do
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
25
|
+
**Ruby raider provides the following list of commands**
|
53
26
|
```
|
54
|
-
|
27
|
+
raider browser [BROWSER] # Sets the default browser for a project
|
55
28
|
|
56
|
-
#
|
29
|
+
raider feature [FEATURE_NAME] # Creates a new feature
|
57
30
|
|
58
|
-
|
59
|
-
require_relative '../abstract/base_page'
|
31
|
+
raider help [COMMAND] # Describe available commands or one specific command
|
60
32
|
|
61
|
-
|
33
|
+
raider new [PROJECT_NAME] # Creates a new framework based on settings picked
|
62
34
|
|
63
|
-
|
35
|
+
raider page [PAGE_NAME] # Creates a new page object
|
64
36
|
|
65
|
-
|
66
|
-
'/'
|
67
|
-
end
|
37
|
+
raider path [PATH] # Sets the default path for scaffolding
|
68
38
|
|
69
|
-
#
|
39
|
+
raider raid # It runs all the tests in a project
|
70
40
|
|
71
|
-
|
72
|
-
currency_dropdown.select currency
|
73
|
-
end
|
41
|
+
raider spec [SPEC_NAME] # Creates a new spec
|
74
42
|
|
75
|
-
#
|
76
|
-
|
77
|
-
def validate_currency(currency)
|
78
|
-
expect(currency_dropdown.include?(currency)).to be true
|
79
|
-
end
|
43
|
+
raider url [URL] # Sets the default url for a project
|
44
|
+
```
|
80
45
|
|
81
|
-
|
46
|
+
It's possible to add the option --path or -p if you want to specify where to create your features, pages and specs.
|
47
|
+
And also it's possible to delete them using --delete or -d.
|
82
48
|
|
83
|
-
|
49
|
+
If you want to set the default path for the creation of your features, specs or pages you can do:
|
84
50
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
end
|
51
|
+
```
|
52
|
+
raider path [PATH_NAME] --feature or -f
|
53
|
+
raider path [PATH_NAME] --spec or -s
|
89
54
|
```
|
90
55
|
|
91
|
-
|
92
|
-
Each page has to have a url define, and each page is using the module WatirHelper to add methods on runtime to the Watir elements
|
93
|
-
|
94
|
-
# Mobile:
|
95
|
-
|
96
|
-
For the appium base project to work you need to have [appium](https://appium.io)
|
97
|
-
and download [the example app](https://github.com/cloudgrey-io/the-app/releases/tag/v1.10.0)
|
56
|
+
If you don't specify an option path will assume you want to change the default path for pages
|
data/lib/ruby_raider.rb
CHANGED
@@ -18,7 +18,7 @@ class RubyRaider < Thor
|
|
18
18
|
:type => :boolean, :required => false, :desc => 'This will delete the selected page', :aliases => '-d'
|
19
19
|
|
20
20
|
def page(name)
|
21
|
-
path = options[:path].nil? ? load_config_path : options[:path]
|
21
|
+
path = options[:path].nil? ? load_config_path('page') : options[:path]
|
22
22
|
if options[:delete]
|
23
23
|
Scaffolding.new([name, path]).delete_class
|
24
24
|
else
|
@@ -33,7 +33,7 @@ class RubyRaider < Thor
|
|
33
33
|
:type => :boolean, :required => false, :desc => 'This will delete the selected feature', :aliases => '-d'
|
34
34
|
|
35
35
|
def feature(name)
|
36
|
-
path = options[:path].nil? ? load_config_path : options[:path]
|
36
|
+
path = options[:path].nil? ? load_config_path('feature') : options[:path]
|
37
37
|
if options[:delete]
|
38
38
|
Scaffolding.new([name, path]).delete_feature
|
39
39
|
else
|
@@ -48,7 +48,7 @@ class RubyRaider < Thor
|
|
48
48
|
:type => :boolean, :required => false, :desc => 'This will delete the selected spec', :aliases => '-d'
|
49
49
|
|
50
50
|
def spec(name)
|
51
|
-
path = options[:path].nil? ? load_config_path : options[:path]
|
51
|
+
path = options[:path].nil? ? load_config_path('spec') : options[:path]
|
52
52
|
if options[:delete]
|
53
53
|
Scaffolding.new([name, path]).delete_spec
|
54
54
|
else
|
@@ -57,9 +57,13 @@ class RubyRaider < Thor
|
|
57
57
|
end
|
58
58
|
|
59
59
|
desc "path [PATH]", "Sets the default path for scaffolding"
|
60
|
-
|
60
|
+
option :feature,
|
61
|
+
:type => :boolean, :required => false, :desc => 'The default path for your features', :aliases => '-f'
|
62
|
+
option :spec,
|
63
|
+
:type => :boolean, :required => false, :desc => 'The default path for your specs', :aliases => '-s'
|
61
64
|
def path(default_path)
|
62
|
-
|
65
|
+
type = options.empty? ? 'page' : options.keys.first
|
66
|
+
Utilities.new.send("#{type}_path=", default_path)
|
63
67
|
end
|
64
68
|
|
65
69
|
desc "url [URL]", "Sets the default url for a project"
|
@@ -81,8 +85,8 @@ class RubyRaider < Thor
|
|
81
85
|
end
|
82
86
|
|
83
87
|
no_commands do
|
84
|
-
def load_config_path
|
85
|
-
YAML.load_file('config/config.yml')[
|
88
|
+
def load_config_path(type)
|
89
|
+
YAML.load_file('config/config.yml')["#{type}_path"] unless YAML.load_file('config/config.yml').nil?
|
86
90
|
end
|
87
91
|
end
|
88
92
|
end
|
data/lib/utilities/utilities.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
|
3
3
|
class Utilities
|
4
|
-
|
5
4
|
def initialize
|
6
5
|
@path = 'config/config.yml'
|
7
6
|
@config = YAML.load_file(@path)
|
@@ -12,8 +11,18 @@ class Utilities
|
|
12
11
|
overwrite_yaml
|
13
12
|
end
|
14
13
|
|
15
|
-
def
|
16
|
-
@config['
|
14
|
+
def page_path=(path)
|
15
|
+
@config['page_path'] = path
|
16
|
+
overwrite_yaml
|
17
|
+
end
|
18
|
+
|
19
|
+
def spec_path=(path)
|
20
|
+
@config['spec_path'] = path
|
21
|
+
overwrite_yaml
|
22
|
+
end
|
23
|
+
|
24
|
+
def feature_path=(path)
|
25
|
+
@config['feature_path'] = path
|
17
26
|
overwrite_yaml
|
18
27
|
end
|
19
28
|
|
data/ruby_raider.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'ruby_raider'
|
5
|
-
s.version = '0.3.
|
5
|
+
s.version = '0.3.1'
|
6
6
|
s.summary = 'A gem to make setup and start of UI automation projects easier'
|
7
7
|
s.description = 'This gem has everything you need to start working with test automation'
|
8
8
|
s.authors = ['Agustin Pequeno']
|
9
9
|
s.email = 'agustin.pe94@gmail.com'
|
10
|
-
s.homepage = '
|
10
|
+
s.homepage = 'https://github.com/RubyRaider/ruby_raider'
|
11
11
|
s.files = %w[bin/* lib/* lib/**/*]
|
12
12
|
s.license = 'MIT'
|
13
13
|
s.required_ruby_version = '>= 3.0.0'
|
data/spec/ruby_raider_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'pathname'
|
2
|
+
require 'yaml'
|
2
3
|
require_relative 'spec_helper'
|
3
4
|
require_relative '../lib/ruby_raider'
|
4
5
|
require_relative '../lib/generators/common_generator'
|
@@ -77,4 +78,82 @@ describe RubyRaider do
|
|
77
78
|
FileUtils.rm_rf(path)
|
78
79
|
end
|
79
80
|
end
|
81
|
+
|
82
|
+
context 'changes the default path' do
|
83
|
+
let(:path) { 'test_folder' }
|
84
|
+
|
85
|
+
before(:all) do
|
86
|
+
CommonGenerator.new(%w[rspec cucumber test]).invoke(:generate_config_file)
|
87
|
+
FileUtils.cp_lr('test/config', './')
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'changes the path for pages' do
|
91
|
+
raider.new.invoke(:path, nil, %W[#{path}])
|
92
|
+
config = YAML.load_file('config/config.yml')
|
93
|
+
expect(config['page_path']).to eql path
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'changes the path for features' do
|
97
|
+
raider.new.invoke(:path, nil, %W[#{path} -f])
|
98
|
+
config = YAML.load_file('config/config.yml')
|
99
|
+
expect(config['feature_path']).to eql path
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'changes the path for specs' do
|
103
|
+
raider.new.invoke(:path, nil, %W[#{path} -s])
|
104
|
+
config = YAML.load_file('config/config.yml')
|
105
|
+
expect(config['spec_path']).to eql path
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'creates page' do
|
109
|
+
raider.new.invoke(:path, nil, %W[#{path}])
|
110
|
+
raider.new.invoke(:page, nil, %W[#{name}])
|
111
|
+
expect(Pathname.new("#{path}/#{name}_page.rb")).to be_file
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'creates feature' do
|
115
|
+
raider.new.invoke(:path, nil, %W[#{path} -f])
|
116
|
+
raider.new.invoke(:feature, nil, %W[#{name}])
|
117
|
+
expect(Pathname.new("#{path}/#{name}.feature")).to be_file
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'creates feature' do
|
121
|
+
raider.new.invoke(:path, nil, %W[#{path} -s])
|
122
|
+
raider.new.invoke(:spec, nil, %W[#{name}])
|
123
|
+
expect(Pathname.new("#{path}/#{name}_spec.rb")).to be_file
|
124
|
+
end
|
125
|
+
|
126
|
+
after(:all) do
|
127
|
+
folders = %w[test_folder test config]
|
128
|
+
folders.each do |folder|
|
129
|
+
FileUtils.rm_rf(folder)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
context 'updates the config file' do
|
135
|
+
before(:all) do
|
136
|
+
CommonGenerator.new(%w[rspec cucumber test]).invoke(:generate_config_file)
|
137
|
+
FileUtils.cp_lr('test/config', './')
|
138
|
+
end
|
139
|
+
|
140
|
+
it 'updates the url' do
|
141
|
+
raider.new.invoke(:url, nil, %W[test.com])
|
142
|
+
config = YAML.load_file('config/config.yml')
|
143
|
+
expect(config['url']).to eql 'test.com'
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'updates the browser' do
|
147
|
+
raider.new.invoke(:browser, nil, %W[:firefox])
|
148
|
+
config = YAML.load_file('config/config.yml')
|
149
|
+
expect(config['browser']).to eql ':firefox'
|
150
|
+
end
|
151
|
+
|
152
|
+
after(:all) do
|
153
|
+
folders = %w[test config]
|
154
|
+
folders.each do |folder|
|
155
|
+
FileUtils.rm_rf(folder)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
80
159
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_raider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agustin Pequeno
|
@@ -191,7 +191,7 @@ files:
|
|
191
191
|
- spec/rspec_generator_spec.rb
|
192
192
|
- spec/ruby_raider_spec.rb
|
193
193
|
- spec/spec_helper.rb
|
194
|
-
homepage:
|
194
|
+
homepage: https://github.com/RubyRaider/ruby_raider
|
195
195
|
licenses:
|
196
196
|
- MIT
|
197
197
|
metadata: {}
|