ruby_raider 0.2.9 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d575add5f8d018b9cab6a72968c22e2bf00808982e7ddde0e325ec7b7c0a909c
4
- data.tar.gz: b6536a04863e704a8e5a99220f956d43ab68ee3a459b184b0358756f834b6a58
3
+ metadata.gz: 83e7e23f59e2e6864f53d64723ce6c381b48790be638f1a6a68a443066ec79b0
4
+ data.tar.gz: 11e974c23bbea75f85cae9eeab28629e10bf29f2bf41666caf05e5f11131faa0
5
5
  SHA512:
6
- metadata.gz: fe3f887d46ccba5928977aedca472b3c530d60b4fce6a9dc11ec89f1f313a433cb44a32161acf1dd9f809ad86b8e3a9ee01cc957da01604e9b2e8a3ef13cfa9e
7
- data.tar.gz: 1fdf3654fcf68315a99b67b70814d3bfbc2766747e20f0b0f86d6052b200a9b092edf6c4f4cd45505a6ca69c51fe3b7882a49f2de0436cf4f4f456a254cf7af8
6
+ metadata.gz: e73135a4d13b39478976fd99beb0dfe42da3038518e7616b21f6aba3449bb82994770fa90df827ab30ae1febfd0eb5b38b22aa492efdebc6ebf1cbbf6d541925
7
+ data.tar.gz: 69d1474035d9ac00aaae5bf940fc97856958a583b34514f088fbe0922144f1b9ded788ee9cf504d6c620345758676d1f49d01491fb647841b1b7cec5b9cbdbab
@@ -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/lib/ruby_raider.rb CHANGED
@@ -6,48 +6,83 @@ 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 : 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 : 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 : 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
+
29
61
  def path(default_path)
30
62
  Utilities.new.path = default_path
31
63
  end
32
64
 
33
65
  desc "url [URL]", "Sets the default url for a project"
66
+
34
67
  def url(default_url)
35
68
  Utilities.new.url = default_url
36
69
  end
37
70
 
38
71
  desc "browser [BROWSER]", "Sets the default browser for a project"
72
+
39
73
  def browser(default_browser)
40
74
  Utilities.new.browser = default_browser
41
75
  end
42
76
 
43
77
  desc "raid", "It runs all the tests in a project"
78
+
44
79
  def raid
45
80
  Utilities.new.run
46
81
  end
47
82
 
48
83
  no_commands do
49
84
  def load_config_path
50
- YAML.load_file('config/config.yml')['path']
85
+ YAML.load_file('config/config.yml')['path'] unless YAML.load_file('config/config.yml').nil?
51
86
  end
52
87
  end
53
- end
88
+ 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
 
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.9'
5
+ s.version = '0.3.0'
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']
@@ -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,80 @@
1
+ require 'pathname'
2
+ require_relative 'spec_helper'
3
+ require_relative '../lib/ruby_raider'
4
+ require_relative '../lib/generators/common_generator'
5
+
6
+ describe RubyRaider do
7
+ let(:raider) { RubyRaider }
8
+ let(:name) {'test'}
9
+
10
+ context 'with path from config file' do
11
+ before(:all) do
12
+ CommonGenerator.new(%w[rspec cucumber test]).invoke(:generate_config_file)
13
+ FileUtils.cp_lr('test/config', './')
14
+ end
15
+
16
+ it 'creates a page' do
17
+ raider.new.invoke(:page, nil, %W[#{name}])
18
+ expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to be_file
19
+ end
20
+
21
+ it 'creates a feature' do
22
+ raider.new.invoke(:feature, nil, %W[#{name}])
23
+ expect(Pathname.new("features/#{name}.feature")).to be_file
24
+ end
25
+
26
+ it 'creates a spec' do
27
+ raider.new.invoke(:spec, nil, %W[#{name}])
28
+ expect(Pathname.new("spec/#{name}_spec.rb")).to be_file
29
+ end
30
+
31
+ it 'deletes a page' do
32
+ raider.new.invoke(:page, nil, %W[#{name}])
33
+ raider.new.invoke(:page, nil, %W[#{name} --delete])
34
+ expect(Pathname.new("page_objects/pages/#{name}_page.rb")).to_not be_file
35
+ end
36
+
37
+ it 'deletes a feature' do
38
+ raider.new.invoke(:feature, nil, %W[#{name}])
39
+ raider.new.invoke(:feature, nil, %W[#{name} --delete])
40
+ expect(Pathname.new("features/#{name}.feature")).to_not be_file
41
+ end
42
+
43
+ it 'deletes a spec' do
44
+ raider.new.invoke(:spec, nil, %W[#{name}])
45
+ raider.new.invoke(:spec, nil, %W[#{name} --delete])
46
+ expect(Pathname.new("spec/#{name}_spec.rb")).to_not be_file
47
+ end
48
+
49
+ after(:all) do
50
+ folders = %w[test config page_objects features]
51
+ folders.each do |folder|
52
+ FileUtils.rm_rf(folder)
53
+ end
54
+ FileUtils.rm('spec/test_spec.rb') if Pathname.new('spec/test_spec.rb').exist?
55
+ end
56
+ end
57
+
58
+ context 'with path option' do
59
+ let(:path) { 'test_folder' }
60
+
61
+ it 'creates a page' do
62
+ raider.new.invoke(:page, nil, %W[#{name} --path #{path}])
63
+ expect(Pathname.new("#{path}/#{name}_page.rb")).to be_file
64
+ end
65
+
66
+ it 'creates a feature' do
67
+ raider.new.invoke(:feature, nil, %W[#{name} --path #{path}])
68
+ expect(Pathname.new("#{path}/#{name}.feature")).to be_file
69
+ end
70
+
71
+ it 'creates a spec' do
72
+ raider.new.invoke(:spec, nil, %W[#{name} --path #{path}])
73
+ expect(Pathname.new("#{path}/#{name}_spec.rb")).to be_file
74
+ end
75
+
76
+ after(:each) do
77
+ FileUtils.rm_rf(path)
78
+ end
79
+ end
80
+ 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.9
4
+ version: 0.3.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: 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,6 +189,7 @@ 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
194
  homepage: http://github.com/aguspe/ruby_raider
189
195
  licenses: