ruby_raider 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/generators/templates/automation/abstract_page.tt +1 -1
- data/lib/generators/templates/automation/partials/url_methods.tt +1 -1
- data/lib/generators/templates/common/config.tt +1 -0
- data/lib/generators/templates/helpers/browser_helper.tt +2 -2
- data/lib/generators/templates/helpers/driver_helper.tt +1 -1
- data/lib/generators/templates/helpers/partials/new_driver.tt +2 -2
- data/lib/ruby_raider.rb +13 -6
- data/lib/scaffolding/scaffolding.rb +8 -3
- data/lib/utilities/utilities.rb +16 -5
- data/ruby_raider.gemspec +1 -1
- 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: 5ae28c89e9e9716c7a75d97bbe0bc31bae51c3f18b85734492b5a4c5b7913a69
|
4
|
+
data.tar.gz: 3f6a53f7b30227c3cde2a965a9fe19547afd804484bbee5e3757f9cd65bfa6e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 866912f5d5c4a809dbf721d6629c03f26a5df60d3c5581c6af3b1cfc0884fd629b68af8543d4c630d0d7c736f6aff701aeb577d86538210d129221b42680771c
|
7
|
+
data.tar.gz: 153726f43cfed928c93457498b964b0f067b82f008ab8a8377828151dd12f4a01052cd7b1e3df5f2c3c89ca941af4d2fafc1c3972ac1ac22ad2fc73c30d06367
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# ruby_raider
|
2
|
-
This is a gem to make setup and start of UI automation projects easier
|
2
|
+
This is a gem to make setup and start of UI automation projects easier
|
3
|
+
You can find more information and updates on releaseas in : https://ruby-raider.com/
|
3
4
|
|
4
5
|
Just do:
|
5
6
|
|
@@ -7,7 +8,7 @@ Just do:
|
|
7
8
|
|
8
9
|
then do:
|
9
10
|
|
10
|
-
**raider [name_of_project]**
|
11
|
+
**raider new [name_of_project]**
|
11
12
|
|
12
13
|
and you will have a new project in the folder you are in
|
13
14
|
|
@@ -10,9 +10,9 @@ module Raider
|
|
10
10
|
class << self
|
11
11
|
attr_reader :browser
|
12
12
|
|
13
|
-
def new_browser
|
13
|
+
def new_browser(options = {})
|
14
14
|
config = YAML.load_file('config/config.yml')
|
15
|
-
@browser = Watir::Browser.new
|
15
|
+
@browser = Watir::Browser.new(config['browser'], options: browser_opts)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% if automation == 'selenium' %>
|
2
|
-
def new_driver
|
3
|
-
@driver = Selenium::WebDriver.for :
|
2
|
+
def new_driver(caps = {})
|
3
|
+
@driver = Selenium::WebDriver.for(YAML.load_file('config/config.yml')['browser'], desired_capabilities: caps)
|
4
4
|
end
|
5
5
|
<% else %>
|
6
6
|
def new_driver
|
data/lib/ruby_raider.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'thor'
|
2
|
+
require 'yaml'
|
2
3
|
require_relative 'generators/menu_generator'
|
3
4
|
require_relative '../lib/scaffolding/scaffolding'
|
4
5
|
require_relative '../lib/utilities/utilities'
|
@@ -11,31 +12,37 @@ class RubyRaider < Thor
|
|
11
12
|
|
12
13
|
desc "page [PAGE_NAME]", "Creates a new page object"
|
13
14
|
def page(name)
|
14
|
-
Scaffolding.new([name]).generate_class
|
15
|
+
Scaffolding.new([name, load_config_path]).generate_class
|
15
16
|
end
|
16
17
|
|
17
18
|
desc "feature [FEATURE_NAME]", "Creates a new feature"
|
18
19
|
def feature(name)
|
19
|
-
Scaffolding.new([name]).generate_feature
|
20
|
+
Scaffolding.new([name, load_config_path]).generate_feature
|
20
21
|
end
|
21
22
|
|
22
23
|
desc "spec [SPEC_NAME]", "Creates a new spec"
|
23
24
|
def spec(name)
|
24
|
-
Scaffolding.new([name]).generate_spec
|
25
|
+
Scaffolding.new([name, load_config_path]).generate_spec
|
25
26
|
end
|
26
27
|
|
27
28
|
desc "path [PATH]", "Sets the default path for scaffolding"
|
28
29
|
def path(default_path)
|
29
|
-
Utilities.path = default_path
|
30
|
+
Utilities.new.path = default_path
|
30
31
|
end
|
31
32
|
|
32
33
|
desc "url [URL]", "Sets the default url for a project"
|
33
34
|
def url(default_url)
|
34
|
-
Utilities.url = default_url
|
35
|
+
Utilities.new.url = default_url
|
35
36
|
end
|
36
37
|
|
37
38
|
desc "browser [BROWSER]", "Sets the default browser for a project"
|
38
39
|
def browser(default_browser)
|
39
|
-
Utilities.browser = default_browser
|
40
|
+
Utilities.new.browser = default_browser
|
41
|
+
end
|
42
|
+
|
43
|
+
no_commands do
|
44
|
+
def load_config_path
|
45
|
+
YAML.load_file('config/config.yml')['path']
|
46
|
+
end
|
40
47
|
end
|
41
48
|
end
|
@@ -4,20 +4,25 @@ class Scaffolding < Thor::Group
|
|
4
4
|
include Thor::Actions
|
5
5
|
|
6
6
|
argument :name
|
7
|
+
argument :path, optional: true
|
7
8
|
|
8
9
|
def self.source_root
|
9
10
|
File.dirname(__FILE__) + '/templates'
|
10
11
|
end
|
11
12
|
|
12
13
|
def generate_class
|
13
|
-
template('page_object.tt', "page_objects/pages/#{name}_page.rb")
|
14
|
+
template('page_object.tt', default_path("page_objects/pages/#{name}_page.rb") )
|
14
15
|
end
|
15
16
|
|
16
17
|
def generate_feature
|
17
|
-
template('feature.tt', "features/#{name}.feature")
|
18
|
+
template('feature.tt', default_path("features/#{name}.feature"))
|
18
19
|
end
|
19
20
|
|
20
21
|
def generate_spec
|
21
|
-
template('spec.tt', "./spec/#{name}_page.rb")
|
22
|
+
template('spec.tt', default_path("./spec/#{name}_page.rb"))
|
23
|
+
end
|
24
|
+
|
25
|
+
def default_path(standard_path)
|
26
|
+
path.nil? ? standard_path : "#{path}/#{name}"
|
22
27
|
end
|
23
28
|
end
|
data/lib/utilities/utilities.rb
CHANGED
@@ -1,17 +1,28 @@
|
|
1
|
-
require '
|
1
|
+
require 'yaml'
|
2
2
|
|
3
|
-
class Utilities
|
4
|
-
include Thor::Actions
|
3
|
+
class Utilities
|
5
4
|
|
6
|
-
def
|
5
|
+
def initialize
|
6
|
+
@path = 'config/config.yml'
|
7
|
+
@config = YAML.load_file(@path)
|
8
|
+
end
|
7
9
|
|
10
|
+
def browser=(browser)
|
11
|
+
@config['browser'] = browser
|
12
|
+
overwrite_yaml
|
8
13
|
end
|
9
14
|
|
10
15
|
def path=(path)
|
11
|
-
|
16
|
+
@config['path'] = path
|
17
|
+
overwrite_yaml
|
12
18
|
end
|
13
19
|
|
14
20
|
def url=(url)
|
21
|
+
@config['url'] = url
|
22
|
+
overwrite_yaml
|
23
|
+
end
|
15
24
|
|
25
|
+
def overwrite_yaml
|
26
|
+
File.open(@path, 'w') { |file| YAML.dump(@config, file) }
|
16
27
|
end
|
17
28
|
end
|
data/ruby_raider.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'ruby_raider'
|
5
|
-
s.version = '0.2.
|
5
|
+
s.version = '0.2.6'
|
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']
|
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.2.
|
4
|
+
version: 0.2.6
|
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-05-
|
11
|
+
date: 2022-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|