rubygene 0.1.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 +7 -0
- data/.gitignore +22 -0
- data/.rspec +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +152 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/rubygene +207 -0
- data/bin/setup +8 -0
- data/lib/SkeletonApi/.gitignore +1 -0
- data/lib/SkeletonApi/Gemfile +6 -0
- data/lib/SkeletonApi/README.md +36 -0
- data/lib/SkeletonApi/Rakefile +11 -0
- data/lib/SkeletonApi/cucumber.yml +13 -0
- data/lib/SkeletonApi/features/services/.gitkeep +0 -0
- data/lib/SkeletonApi/features/specifications/.gitkeep +0 -0
- data/lib/SkeletonApi/features/steps_definitions/.gitkeep +0 -0
- data/lib/SkeletonApi/features/support/config/dev.yaml +1 -0
- data/lib/SkeletonApi/features/support/config/hmg.yaml +1 -0
- data/lib/SkeletonApi/features/support/env.rb +13 -0
- data/lib/SkeletonApi/results/report.html +0 -0
- data/lib/SkeletonApi/results/report.json +0 -0
- data/lib/SkeletonMobile/.gitignore +1 -0
- data/lib/SkeletonMobile/Gemfile +7 -0
- data/lib/SkeletonMobile/README.md +37 -0
- data/lib/SkeletonMobile/cucumber.yml +7 -0
- data/lib/SkeletonMobile/features/screens/.gitkeep +0 -0
- data/lib/SkeletonMobile/features/specifications/.gitkeep +0 -0
- data/lib/SkeletonMobile/features/steps_definitions/.gitkeep +0 -0
- data/lib/SkeletonMobile/features/support/appium.txt +4 -0
- data/lib/SkeletonMobile/features/support/env.rb +25 -0
- data/lib/SkeletonMobile/features/support/helper.rb +11 -0
- data/lib/SkeletonMobile/features/support/hooks.rb +23 -0
- data/lib/SkeletonMobile/features/support/page_helper.rb +3 -0
- data/lib/SkeletonMobile/results/report.html +0 -0
- data/lib/SkeletonMobile/results/report.json +0 -0
- data/lib/SkeletonMobile/results/screenshots/.gitkeep +0 -0
- data/lib/SkeletonWeb/.gitignore +1 -0
- data/lib/SkeletonWeb/Gemfile +10 -0
- data/lib/SkeletonWeb/README.md +49 -0
- data/lib/SkeletonWeb/Rakefile +23 -0
- data/lib/SkeletonWeb/cucumber.yml +15 -0
- data/lib/SkeletonWeb/features/pages/.gitkeep +0 -0
- data/lib/SkeletonWeb/features/specifications/.gitkeep +0 -0
- data/lib/SkeletonWeb/features/steps_definitions/.gitkeep +0 -0
- data/lib/SkeletonWeb/features/support/config/dev.yml +1 -0
- data/lib/SkeletonWeb/features/support/config/hmg.yml +1 -0
- data/lib/SkeletonWeb/features/support/env.rb +34 -0
- data/lib/SkeletonWeb/features/support/helper.rb +22 -0
- data/lib/SkeletonWeb/features/support/hooks.rb +15 -0
- data/lib/SkeletonWeb/features/support/page_helper.rb +6 -0
- data/lib/SkeletonWeb/results/report.html +0 -0
- data/lib/SkeletonWeb/results/report.json +0 -0
- data/lib/SkeletonWeb/results/screenshots/.gitkeep +0 -0
- data/lib/generate_ruby_tests/generate_ruby_test_helper.rb +59 -0
- data/lib/generate_ruby_tests/version.rb +3 -0
- data/lib/generate_ruby_tests.rb +5 -0
- data/lib/locales/en.yml +7 -0
- data/lib/locales/pt.yml +7 -0
- data/lib/templates/feature.tt +8 -0
- data/lib/templates/page.tt +6 -0
- data/lib/templates/screens.tt +5 -0
- data/lib/templates/services.tt +8 -0
- data/lib/templates/steps.tt +5 -0
- data/rubygene.gemspec +30 -0
- metadata +198 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 60d6e9b47a4c0fc6bc66119f816f7a96d3c0bc93
|
4
|
+
data.tar.gz: 04e53d56213399059b9dde063444b840cc39b1c0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 680e6dea73e4b68dd3f2e2cb2a99cd465f5b4981625870b588a15256e98338fb4067bb2c8e17182b4b38719b31fcc8d9ba9fccc6a8f0d6809ab6b5e41c40f242
|
7
|
+
data.tar.gz: 190d79820501fd6942106c6e77084da7a1faf98adc9fdb366174171cca29f3fb58f194faedb6ff90c4b8bf7db5adf62da3b4e0512e20d9c2d635a4834d73b998
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
.idea/
|
2
|
+
/.bundle/
|
3
|
+
/doc/
|
4
|
+
/pkg/
|
5
|
+
/spec/reports/
|
6
|
+
/tmp/
|
7
|
+
*.bundle
|
8
|
+
*.so
|
9
|
+
*.o
|
10
|
+
*.a
|
11
|
+
mkmf.log
|
12
|
+
.irb-history
|
13
|
+
.DS_Store
|
14
|
+
Gemfile.lock
|
15
|
+
coverage/
|
16
|
+
File::NULL
|
17
|
+
/.yardoc
|
18
|
+
/_yardoc/
|
19
|
+
/coverage/
|
20
|
+
|
21
|
+
# rspec failure tracking
|
22
|
+
.rspec_status
|
data/.rspec
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at brunobatista101@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 brunobatista25
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
# GenerateRubyTests
|
2
|
+
|
3
|
+
Bem vindo a gem RubyGene é uma gem baseada na gem [Magneton](https://github.com/concretesolutions/magneton).
|
4
|
+
|
5
|
+
O intuito da gem RubyGene é conseguir gerar projetos já configurados para um projeto Web, Mobile ou Api. Todos eles baseados na estrutura de um projeto em cucumber.
|
6
|
+
|
7
|
+
## Instalação
|
8
|
+
|
9
|
+
Adicione este comando no terminal:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem install generate_ruby_tests
|
13
|
+
```
|
14
|
+
|
15
|
+
# Usando a gem
|
16
|
+
|
17
|
+
|
18
|
+
## Gerar um projeto Web
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
rubygene new_web nome_do_projeto
|
22
|
+
```
|
23
|
+
|
24
|
+
Onde irá gerar um projeto deste modelo, já com tudo configurado:
|
25
|
+
|
26
|
+
Features: Onde fica as funcionalidades do projeto;
|
27
|
+
|
28
|
+
Steps: Onde são realizados os testes de fato;
|
29
|
+
|
30
|
+
Pages: Onde fica mapeado os elementos e metódos de uma determinada página;
|
31
|
+
|
32
|
+
Support: Onde fica as configuraçōes do projeto;
|
33
|
+
|
34
|
+
Results: Onde fica o resultado dos testes e relatórios.
|
35
|
+
|
36
|
+
## Gerar um projeto Api
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
rubygene new_api nome_do_projeto
|
40
|
+
```
|
41
|
+
|
42
|
+
Onde irá gerar um projeto deste modelo, já com tudo configurado:
|
43
|
+
|
44
|
+
Features: Onde fica as funcionalidades do projeto;
|
45
|
+
|
46
|
+
Steps: Onde são realizados os testes de fato;
|
47
|
+
|
48
|
+
Services: Onde fica as configuraçōes do serviço;
|
49
|
+
|
50
|
+
Support: Onde fica as configuraçōes do projeto;
|
51
|
+
|
52
|
+
Results: Onde fica o resultado dos testes e relatórios.
|
53
|
+
|
54
|
+
## Gerar um projeto Mobile
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
rubygene new_mobile nome_do_projeto
|
58
|
+
```
|
59
|
+
|
60
|
+
Onde irá gerar um projeto deste modelo, já com tudo configurado:
|
61
|
+
|
62
|
+
Features: Onde fica as funcionalidades do projeto;
|
63
|
+
|
64
|
+
Steps: Onde são realizados os testes de fato;
|
65
|
+
|
66
|
+
Screens: Onde fica mapeado os elementos e metódos de uma determinada screen;
|
67
|
+
|
68
|
+
Support: Onde fica as configuraçōes do projeto;
|
69
|
+
|
70
|
+
Results: Onde fica o resultado dos testes e relatórios.
|
71
|
+
|
72
|
+
E tambem é possivel gerar os steps,features,services,pages etc... sozinhos
|
73
|
+
|
74
|
+
## Gerar um step
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
rubygene generate step nome_do_step
|
78
|
+
```
|
79
|
+
|
80
|
+
## Gerar um feature
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
rubygene generate feature nome_da_feature
|
84
|
+
```
|
85
|
+
|
86
|
+
## Gerar um page
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
rubygene generate page nome_da_page
|
90
|
+
```
|
91
|
+
|
92
|
+
## Gerar um screens
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
rubygene generate screen nome_da_screen
|
96
|
+
```
|
97
|
+
|
98
|
+
## Gerar um services
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
rubygene generate service nome_do_service
|
102
|
+
```
|
103
|
+
|
104
|
+
Agora se precisar criar uma feature, page e step também tem um atalho pra isso :)
|
105
|
+
|
106
|
+
## Gerar feature,page,step
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
rubygene generate all_web
|
110
|
+
```
|
111
|
+
|
112
|
+
Agora se precisar criar uma feature, screens e step também tem um atalho pra isso :)
|
113
|
+
|
114
|
+
## Gerar feature,screens,step
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
rubygene generate all_mobile
|
118
|
+
```
|
119
|
+
|
120
|
+
Agora se precisar criar uma feature, services e step também tem um atalho pra isso :)
|
121
|
+
|
122
|
+
## Gerar feature,services,step
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
rubygene generate all_api
|
126
|
+
```
|
127
|
+
|
128
|
+
Por padrão tudo e gerado em inglês caso precise utilizar em português rode com o `--lang=pt`
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
rubygene generate all_api --lang=pt
|
132
|
+
```
|
133
|
+
|
134
|
+
## Para Proximas versōes
|
135
|
+
|
136
|
+
- Adicionar gerador pra JsonSchema
|
137
|
+
- Adicionar gerador de projeto calabash
|
138
|
+
- Adicionar gerador para projetos Rspec pra Web, Mobile e Api.
|
139
|
+
|
140
|
+
## Contribuição
|
141
|
+
|
142
|
+
Relatórios de bugs e solicitações de recebimento são bem-vindos no GitHub em https://github.com/brunobatista25/rubygene. Este projeto destina-se a ser um espaço seguro e acolhedor para colaboração, e espera-se que os contribuintes adiram à [Contributor Covenant](http://contributor-covenant.org) Código de conduta.
|
143
|
+
|
144
|
+
## Licença
|
145
|
+
|
146
|
+
A gema está disponível como código aberto sob os termos do
|
147
|
+
[MIT License](https://opensource.org/licenses/MIT).
|
148
|
+
|
149
|
+
## Código de conduta
|
150
|
+
|
151
|
+
Espera-se que todos que interagem nas bases de código do projeto RubyGene, rastreadores de problemas, salas de bate-papo e listas de discussão sigam o
|
152
|
+
[code of conduct](https://github.com/brunobatista25/rubygene/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "generate_ruby_tests"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/rubygene
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
require 'thor'
|
5
|
+
require 'thor/group'
|
6
|
+
require 'i18n'
|
7
|
+
require 'gherkin' # Used here as a translation source
|
8
|
+
require 'json'
|
9
|
+
require 'yaml'
|
10
|
+
|
11
|
+
require File.join(File.dirname(__FILE__),
|
12
|
+
'../lib/generate_ruby_tests/generate_ruby_test_helper')
|
13
|
+
require_relative '../lib/generate_ruby_tests/version'
|
14
|
+
|
15
|
+
module GeneCapybara
|
16
|
+
# Definição de todos os geradores de gemas
|
17
|
+
class Generate < Thor
|
18
|
+
include Thor::Actions
|
19
|
+
|
20
|
+
desc 'feature [RESOURCE_NAME]', 'Generates a feature'
|
21
|
+
option :lang,
|
22
|
+
banner: 'any of the gherkin supported languages',
|
23
|
+
default: :en
|
24
|
+
def feature(name)
|
25
|
+
I18n.config.default_locale = options[:lang]
|
26
|
+
in_root_project_folder?
|
27
|
+
create_feature_file(name)
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'step [RESOURCE_NAME]', 'Generates a step'
|
31
|
+
option :lang,
|
32
|
+
banner: 'any of the gherkin supported languages',
|
33
|
+
default: :en
|
34
|
+
def step(name)
|
35
|
+
I18n.config.default_locale = options[:lang]
|
36
|
+
in_root_project_folder?
|
37
|
+
create_steps_file name
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'page [RESOURCE_NAME]', 'Generates pages'
|
41
|
+
option :lang,
|
42
|
+
banner: 'any of the gherkin supported languages',
|
43
|
+
default: :en
|
44
|
+
def page(name)
|
45
|
+
I18n.config.default_locale = options[:lang]
|
46
|
+
in_root_project_folder?
|
47
|
+
create_page_file name
|
48
|
+
end
|
49
|
+
|
50
|
+
desc 'screens [RESOURCE_NAME]', 'Generates screens'
|
51
|
+
option :lang,
|
52
|
+
banner: 'any of the gherkin supported languages',
|
53
|
+
default: :en
|
54
|
+
def screen(name)
|
55
|
+
I18n.config.default_locale = options[:lang]
|
56
|
+
in_root_project_folder?
|
57
|
+
create_screens_file name
|
58
|
+
end
|
59
|
+
|
60
|
+
desc 'services [RESOURCE_NAME]', 'Generates services'
|
61
|
+
option :lang,
|
62
|
+
banner: 'any of the gherkin supported languages',
|
63
|
+
default: :en
|
64
|
+
def service(name)
|
65
|
+
I18n.config.default_locale = options[:lang]
|
66
|
+
in_root_project_folder?
|
67
|
+
create_service_file name
|
68
|
+
end
|
69
|
+
|
70
|
+
desc 'all_web [RESOURCE_NAME]', 'Generates features, steps and pages'
|
71
|
+
option :lang,
|
72
|
+
banner: 'any of the gherkin supported languages',
|
73
|
+
default: :en
|
74
|
+
def all_web(name)
|
75
|
+
I18n.config.default_locale = options[:lang]
|
76
|
+
in_root_project_folder?
|
77
|
+
create_feature_file(name)
|
78
|
+
create_steps_file name
|
79
|
+
create_page_file name
|
80
|
+
end
|
81
|
+
|
82
|
+
desc 'all_mobile [RESOURCE_NAME]', 'Generates features, steps and screens'
|
83
|
+
option :lang,
|
84
|
+
banner: 'any of the gherkin supported languages',
|
85
|
+
default: :en
|
86
|
+
def all_mobile(name)
|
87
|
+
I18n.config.default_locale = options[:lang]
|
88
|
+
in_root_project_folder?
|
89
|
+
create_feature_file(name)
|
90
|
+
create_steps_file name
|
91
|
+
create_screens_file name
|
92
|
+
end
|
93
|
+
|
94
|
+
desc 'all_api [RESOURCE_NAME]', 'Generates feature and steps'
|
95
|
+
option :lang,
|
96
|
+
banner: 'any of the gherkin supported languages',
|
97
|
+
default: :en
|
98
|
+
def all_api(name)
|
99
|
+
I18n.config.default_locale = options[:lang]
|
100
|
+
in_root_project_folder?
|
101
|
+
create_feature_file(name)
|
102
|
+
create_steps_file name
|
103
|
+
create_service_file name
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.source_root
|
107
|
+
File.join(File.dirname(__FILE__), '..', 'lib', 'templates')
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
module GeneCapybara
|
113
|
+
# Definição dos grupos geradores
|
114
|
+
class GeneCapybaraRunner < Thor
|
115
|
+
include Thor::Actions
|
116
|
+
|
117
|
+
map '-v' => :version
|
118
|
+
map '--version' => :version
|
119
|
+
|
120
|
+
default_task :help
|
121
|
+
|
122
|
+
register GeneCapybara::Generate, 'generate',
|
123
|
+
'generate [GENERATOR] [RESOURCE_NAME]',
|
124
|
+
'Generates various resources'
|
125
|
+
register GeneCapybara::Generate, 'g',
|
126
|
+
'g [GENERATOR] [RESOURCE_NAME]',
|
127
|
+
'Generates various resources'
|
128
|
+
|
129
|
+
desc 'new web PROJECT_NAME',
|
130
|
+
'Generates the structure of a new project that uses '\
|
131
|
+
'Capybara, SitePrism, Selenium and Cucumber'
|
132
|
+
option :lang,
|
133
|
+
banner: 'any of the gherkin supported languages',
|
134
|
+
default: :en
|
135
|
+
def new_web(name)
|
136
|
+
I18n.config.default_locale = options[:lang]
|
137
|
+
# Thor sera responsavel por procurar
|
138
|
+
# arquivos e possiveis conflitos
|
139
|
+
directory File.join(File.dirname(__FILE__),
|
140
|
+
'../lib/SkeletonWeb'), name
|
141
|
+
end
|
142
|
+
|
143
|
+
desc 'new api PROJECT_NAME',
|
144
|
+
'Generates the structure of api'
|
145
|
+
option :lang,
|
146
|
+
banner: 'any of the gherkin supported languages',
|
147
|
+
default: :en
|
148
|
+
def new_api(name)
|
149
|
+
I18n.config.default_locale = options[:lang]
|
150
|
+
# Thor sera responsavel por procurar
|
151
|
+
# arquivos e possiveis conflitos
|
152
|
+
directory File.join(File.dirname(__FILE__),
|
153
|
+
'../lib/SkeletonApi'), name
|
154
|
+
end
|
155
|
+
|
156
|
+
desc 'new mobile PROJECT_NAME',
|
157
|
+
'Generates the structure of mobile'
|
158
|
+
option :lang,
|
159
|
+
banner: 'any of the gherkin supported languages',
|
160
|
+
default: :en
|
161
|
+
def new_mobile(name)
|
162
|
+
I18n.config.default_locale = options[:lang]
|
163
|
+
# Thor sera responsavel por procurar
|
164
|
+
# arquivos e possiveis conflitos
|
165
|
+
directory File.join(File.dirname(__FILE__),
|
166
|
+
'../lib/SkeletonMobile'), name
|
167
|
+
end
|
168
|
+
|
169
|
+
desc 'version', 'Shows the gem version'
|
170
|
+
def version
|
171
|
+
puts "GeneCapybara Version #{GeneCapybara::VERSION}"
|
172
|
+
end
|
173
|
+
|
174
|
+
def self.source_root
|
175
|
+
File.join(File.dirname(__FILE__), '..', 'lib', 'templates')
|
176
|
+
end
|
177
|
+
|
178
|
+
# Substituindo o metodo initialize para carregar todos os
|
179
|
+
# traducoes suportadas pelo cucumber gem
|
180
|
+
def initialize(*args)
|
181
|
+
super
|
182
|
+
# Loading gherkin accepted translations
|
183
|
+
translations_file_path = File.join(
|
184
|
+
Gem.loaded_specs['gherkin'].full_gem_path,
|
185
|
+
'lib', 'gherkin', 'i18n.json')
|
186
|
+
# Analisando o arquivo JSON
|
187
|
+
# Removendo a sequencia * | e toda a alternativa
|
188
|
+
# opcoes para as traducoes do cucumber
|
189
|
+
translations_json = JSON.parse(File.read(translations_file_path)
|
190
|
+
.gsub(/\*\|/, '')
|
191
|
+
.gsub(/\|.*\"/, '"'))
|
192
|
+
# Convertendo traducoes para YAML e armazenando em um arquivo temporario
|
193
|
+
translations_temp_file = Tempfile.new(['translations', '.yml'])
|
194
|
+
File.write(translations_temp_file, translations_json.to_yaml)
|
195
|
+
# Carregando as traducoes do pepino e do
|
196
|
+
# locales pasta desta gem
|
197
|
+
locales_folder_path = File.join(File.dirname(__FILE__),
|
198
|
+
'../lib/locales')
|
199
|
+
I18n.load_path = Dir[translations_temp_file,
|
200
|
+
File.join(locales_folder_path, '*.yml')]
|
201
|
+
I18n.backend.load_translations
|
202
|
+
I18n.config.enforce_available_locales = true
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
GeneCapybara::GeneCapybaraRunner.start
|
data/bin/setup
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
@@ -0,0 +1,36 @@
|
|
1
|
+
## Getting Started ##
|
2
|
+
|
3
|
+
### Installing gems ###
|
4
|
+
To install gems type:
|
5
|
+
```shell
|
6
|
+
bundle install
|
7
|
+
```
|
8
|
+
|
9
|
+
### Run tests in DEV###
|
10
|
+
Type this in the tests folder:
|
11
|
+
```shell
|
12
|
+
bundle exec cucumber
|
13
|
+
```
|
14
|
+
### Run tests in HMG ###
|
15
|
+
Type this in the tests folder:
|
16
|
+
```shell
|
17
|
+
bundle exec cucumber -p json -p hmg
|
18
|
+
```
|
19
|
+
|
20
|
+
### HTML Report###
|
21
|
+
Type this in the tests folder:
|
22
|
+
```shell
|
23
|
+
bundle exec cucumber -p html -p hmg
|
24
|
+
```
|
25
|
+
|
26
|
+
### Json Report###
|
27
|
+
Type this in the tests folder:
|
28
|
+
```shell
|
29
|
+
bundle exec cucumber -p json -p hmg
|
30
|
+
```
|
31
|
+
|
32
|
+
### Run with tags###
|
33
|
+
Type this in the tests folder:
|
34
|
+
```shell
|
35
|
+
bundle exec cucumber --tags @run
|
36
|
+
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
desc "Executar os testes em dev"
|
2
|
+
task :test_dev do
|
3
|
+
puts "Executando test:dev"
|
4
|
+
sh "bundle exec cucumber -p pretty -p html -p dev"
|
5
|
+
end
|
6
|
+
|
7
|
+
desc "Executar os testes em hmg"
|
8
|
+
task :test_hmg do
|
9
|
+
puts "Executando test:hmg"
|
10
|
+
sh "bundle exec cucumber -p pretty -p html -p hmg"
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
## YAML Templatesss
|
2
|
+
---
|
3
|
+
default: -p ci -p json -p dev
|
4
|
+
|
5
|
+
pretty: --format pretty
|
6
|
+
ci: --format progress
|
7
|
+
|
8
|
+
html: --format html --out=results/report.html
|
9
|
+
json: --format json --out=results/report.json
|
10
|
+
|
11
|
+
dev: ENVIRONMENT=dev
|
12
|
+
hmg: ENVIRONMENT=hmg
|
13
|
+
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
url_default: https://www.google.com/
|
@@ -0,0 +1 @@
|
|
1
|
+
url_default: https://www.google.com/
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'byebug'
|
2
|
+
require 'cucumber'
|
3
|
+
require 'httparty'
|
4
|
+
require 'httparty/request'
|
5
|
+
require 'httparty/response/headers'
|
6
|
+
require 'rspec'
|
7
|
+
|
8
|
+
ENVIRONMENT = ENV['ENVIRONMENT']
|
9
|
+
|
10
|
+
CONFIG = YAML.load_file(File.dirname(__FILE__) + "/config/#{ENVIRONMENT}.yml")
|
11
|
+
|
12
|
+
Dir[File.join(File.dirname(__FILE__),
|
13
|
+
'../services/*_services.rb')].each { |file| require_relative file }
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|