sunomono 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35e12361309a724a9e8cdbe33731a23c7756930a
4
- data.tar.gz: eab5a76b1a76a801a3bb11ef5f64b82b4661a792
3
+ metadata.gz: 330fadc4337c04674a6764bd44a17c230a1d9e9d
4
+ data.tar.gz: cc4a7194db71c27e0eb82f00fabd8d8312955e2e
5
5
  SHA512:
6
- metadata.gz: 143539f7426d7838ab4425a64b906e435f074ad9fceff2a72a3b4629d88b49aeadc5f91bc1ce6473c9e1cd77294c89fb72c81960f79aa7107b2cccb49e870a02
7
- data.tar.gz: 277d9679e19b4e4393ed7863f69c399b2b116d498d3be81ebcba484008168d47b34feaee464807dee41d856f5ca37fcd568f26a086891f0146db2bad3e86b8ab
6
+ metadata.gz: 95ba7d9ac7e3fc547c78d648f342650d55c64720a34fa7df50fe1d988bc9d68d25c88712d9209cd9422e4dff69944360e4703280bef9282969f8646c79cc9151
7
+ data.tar.gz: f8866b7be68711fd629736db6911a2da9824480f162cceb5d7d48e5e6bbaa11db1e03d123cc28448a9fbd92abfe6b3b450b4ff7213f3958b5841afa198eef2ce
@@ -0,0 +1,25 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ version: 2
5
+ jobs:
6
+ build:
7
+ docker:
8
+ # specify the version you desire here
9
+ - image: circleci/ruby:2.4.1
10
+
11
+ working_directory: ~/sunomono
12
+
13
+ steps:
14
+ - checkout
15
+ - run:
16
+ name: install dependencies
17
+ command:
18
+ gem install bundler
19
+ command:
20
+ bundle install
21
+ # run tests!
22
+ - run:
23
+ name: run tests
24
+ command:
25
+ bundle exec rake spec
@@ -1,5 +1,17 @@
1
1
  ## Change log Sunomono
2
2
 
3
+ ### Version 1.0.6
4
+
5
+ - Fix issue https://github.com/concretesolutions/sunomono/issues/23
6
+ - Adding new test files to appium architecture
7
+
8
+
9
+ ### Version 1.0.5
10
+
11
+ - Adding method missing to base_screen, this method provide a way
12
+ to avoid repeat uncessary methods like touch, enter and visible on the screens.
13
+
14
+ - Change circleCI 1.0 to 2.0
3
15
 
4
16
  ### Version 1.0.4
5
17
 
@@ -244,7 +244,7 @@ module Sunomono
244
244
  # files and possibles conflicts
245
245
  if platform.downcase == 'calabash'
246
246
  directory File.join(File.dirname(__FILE__),
247
- '..', 'lib', 'skeleton_'+ platform.to_s), name
247
+ '..', 'lib', 'skeleton_'+ platform.to_s.downcase), name
248
248
 
249
249
  # Copying base steps file with localization
250
250
  template('base_steps', File.join(name, 'features', 'step_definitions',
@@ -262,7 +262,7 @@ module Sunomono
262
262
  # Thor will be responsible to look for identical
263
263
  # files and possibles conflicts
264
264
  directory File.join(File.dirname(__FILE__),
265
- '..', 'lib', 'skeleton_'+ platform.to_s), name
265
+ '..', 'lib', 'skeleton_'+ platform.to_s.downcase), name
266
266
 
267
267
  # Copying base steps file with localization
268
268
  template('appium_base_steps', File.join(name, 'features', 'step_definitions',
@@ -1,3 +1,3 @@
1
1
  module Sunomono
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.0.6'.freeze
3
3
  end
@@ -0,0 +1,284 @@
1
+ require 'sunomono'
2
+
3
+ describe Sunomono do
4
+
5
+ before(:each) do
6
+ @directory = Dir.pwd
7
+ @project_name = 'Sunomono_test'
8
+ @feature_name = 'sunomono'
9
+ @appium = 'appium'
10
+ @appium_upcase = 'APPIUM'
11
+ end
12
+
13
+ after(:each) do
14
+ Dir.chdir(@directory)
15
+ FileUtils.rm_rf(@project_name)
16
+ end
17
+
18
+ describe 'Sunomono gem commands to create appium based files' do
19
+ context 'Returns project created with all files' do
20
+ it 'Create new project using default command' do
21
+ system "sunomono new '#{@appium}' '#{@project_name}' > /dev/null"
22
+
23
+ expect(Dir.entries(@project_name)).
24
+ to include('screenshots', 'features', 'config', 'README.md', 'Gemfile', '.gitignore')
25
+ # Features files
26
+ expect(Dir.entries("#{@project_name}/features")).
27
+ to include('android', 'ios', 'step_definitions', 'support')
28
+ expect(Dir.entries("#{@project_name}/features/android")).
29
+ to include('features', 'screens', 'step_definitions', 'support')
30
+ expect(Dir.entries("#{@project_name}/features/ios")).
31
+ to include('features', 'screens', 'step_definitions')
32
+ expect(Dir.entries("#{@project_name}/features/step_definitions")).
33
+ to include('base_steps.rb')
34
+ expect(Dir.entries("#{@project_name}/features/support")).
35
+ to include('env.rb', 'exceptions.rb', 'android', 'ios')
36
+ expect(Dir.entries("#{@project_name}/features/base_screen")).
37
+ to include('base_screen.rb')
38
+
39
+ # Config files
40
+ expect(Dir.entries("#{@project_name}/config")).
41
+ to include('cucumber.yml', 'email', 'scripts')
42
+
43
+ # Email files
44
+ expect(Dir.entries("#{@project_name}/config/email")).
45
+ to include('template.html')
46
+
47
+ # Scripts files
48
+ expect(Dir.entries("#{@project_name}/config/scripts")).
49
+ to include('android', 'break_build_if_failed.sh', 'check_if_tests_failed.sh', 'ios')
50
+ expect(Dir.entries("#{@project_name}/config/scripts/android")).
51
+ to include('run_tests_all_devices.sh', 'start_emulators.sh', 'stop_emulators.sh')
52
+ expect(Dir.entries("#{@project_name}/config/scripts/ios")).
53
+ to include('.', '..', 'build_app.rb', 'build_app.yml', 'devices.txt', 'run_tests_all_devices.sh')
54
+ end
55
+ end
56
+
57
+ context 'Returns project created' do
58
+ it 'Create new project using upcase word' do
59
+ system "sunomono new '#{@appium_upcase}' '#{@project_name}' > /dev/null"
60
+
61
+ expect(Dir.entries(@project_name)).
62
+ to include('screenshots', 'features', 'config', 'README.md', 'Gemfile', '.gitignore')
63
+ end
64
+ end
65
+
66
+ context 'Try creates new project with a invalid argument' do
67
+ it 'Project will not be generated' do
68
+ system "suno new '#{@appium}' '#{@project_name}' invalid argument > /dev/null"
69
+
70
+ expect(Dir.entries(".")).
71
+ not_to include("#{@project_name}")
72
+ end
73
+ end
74
+
75
+ context 'Generate Feature' do
76
+ it 'Generates all files' do
77
+ system "sunomono new '#{@appium}' '#{@project_name}' > /dev/null"
78
+
79
+ Dir.chdir(@project_name)
80
+
81
+ system "sunomono generate calabash-feature '#{@feature_name}' > /dev/null"
82
+
83
+ expect(Dir.entries("features")).
84
+ to include("#{@feature_name}.feature")
85
+ expect(Dir.entries("features/step_definitions")).
86
+ to include("#{@feature_name}_steps.rb")
87
+ expect(Dir.entries("features/android/screens")).
88
+ to include("#{@feature_name}_screen.rb")
89
+ expect(Dir.entries("features/ios/screens")).
90
+ to include("#{@feature_name}_screen.rb")
91
+ end
92
+
93
+ it 'Generates with alias command g' do
94
+ system "suno new '#{@appium}' '#{@project_name}' > /dev/null"
95
+
96
+ Dir.chdir(@project_name)
97
+
98
+ system "suno g calabash-feature '#{@feature_name}' > /dev/null"
99
+
100
+ expect(Dir.entries("features")).
101
+ to include("#{@feature_name}.feature")
102
+ expect(Dir.entries("features/step_definitions")).
103
+ to include("#{@feature_name}_steps.rb")
104
+ expect(Dir.entries("features/android/screens")).
105
+ to include("#{@feature_name}_screen.rb")
106
+ expect(Dir.entries("features/ios/screens")).
107
+ to include("#{@feature_name}_screen.rb")
108
+ end
109
+ end
110
+
111
+ context 'Try Generates a feature with a invalid argument' do
112
+ it 'Feature will be not created' do
113
+ system "sunomono new '#{@appium}' '#{@project_name}' > /dev/null"
114
+
115
+ Dir.chdir(@project_name)
116
+
117
+ system "sunomono generate calabash-feature '#{@feature_name}' invalid_argument > /dev/null"
118
+
119
+ expect(Dir.entries("features")).
120
+ not_to include("#{@feature_name}.feature")
121
+ expect(Dir.entries("features/step_definitions")).
122
+ not_to include("#{@feature_name}_steps.rb")
123
+ expect(Dir.entries("features/android/screens")).
124
+ not_to include("#{@feature_name}_screen.rb")
125
+ expect(Dir.entries("features/ios/screens")).
126
+ not_to include("#{@feature_name}_screen.rb")
127
+ end
128
+
129
+ it 'Feature will be not created using alias command suno with a invalid argument' do
130
+ system "suno new '#{@appium}' '#{@project_name}'", :out => File::NULL
131
+
132
+ Dir.chdir(@project_name)
133
+
134
+ system "suno generate calabash-feature '#{@feature_name}' invalid_argument > /dev/null"
135
+
136
+ expect(Dir.entries("features")).
137
+ not_to include("#{@feature_name}.feature")
138
+ expect(Dir.entries("features/step_definitions")).
139
+ not_to include("#{@feature_name}_steps.rb")
140
+ expect(Dir.entries("features/android/screens")).
141
+ not_to include("#{@feature_name}_screen.rb")
142
+ expect(Dir.entries("features/ios/screens")).
143
+ not_to include("#{@feature_name}_screen.rb")
144
+ end
145
+
146
+
147
+ it 'Feature will be not created using alias command with a invalid argument' do
148
+ system "suno new '#{@appium}' '#{@project_name}' > /dev/null"
149
+
150
+ Dir.chdir(@project_name)
151
+
152
+ system "suno g calabash-feature '#{@feature_name}' invalid_argument > /dev/null"
153
+
154
+ expect(Dir.entries("features")).
155
+ not_to include("#{@feature_name}.feature")
156
+ expect(Dir.entries("features/step_definitions")).
157
+ not_to include("#{@feature_name}_steps.rb")
158
+ expect(Dir.entries("features/android/screens")).
159
+ not_to include("#{@feature_name}_screen.rb")
160
+ expect(Dir.entries("features/ios/screens")).
161
+ not_to include("#{@feature_name}_screen.rb")
162
+ end
163
+ end
164
+
165
+ context 'Generates an OS independent step' do
166
+ it 'Cant generates .feature and screens files' do
167
+ system "suno new #{@appium} #{@project_name} > /dev/null"
168
+
169
+ Dir.chdir(@project_name)
170
+
171
+ system "sunomono generate step #{@feature_name} > /dev/null"
172
+
173
+ expect(Dir.entries("features")).
174
+ not_to include("#{@feature_name}.feature")
175
+ expect(Dir.entries("features/android")).
176
+ not_to include("#{@feature_name}_screen.rb")
177
+ expect(Dir.entries("features/ios")).
178
+ not_to include("#{@feature_name}_screen.rb")
179
+ end
180
+ end
181
+
182
+ context 'Generates an OS indenpendent screen' do
183
+ it 'Cant generates .feature and step_definition files' do
184
+ system "suno new #{@appium} #{@project_name} > /dev/null"
185
+
186
+ Dir.chdir(@project_name)
187
+
188
+ system "sunomono generate screen #{@appium} #{@feature_name} > /dev/null"
189
+
190
+ expect(Dir.entries("features")).
191
+ not_to include("#{@feature_name}.feature")
192
+ expect(Dir.entries("features/step_definitions")).
193
+ not_to include("#{@feature_name}_steps.rb")
194
+ end
195
+ end
196
+
197
+ context 'commands to generates an Android dependent files' do
198
+ it 'Create folders to android plataform' do
199
+ system "suno new #{@appium} #{@project_name} > /dev/null"
200
+
201
+ Dir.chdir(@project_name)
202
+
203
+ system "suno generate android-feature #{@appium} #{@feature_name} > /dev/null"
204
+
205
+ expect(Dir.entries("features/android/features")).
206
+ to include("#{@feature_name}.feature")
207
+ expect(Dir.entries("features/android/step_definitions")).
208
+ to include("#{@feature_name}_steps.rb")
209
+ expect(Dir.entries("features/android/screens")).
210
+ to include("#{@feature_name}_screen.rb")
211
+ end
212
+
213
+ it 'Create screen to android plataform' do
214
+ system "suno new #{@appium} #{@project_name} > /dev/null"
215
+
216
+ Dir.chdir(@project_name)
217
+
218
+ system "suno generate android-screen #{@appium} #{@feature_name} > /dev/null"
219
+
220
+ expect(Dir.entries("features/android/features")).
221
+ not_to include("#{@feature_name}.feature")
222
+ expect(Dir.entries("features/android/step_definitions")).
223
+ not_to include("#{@feature_name}_steps.rb")
224
+ end
225
+
226
+ it 'Create step to android plataform' do
227
+ system "suno new #{@appium} #{@project_name} > /dev/null"
228
+
229
+ Dir.chdir(@project_name)
230
+
231
+ system "suno generate android-step #{@feature_name} > /dev/null"
232
+
233
+ expect(Dir.entries("features/android/features")).
234
+ not_to include("#{@feature_name}.feature")
235
+ expect(Dir.entries("features/android/screens")).
236
+ not_to include("#{@feature_name}_screen.rb")
237
+ end
238
+ end
239
+
240
+ context 'commands to generates an IOS dependent files' do
241
+ it 'Create folders to IOS plataform' do
242
+ system "suno new #{@appium} #{@project_name} > /dev/null"
243
+
244
+ Dir.chdir(@project_name)
245
+
246
+ system "suno generate ios-feature #{@appium} #{@feature_name} > /dev/null"
247
+
248
+ expect(Dir.entries("features/ios/features")).
249
+ to include("#{@feature_name}.feature")
250
+ expect(Dir.entries("features/ios/step_definitions")).
251
+ to include("#{@feature_name}_steps.rb")
252
+ expect(Dir.entries("features/ios/screens")).
253
+ to include("#{@feature_name}_screen.rb")
254
+ end
255
+
256
+ it 'Create screen to IOS plataform' do
257
+ system "suno new #{@appium} #{@project_name} > /dev/null"
258
+
259
+ Dir.chdir(@project_name)
260
+
261
+ system "suno generate ios-screen #{@appium} #{@feature_name} > /dev/null"
262
+
263
+ expect(Dir.entries("features/ios/features")).
264
+ not_to include("#{@feature_name}.feature")
265
+ expect(Dir.entries("features/ios/step_definitions")).
266
+ not_to include("#{@feature_name}_steps.rb")
267
+ end
268
+
269
+ it 'Create step to IOS plataform' do
270
+ system "suno new #{@appium} #{@project_name} > /dev/null"
271
+
272
+ Dir.chdir(@project_name)
273
+
274
+ system "suno generate ios-step #{@feature_name} > /dev/null"
275
+
276
+ expect(Dir.entries("features/ios/features")).
277
+ not_to include("#{@feature_name}.feature")
278
+ expect(Dir.entries("features/ios/screens")).
279
+ not_to include("#{@feature_name}_screen.rb")
280
+ end
281
+ end
282
+ end
283
+ end
284
+
@@ -14,7 +14,7 @@ describe Sunomono do
14
14
  FileUtils.rm_rf(@project_name)
15
15
  end
16
16
 
17
- describe 'Sunomono gem commands' do
17
+ describe 'Sunomono gem commands to create calabash based files' do
18
18
  context 'Returns project created with all files' do
19
19
  it 'Create new project using default command' do
20
20
  system "sunomono new '#{@calabash}' '#{@project_name}' > /dev/null"
@@ -60,16 +60,6 @@ describe Sunomono do
60
60
  end
61
61
  end
62
62
 
63
- context 'Should return the latest version of sunonomo' do
64
- it 'Returns the latest version' do
65
- stdout = `sunomono version`
66
- version = "Sunomono Version " + "#{Sunomono::VERSION}"
67
-
68
- expect(version).
69
- to include(stdout.gsub(/\n/, ""))
70
- end
71
- end
72
-
73
63
  context 'Generate Feature' do
74
64
  it 'Generates all files' do
75
65
  system "sunomono new '#{@calabash}' '#{@project_name}' > /dev/null"
@@ -88,32 +78,6 @@ describe Sunomono do
88
78
  to include("#{@feature_name}_screen.rb")
89
79
  end
90
80
 
91
- it 'Generate feature in pt' do
92
- system "suno new '#{@calabash}' '#{@project_name}' > /dev/null"
93
-
94
- Dir.chdir(@project_name)
95
-
96
- system "suno generate calabash-feature '#{@feature_name}' --lang=pt > /dev/null"
97
-
98
- expect(File.readlines("features/#{@feature_name}.feature")).
99
- to include("# language: pt\n", "Funcionalidade: #{@feature_name.capitalize} \n", "\n", " Contexto:\n", " # Insira os passos\n", " \n", " Cenário: Primeiro Cenario\n", " # Insira os passos\n")
100
- expect(File.readlines("features/step_definitions/#{@feature_name}_steps.rb")).
101
- to include("######### DADO #########\n", "\n", "######### QUANDO #########\n", "\n", "######### ENTãO #########")
102
- end
103
-
104
- it 'Generate feature in en' do
105
- system "suno new '#{@calabash}' '#{@project_name}' > /dev/null"
106
-
107
- Dir.chdir(@project_name)
108
-
109
- system "suno generate calabash-feature '#{@feature_name}' > /dev/null"
110
-
111
- expect(File.readlines("features/#{@feature_name}.feature")).
112
- to include("# language: en\n", "Feature: #{@feature_name.capitalize} \n", "\n", " Background:\n", " # Insert steps\n", " \n", " Scenario: First Scenario\n", " # Insert steps\n")
113
- expect(File.readlines("features/step_definitions/#{@feature_name}_steps.rb")).
114
- to include("######### GIVEN #########\n", "\n", "######### WHEN #########\n", "\n", "######### THEN #########")
115
- end
116
-
117
81
  it 'Generates with alias command g' do
118
82
  system "suno new '#{@calabash}' '#{@project_name}' > /dev/null"
119
83
 
@@ -0,0 +1,18 @@
1
+ require 'sunomono'
2
+
3
+ describe Sunomono do
4
+
5
+ before(:each) do
6
+ @directory = Dir.pwd
7
+ end
8
+
9
+ context 'Should return the latest version of sunonomo' do
10
+ it 'Returns the latest version' do
11
+ stdout = `sunomono version`
12
+ version = "Sunomono Version " + "#{Sunomono::VERSION}"
13
+
14
+ expect(version).
15
+ to include(stdout.gsub(/\n/, ""))
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunomono
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Tanner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-29 00:00:00.000000000 Z
12
+ date: 2018-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -106,6 +106,7 @@ executables:
106
106
  extensions: []
107
107
  extra_rdoc_files: []
108
108
  files:
109
+ - ".circleci/config.yml"
109
110
  - ".gitignore"
110
111
  - ".rspec"
111
112
  - CONTRIBUTING.md
@@ -118,7 +119,6 @@ files:
118
119
  - bin/suno
119
120
  - bin/sunomono
120
121
  - change_log.md
121
- - circle.yml
122
122
  - lib/aws/android/app_installation_hooks.rb
123
123
  - lib/aws/android/app_life_cycle_hooks.rb
124
124
  - lib/aws/ios/01_launch.rb
@@ -195,7 +195,9 @@ files:
195
195
  - lib/templates/ios_screen_base.tt
196
196
  - lib/templates/screen.tt
197
197
  - lib/templates/steps.tt
198
- - spec/sunomono_test.rb
198
+ - spec/appium_sunomono_test.rb
199
+ - spec/calabash_sunomono_test.rb
200
+ - spec/commom_sunomono_test.rb
199
201
  - sunomono.gemspec
200
202
  homepage: https://github.com/concretesolutions/sunomono
201
203
  licenses:
@@ -222,4 +224,6 @@ signing_key:
222
224
  specification_version: 4
223
225
  summary: Generates an android and iOS calabash project.
224
226
  test_files:
225
- - spec/sunomono_test.rb
227
+ - spec/appium_sunomono_test.rb
228
+ - spec/calabash_sunomono_test.rb
229
+ - spec/commom_sunomono_test.rb
data/circle.yml DELETED
@@ -1,13 +0,0 @@
1
- machine:
2
- ruby:
3
- version: 2.3.0
4
-
5
- dependencies:
6
- override:
7
- - gem install bundler
8
- - gem install rake
9
- - bundle install
10
-
11
- test:
12
- override:
13
- - bundle exec rake spec