ruby_raider 0.2.8 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2b456b6b2d262b4d8f5a0667a0bcbb53f46803f00e5f01f7439422d074fafc3
4
- data.tar.gz: 87c94fd901ea5ef4d89f3364e0f2d0cfdcacb60319114df1ee0feb1731130fc1
3
+ metadata.gz: 151af21fd6a33598fc5fef983b3d8277817e438445f8576d6f6135ce13d7cc4b
4
+ data.tar.gz: 0665e396c6246632ab922e62fac8dd3ef66701815b95bb8cdc03fa215b7a57b6
5
5
  SHA512:
6
- metadata.gz: deccd21387b863799b45987a96d72da3958181cbaf165fc3fdef651b151a74ca23d2cf2e286331649aca646dad8212f34b932258085219a08f13024411d9ee07
7
- data.tar.gz: '084c6a8df157afa64bf1f197781d121b822cf5e2eca1e0204c13899118a5af8ac51b87a8b6dfd17f54e9545fd75bd98c07d0c6f8767a312e2a95173db36a9751'
6
+ metadata.gz: 613640d0d946f4337bec680bdac7c86e4ae6f00534b7286d6e35a59788197b4f37dd110a4ee3990247e8b2dffee2f7eafc6d92de1b9a6f3216ae88343cd0cc43
7
+ data.tar.gz: 3391b2d3debb45de3d923954f64d8c866fb813f276312128c81a4fde78964a56084142ca6266399277b9c4280296da36f495ff3c9e754a4ef90fb16659fd3736
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ .
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1 @@
1
+ How to start contributing
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Agustin Pequeno
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,14 +1,15 @@
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 releaseas in : https://ruby-raider.com/
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
- What is Raider?
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
- Raider is a tool to make the setup and start of automation projects in ruby easier, with one command you are ready to go
5
+ Just do:
5
6
 
6
- # Pre-requisites:
7
+ **gem install ruby_raider**
7
8
 
8
- Install RVM:
9
- https://rvm.io/rvm/install
9
+ then do:
10
10
 
11
- # How to use the framework:
11
+ **raider new [name_of_project]**
12
12
 
13
- If you want to run all the tests from your terminal do:
14
- *rspec spec/*
13
+ and you will have a new project in the folder you are in
15
14
 
16
- If you want to run all the tests in parallel do:
17
- *parallel_rspec spec/*
15
+ Currently we only support:
18
16
 
19
- # How are specs organized:
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
- We use 'context' as the highest grouping level to indicate in which part of the application we are as an example:
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
- *context 'On the login page'/*
23
+ This works in all the platforms (Tested on Mac OS, Linux and Windows)
24
24
 
25
- We use 'describe' from the user perspective to describe an action that the user can or cannot take:
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
- This is readed as 'On the login page a user can login with the right credentials' and 'On the login page a user cannot login with the wrong credentials'
27
+ raider browser [BROWSER] # Sets the default browser for a project
55
28
 
56
- # How pages are organized:
29
+ raider feature [FEATURE_NAME] # Creates a new feature
57
30
 
58
- ```ruby#{' '}
59
- require_relative '../abstract/base_page'
31
+ raider help [COMMAND] # Describe available commands or one specific command
60
32
 
61
- class MainPage < BasePage
33
+ raider new [PROJECT_NAME] # Creates a new framework based on settings picked
62
34
 
63
- using Raider::WatirHelper
35
+ raider page [PAGE_NAME] # Creates a new page object
64
36
 
65
- def url(_page)
66
- '/'
67
- end
37
+ raider path [PATH] # Sets the default path for scaffolding
68
38
 
69
- # Actions
39
+ raider raid # It runs all the tests in a project
70
40
 
71
- def change_currency(currency)
72
- currency_dropdown.select currency
73
- end
41
+ raider spec [SPEC_NAME] # Creates a new spec
74
42
 
75
- # Validations
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
- private
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
- # Elements
49
+ If you want to set the default path for the creation of your features, specs or pages you can do:
84
50
 
85
- def currency_dropdown
86
- browser.select(class: %w[dropdown-menu currency])
87
- end
88
- end
51
+ ```
52
+ raider path [PATH_NAME] --feature or -f
53
+ raider path [PATH_NAME] --spec or -s
89
54
  ```
90
55
 
91
- Pages are organized in Actions (things a user can perform on the page), Validations (assertions), and Elements.
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
@@ -12,7 +12,7 @@ module Raider
12
12
 
13
13
  def new_browser(options = {})
14
14
  browser = YAML.load_file('config/config.yml')['browser'].to_sym
15
- @browser = Watir::Browser.new(browser, options: browser_opts)
15
+ @browser = Watir::Browser.new(browser, options: options)
16
16
  end
17
17
  end
18
18
  end
data/lib/ruby_raider.rb CHANGED
@@ -6,48 +6,87 @@ require_relative '../lib/utilities/utilities'
6
6
 
7
7
  class RubyRaider < Thor
8
8
  desc "new [PROJECT_NAME]", "Creates a new framework based on settings picked"
9
+
9
10
  def new(project_name)
10
11
  MenuGenerator.generate_choice_menu(project_name)
11
12
  end
12
13
 
13
14
  desc "page [PAGE_NAME]", "Creates a new page object"
15
+ option :path,
16
+ :type => :string, :required => false, :desc => 'The path where your page will be created', :aliases => '-p'
17
+ option :delete,
18
+ :type => :boolean, :required => false, :desc => 'This will delete the selected page', :aliases => '-d'
19
+
14
20
  def page(name)
15
- Scaffolding.new([name, load_config_path]).generate_class
21
+ path = options[:path].nil? ? load_config_path('page') : options[:path]
22
+ if options[:delete]
23
+ Scaffolding.new([name, path]).delete_class
24
+ else
25
+ Scaffolding.new([name, path]).generate_class
26
+ end
16
27
  end
17
28
 
18
29
  desc "feature [FEATURE_NAME]", "Creates a new feature"
30
+ option :path,
31
+ :type => :string, :required => false, :desc => 'The path where your feature will be created', :aliases => '-p'
32
+ option :delete,
33
+ :type => :boolean, :required => false, :desc => 'This will delete the selected feature', :aliases => '-d'
34
+
19
35
  def feature(name)
20
- Scaffolding.new([name, load_config_path]).generate_feature
36
+ path = options[:path].nil? ? load_config_path('feature') : options[:path]
37
+ if options[:delete]
38
+ Scaffolding.new([name, path]).delete_feature
39
+ else
40
+ Scaffolding.new([name, path]).generate_feature
41
+ end
21
42
  end
22
43
 
23
44
  desc "spec [SPEC_NAME]", "Creates a new spec"
45
+ option :path,
46
+ :type => :string, :required => false, :desc => 'The path where your spec will be created', :aliases => '-p'
47
+ option :delete,
48
+ :type => :boolean, :required => false, :desc => 'This will delete the selected spec', :aliases => '-d'
49
+
24
50
  def spec(name)
25
- Scaffolding.new([name, load_config_path]).generate_spec
51
+ path = options[:path].nil? ? load_config_path('spec') : options[:path]
52
+ if options[:delete]
53
+ Scaffolding.new([name, path]).delete_spec
54
+ else
55
+ Scaffolding.new([name, path]).generate_spec
56
+ end
26
57
  end
27
58
 
28
59
  desc "path [PATH]", "Sets the default path for scaffolding"
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'
29
64
  def path(default_path)
30
- Utilities.new.path = default_path
65
+ type = options.empty? ? 'page' : options.keys.first
66
+ Utilities.new.send("#{type}_path=", default_path)
31
67
  end
32
68
 
33
69
  desc "url [URL]", "Sets the default url for a project"
70
+
34
71
  def url(default_url)
35
72
  Utilities.new.url = default_url
36
73
  end
37
74
 
38
75
  desc "browser [BROWSER]", "Sets the default browser for a project"
76
+
39
77
  def browser(default_browser)
40
78
  Utilities.new.browser = default_browser
41
79
  end
42
80
 
43
81
  desc "raid", "It runs all the tests in a project"
82
+
44
83
  def raid
45
84
  Utilities.new.run
46
85
  end
47
86
 
48
87
  no_commands do
49
- def load_config_path
50
- YAML.load_file('config/config.yml')['path']
88
+ def load_config_path(type)
89
+ YAML.load_file('config/config.yml')["#{type}_path"] unless YAML.load_file('config/config.yml').nil?
51
90
  end
52
91
  end
53
- end
92
+ end
@@ -11,18 +11,30 @@ class Scaffolding < Thor::Group
11
11
  end
12
12
 
13
13
  def generate_class
14
- template('page_object.tt', default_path("page_objects/pages/#{name}_page.rb") )
14
+ template('page_object.tt', default_path("page_objects/pages/#{name}_page.rb", '_page.rb'))
15
15
  end
16
16
 
17
17
  def generate_feature
18
- template('feature.tt', default_path("features/#{name}.feature"))
18
+ template('feature.tt', default_path("features/#{name}.feature", '.feature'))
19
19
  end
20
20
 
21
21
  def generate_spec
22
- template('spec.tt', default_path("./spec/#{name}_page.rb"))
22
+ template('spec.tt', default_path("spec/#{name}_spec.rb", '_spec.rb'))
23
23
  end
24
24
 
25
- def default_path(standard_path)
26
- path.nil? ? standard_path : "#{path}/#{name}"
25
+ def delete_class
26
+ remove_file(default_path("page_objects/pages/#{name}_page.rb", '_page.rb'))
27
+ end
28
+
29
+ def delete_feature
30
+ remove_file(default_path("features/#{name}.feature", '.feature'))
31
+ end
32
+
33
+ def delete_spec
34
+ remove_file(default_path("spec/#{name}_spec.rb", '_spec.rb'))
35
+ end
36
+
37
+ def default_path(standard_path, file_type)
38
+ path.nil? ? standard_path : "#{path}/#{name}#{file_type}"
27
39
  end
28
40
  end
@@ -4,7 +4,7 @@ require_relative '../abstract/abstract_page'
4
4
 
5
5
  class <%= name.split('_').map {|word| word.capitalize }.join + 'Page' %> < AbstractPage
6
6
 
7
- #Actions
7
+ # Actions
8
8
 
9
9
  private
10
10
 
@@ -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 path=(path)
16
- @config['path'] = path
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.2.8'
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 = 'http://github.com/aguspe/ruby_raider'
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'
@@ -3,11 +3,11 @@
3
3
  require_relative '../lib/generators/automation_generator'
4
4
  require_relative 'spec_helper'
5
5
 
6
- describe RubyRaider::AutomationGenerator do
6
+ describe AutomationGenerator do
7
7
  context 'with selenium' do
8
8
  before(:all) do
9
9
  @name = 'rspec-selenium'
10
- RubyRaider::AutomationGenerator.new(['selenium', 'rspec', @name]).invoke_all
10
+ AutomationGenerator.new(['selenium', 'rspec', @name]).invoke_all
11
11
  end
12
12
 
13
13
  it 'creates a login page file' do
@@ -34,7 +34,7 @@ describe RubyRaider::AutomationGenerator do
34
34
  context 'with watir' do
35
35
  before(:all) do
36
36
  @name = 'rspec-watir'
37
- RubyRaider::AutomationGenerator.new(['watir', 'rspec', @name]).invoke_all
37
+ AutomationGenerator.new(['watir', 'rspec', @name]).invoke_all
38
38
  end
39
39
 
40
40
  it 'creates a login page file' do
@@ -61,7 +61,7 @@ describe RubyRaider::AutomationGenerator do
61
61
  context 'with appium' do
62
62
  before(:all) do
63
63
  @name = 'rspec-appium'
64
- RubyRaider::AutomationGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
64
+ AutomationGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
65
65
  end
66
66
 
67
67
  it 'creates a login page file' do
@@ -99,7 +99,7 @@ describe RubyRaider::AutomationGenerator do
99
99
  context 'with cucumber and selenium' do
100
100
  before(:all) do
101
101
  @name = 'cucumber-selenium'
102
- RubyRaider::AutomationGenerator.new(['selenium', 'cucumber', @name]).invoke_all
102
+ AutomationGenerator.new(['selenium', 'cucumber', @name]).invoke_all
103
103
  end
104
104
 
105
105
  it 'creates a login page file' do
@@ -126,7 +126,7 @@ describe RubyRaider::AutomationGenerator do
126
126
  context 'with cucumber and watir' do
127
127
  before(:all) do
128
128
  @name = 'cucumber-watir'
129
- RubyRaider::AutomationGenerator.new(['watir', 'cucumber', @name]).invoke_all
129
+ AutomationGenerator.new(['watir', 'cucumber', @name]).invoke_all
130
130
  end
131
131
 
132
132
  it 'creates a login page file' do
@@ -153,7 +153,7 @@ describe RubyRaider::AutomationGenerator do
153
153
  context 'with cucumber and appium' do
154
154
  before(:all) do
155
155
  @name = 'cucumber-appium'
156
- RubyRaider::AutomationGenerator.new(['appium_ios', 'cucumber', @name]).invoke_all
156
+ AutomationGenerator.new(['appium_ios', 'cucumber', @name]).invoke_all
157
157
  end
158
158
 
159
159
  it 'creates a login page file' do
@@ -3,11 +3,11 @@
3
3
  require_relative '../lib/generators/common_generator'
4
4
  require_relative 'spec_helper'
5
5
 
6
- describe RubyRaider::CommonGenerator do
6
+ describe CommonGenerator do
7
7
  context 'with selenium' do
8
8
  before(:all) do
9
9
  @name = 'rspec-selenium'
10
- RubyRaider::CommonGenerator.new(['selenium', 'rspec', @name]).invoke_all
10
+ CommonGenerator.new(['selenium', 'rspec', @name]).invoke_all
11
11
  end
12
12
 
13
13
  it 'creates a config file' do
@@ -34,7 +34,7 @@ describe RubyRaider::CommonGenerator do
34
34
  context 'with watir' do
35
35
  before(:all) do
36
36
  @name = 'rspec-watir'
37
- RubyRaider::CommonGenerator.new(['watir', 'rspec', @name]).invoke_all
37
+ CommonGenerator.new(['watir', 'rspec', @name]).invoke_all
38
38
  end
39
39
 
40
40
  it 'creates a config file' do
@@ -61,7 +61,7 @@ describe RubyRaider::CommonGenerator do
61
61
  context 'with appium' do
62
62
  before(:all) do
63
63
  @name = 'rspec-appium'
64
- RubyRaider::CommonGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
64
+ CommonGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
65
65
  end
66
66
 
67
67
  it 'creates a config file' do
@@ -87,7 +87,7 @@ describe RubyRaider::CommonGenerator do
87
87
  context 'with cucumber and selenium' do
88
88
  before(:all) do
89
89
  @name = 'cucumber-selenium'
90
- RubyRaider::CommonGenerator.new(['selenium', 'cucumber', @name]).invoke_all
90
+ CommonGenerator.new(['selenium', 'cucumber', @name]).invoke_all
91
91
  end
92
92
 
93
93
  it 'creates a config file' do
@@ -114,7 +114,7 @@ describe RubyRaider::CommonGenerator do
114
114
  context 'with cucumber and watir' do
115
115
  before(:all) do
116
116
  @name = 'cucumber-watir'
117
- RubyRaider::CommonGenerator.new(['watir', 'cucumber', @name]).invoke_all
117
+ CommonGenerator.new(['watir', 'cucumber', @name]).invoke_all
118
118
  end
119
119
 
120
120
  it 'creates a config file' do
@@ -3,11 +3,11 @@
3
3
  require_relative '../lib/generators/cucumber_generator'
4
4
  require_relative 'spec_helper'
5
5
 
6
- describe RubyRaider::CucumberGenerator do
6
+ describe CucumberGenerator do
7
7
  context 'with selenium' do
8
8
  before(:all) do
9
9
  @name = 'cucumber-selenium'
10
- RubyRaider::CucumberGenerator.new(['selenium', 'cucumber', @name]).invoke_all
10
+ CucumberGenerator.new(['selenium', 'cucumber', @name]).invoke_all
11
11
  end
12
12
 
13
13
  it 'creates a feature file' do
@@ -34,7 +34,7 @@ describe RubyRaider::CucumberGenerator do
34
34
  context 'with watir' do
35
35
  before(:all) do
36
36
  @name = 'cucumber-watir'
37
- RubyRaider::CucumberGenerator.new(['watir', 'cucumber', @name]).invoke_all
37
+ CucumberGenerator.new(['watir', 'cucumber', @name]).invoke_all
38
38
  end
39
39
 
40
40
  it 'creates a feature file' do
@@ -57,7 +57,7 @@ describe RubyRaider::CucumberGenerator do
57
57
  context 'with appium' do
58
58
  before(:all) do
59
59
  @name = 'cucumber-appium'
60
- RubyRaider::CucumberGenerator.new(['appium_ios', 'cucumber', @name]).invoke_all
60
+ CucumberGenerator.new(['appium_ios', 'cucumber', @name]).invoke_all
61
61
  end
62
62
 
63
63
  it 'creates a feature file' do
@@ -3,11 +3,11 @@
3
3
  require_relative '../lib/generators/helper_generator'
4
4
  require_relative 'spec_helper'
5
5
 
6
- describe RubyRaider::HelpersGenerator do
6
+ describe HelpersGenerator do
7
7
  context 'with selenium' do
8
8
  before(:all) do
9
9
  @name = 'rspec-selenium'
10
- RubyRaider::HelpersGenerator.new(['selenium', 'rspec', @name]).invoke_all
10
+ HelpersGenerator.new(['selenium', 'rspec', @name]).invoke_all
11
11
  end
12
12
 
13
13
  it 'creates a raider file' do
@@ -34,7 +34,7 @@ describe RubyRaider::HelpersGenerator do
34
34
  context 'with watir' do
35
35
  before(:all) do
36
36
  @name = 'rspec-watir'
37
- RubyRaider::HelpersGenerator.new(['watir', 'rspec', @name]).invoke_all
37
+ HelpersGenerator.new(['watir', 'rspec', @name]).invoke_all
38
38
  end
39
39
 
40
40
  it 'creates a browser helper file', :watir do
@@ -57,7 +57,7 @@ describe RubyRaider::HelpersGenerator do
57
57
  context 'with appium' do
58
58
  before(:all) do
59
59
  @name = 'rspec-appium'
60
- RubyRaider::HelpersGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
60
+ HelpersGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
61
61
  end
62
62
 
63
63
  it 'creates a raider file' do
@@ -79,7 +79,7 @@ describe RubyRaider::HelpersGenerator do
79
79
  context 'with cucumber and selenium' do
80
80
  before(:all) do
81
81
  @name = 'cucumber-selenium'
82
- RubyRaider::HelpersGenerator.new(['selenium', 'cucumber', @name]).invoke_all
82
+ HelpersGenerator.new(['selenium', 'cucumber', @name]).invoke_all
83
83
  end
84
84
 
85
85
  it 'creates an allure helper file' do
@@ -102,7 +102,7 @@ describe RubyRaider::HelpersGenerator do
102
102
  context 'with cucumber and watir' do
103
103
  before(:all) do
104
104
  @name = 'cucumber-watir'
105
- RubyRaider::HelpersGenerator.new(['watir', 'cucumber', @name]).invoke_all
105
+ HelpersGenerator.new(['watir', 'cucumber', @name]).invoke_all
106
106
  end
107
107
 
108
108
  it 'creates a browser helper file', :watir do
@@ -3,11 +3,11 @@
3
3
  require_relative '../lib/generators/rspec_generator'
4
4
  require_relative 'spec_helper'
5
5
 
6
- describe RubyRaider::RspecGenerator do
6
+ describe RspecGenerator do
7
7
  context 'with selenium' do
8
8
  before(:all) do
9
9
  @name = 'rspec-selenium'
10
- RubyRaider::RspecGenerator.new(['selenium', 'rspec', @name]).invoke_all
10
+ RspecGenerator.new(['selenium', 'rspec', @name]).invoke_all
11
11
  end
12
12
 
13
13
  it 'creates a spec file' do
@@ -26,7 +26,7 @@ describe RubyRaider::RspecGenerator do
26
26
  context 'with watir' do
27
27
  before(:all) do
28
28
  @name = 'rspec-watir'
29
- RubyRaider::RspecGenerator.new(['watir', 'rspec', @name]).invoke_all
29
+ RspecGenerator.new(['watir', 'rspec', @name]).invoke_all
30
30
  end
31
31
 
32
32
  it 'creates a spec file' do
@@ -45,7 +45,7 @@ describe RubyRaider::RspecGenerator do
45
45
  context 'with appium' do
46
46
  before(:all) do
47
47
  @name = 'rspec-appium'
48
- RubyRaider::RspecGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
48
+ RspecGenerator.new(['appium_ios', 'rspec', @name]).invoke_all
49
49
  end
50
50
 
51
51
  it 'creates a spec file' do
@@ -0,0 +1,159 @@
1
+ require 'pathname'
2
+ require 'yaml'
3
+ require_relative 'spec_helper'
4
+ require_relative '../lib/ruby_raider'
5
+ require_relative '../lib/generators/common_generator'
6
+
7
+ describe RubyRaider do
8
+ let(:raider) { RubyRaider }
9
+ let(:name) {'test'}
10
+
11
+ context 'with path from config file' do
12
+ before(:all) do
13
+ CommonGenerator.new(%w[rspec cucumber test]).invoke(:generate_config_file)
14
+ FileUtils.cp_lr('test/config', './')
15
+ end
16
+
17
+ it 'creates a page' do
18
+ raider.new.invoke(:page, nil, %W[#{name}])
19
+ expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to be_file
20
+ end
21
+
22
+ it 'creates a feature' do
23
+ raider.new.invoke(:feature, nil, %W[#{name}])
24
+ expect(Pathname.new("features/#{name}.feature")).to be_file
25
+ end
26
+
27
+ it 'creates a spec' do
28
+ raider.new.invoke(:spec, nil, %W[#{name}])
29
+ expect(Pathname.new("spec/#{name}_spec.rb")).to be_file
30
+ end
31
+
32
+ it 'deletes a page' do
33
+ raider.new.invoke(:page, nil, %W[#{name}])
34
+ raider.new.invoke(:page, nil, %W[#{name} --delete])
35
+ expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to_not be_file
36
+ end
37
+
38
+ it 'deletes a feature' do
39
+ raider.new.invoke(:feature, nil, %W[#{name}])
40
+ raider.new.invoke(:feature, nil, %W[#{name} --delete])
41
+ expect(Pathname.new("features/#{name}.feature")).to_not be_file
42
+ end
43
+
44
+ it 'deletes a spec' do
45
+ raider.new.invoke(:spec, nil, %W[#{name}])
46
+ raider.new.invoke(:spec, nil, %W[#{name} --delete])
47
+ expect(Pathname.new("spec/#{name}_spec.rb")).to_not be_file
48
+ end
49
+
50
+ after(:all) do
51
+ folders = %w[test config page_objects features]
52
+ folders.each do |folder|
53
+ FileUtils.rm_rf(folder)
54
+ end
55
+ FileUtils.rm('spec/test_spec.rb') if Pathname.new('spec/test_spec.rb').exist?
56
+ end
57
+ end
58
+
59
+ context 'with path option' do
60
+ let(:path) { 'test_folder' }
61
+
62
+ it 'creates a page' do
63
+ raider.new.invoke(:page, nil, %W[#{name} --path #{path}])
64
+ expect(Pathname.new("#{path}/#{name}_page.rb")).to be_file
65
+ end
66
+
67
+ it 'creates a feature' do
68
+ raider.new.invoke(:feature, nil, %W[#{name} --path #{path}])
69
+ expect(Pathname.new("#{path}/#{name}.feature")).to be_file
70
+ end
71
+
72
+ it 'creates a spec' do
73
+ raider.new.invoke(:spec, nil, %W[#{name} --path #{path}])
74
+ expect(Pathname.new("#{path}/#{name}_spec.rb")).to be_file
75
+ end
76
+
77
+ after(:each) do
78
+ FileUtils.rm_rf(path)
79
+ end
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
159
+ 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.2.8
4
+ version: 0.3.1
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-26 00:00:00.000000000 Z
11
+ date: 2022-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -115,10 +115,15 @@ executables:
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
119
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
118
120
  - ".gitignore"
119
121
  - ".reek.yml"
120
122
  - ".rubocop.yml"
123
+ - CODE_OF_CONDUCT.md
124
+ - CONTRIBUTING.md
121
125
  - Gemfile
126
+ - LICENSE
122
127
  - README.md
123
128
  - Rakefile
124
129
  - bin/raider
@@ -184,8 +189,9 @@ files:
184
189
  - spec/cucumber_generator_spec.rb
185
190
  - spec/helpers_generator_spec.rb
186
191
  - spec/rspec_generator_spec.rb
192
+ - spec/ruby_raider_spec.rb
187
193
  - spec/spec_helper.rb
188
- homepage: http://github.com/aguspe/ruby_raider
194
+ homepage: https://github.com/RubyRaider/ruby_raider
189
195
  licenses:
190
196
  - MIT
191
197
  metadata: {}