sunomono 1.0.3 → 1.0.4

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: 8a61a48e2204b21f7a247e0d7bfbde0d8ac6da11
4
- data.tar.gz: 437cf14ed19959b7a614e8c45cbc7e75fb43ace3
3
+ metadata.gz: e78bd6d08bbd1eb3a9d57309b2e4a695e8cae07d
4
+ data.tar.gz: be49f6d3a87b3f5b634082fe1862aca2c2a25a3f
5
5
  SHA512:
6
- metadata.gz: 34dc1c888445f5a61d8c5ed526f9b4049ba97eba11916281f5fc923f782f7f7e656b941535a1138bafc2ca8fe3fe500475fd8743c2c7674e3d31c5e3bac2c1fd
7
- data.tar.gz: 512553fadeeb9ad139f1b27a653cef21128d4a1c6d9b477dc13a72e2edbce625784aad12fd4584c0d058fd756f3c1722f62d2204a4a8083b6bf41865bd02293c
6
+ metadata.gz: 0a3cb49c5508d42ab7fada0432a22e4f790cded0269fec966f3468c228be6194a18f9c055955d5517d1370e6483a1201480ed50cfc9838d42ea0d7dc1463b39f
7
+ data.tar.gz: 9194214f8ad6c50bee9c94d58bfe762c096f555355b5e68f4ec693e9995e109a6e7c58e7c836a97e0578aa1962609517c21440805ede66fa00d493ee55bb3d00
data/README.md CHANGED
@@ -80,23 +80,37 @@ There are nine generators that are responsible to create the templates for Featu
80
80
 
81
81
  ####Features
82
82
 
83
+ To create calabash based files:
84
+
85
+
83
86
  ```
84
- suno generate feature FeatureName
87
+ suno generate calabash-feature FeatureName
85
88
  ```
86
- The feature generator will create a Platform independent feature and its files. So this command will create the FeatureName.feature file inside the folder `feature`, the file FeatureName_steps.rb inside the folder `features/step_definitions`, the files FeatureName_screen.rb inside the folders `features/android/screens` and `features/ios/screens`.
89
+
90
+ To create appium based files:
91
+
92
+ ```
93
+ suno generate appium-feature FeatureName
94
+ ```
95
+
96
+ The feature generator will create a Platform independent feature and its files.
97
+ So this command will create the FeatureName.feature file inside the folder `feature`, the file FeatureName_steps.rb inside the folder `features/step_definitions`, the files FeatureName_screen.rb inside the folders `features/android/screens` and `features/ios/screens`.
98
+
99
+
100
+ #### Independent Feature by platform
87
101
 
88
102
  To create calabash based files:
89
103
 
90
104
  ```
91
- suno generate calabash android-feature AndroidFeatureName
92
- suno generate calabash ios-feature iOSFeatureName
105
+ suno generate android-feature calabash AndroidFeatureName
106
+ suno generate ios-feature calabash iOSFeatureName
93
107
  ```
94
108
 
95
109
  To create appium based files:
96
110
 
97
111
  ```
98
- suno generate appium android-feature AndroidFeatureName
99
- suno generate appium ios-feature iOSFeatureName
112
+ suno generate android-feature appium AndroidFeatureName
113
+ suno generate ios-feature appium iOSFeatureName
100
114
 
101
115
  ```
102
116
 
@@ -135,15 +149,15 @@ The screen generator will create both Platform dependent screens in the folders
135
149
  To create calabash based files:
136
150
 
137
151
  ```
138
- suno generate calabash android-screen AndroidScreenName
139
- suno generate calabash ios-screen iOSScreenName
152
+ suno generate android-screen calabash AndroidScreenName
153
+ suno generate ios-screen calabash iOSScreenName
140
154
  ```
141
155
 
142
156
  To create appium based files:
143
157
 
144
158
  ```
145
- suno generate appium android-screen AndroidScreenName
146
- suno generate appium ios-screen iOSScreenName
159
+ suno generate android-screen appium AndroidScreenName
160
+ suno generate ios-screen appium iOSScreenName
147
161
  ```
148
162
 
149
163
  The android-screen and ios-screen will create only the Android and iOS dependent screens respectively.
data/change_log.md ADDED
@@ -0,0 +1,13 @@
1
+ ## Change log Sunomono
2
+
3
+
4
+ ### Version 1.0.4
5
+
6
+ - Change the method name to identificator, because the element name
7
+ overriding the appium element class and the driver dont start.
8
+ - Create check_trait method
9
+ - adding automationName to android caps to avoid problems on locate
10
+ elements on the screen
11
+ - Change appium screen template
12
+ - Bumped the gem to 1.0.4
13
+
@@ -149,7 +149,7 @@ end
149
149
 
150
150
  def framework_avaliable?(framework)
151
151
  if framework.downcase != 'calabash' && framework.downcase != 'appium'
152
- puts 'Invalid framework choice calabash or appium'
152
+ puts "#{framework} is a invalid framework choice calabash or appium"
153
153
  exit 1
154
154
  end
155
155
  end
@@ -1,4 +1,7 @@
1
1
  [caps]
2
2
  platformName = "Platform name e.g Android"
3
3
  deviceName = "Device name e.g Nexus_5 or device ID"
4
- app = "path to apk"
4
+ app = "path to apk"
5
+ # Use automationName with UiAutomator2, because default automator,
6
+ # not recognize any elements on the screen
7
+ automationName = "UiAutomator2"
@@ -1,3 +1,7 @@
1
1
  Before do
2
2
  $driver.start_driver
3
+ end
4
+
5
+ After do
6
+ $driver.driver_quit
3
7
  end
data/lib/sunomono.rb CHANGED
@@ -14,7 +14,7 @@ module Sunomono
14
14
  class Generate < Thor
15
15
  include Thor::Actions
16
16
 
17
- desc 'calabash_feature [RESOURCE_NAME]', 'Generates an OS independent feature'
17
+ desc 'calabash-feature [RESOURCE_NAME]', 'Generates an OS independent feature'
18
18
  option :lang,
19
19
  banner: 'any of the gherkin supported languages',
20
20
  default: :en
@@ -29,7 +29,7 @@ module Sunomono
29
29
  create_screen_file name, 'IOS'
30
30
  end
31
31
 
32
- desc 'appium_feature [RESOURCE_NAME]', 'Generates an OS independent feature'
32
+ desc 'appium-feature [RESOURCE_NAME]', 'Generates an OS independent feature'
33
33
  option :lang,
34
34
  banner: 'any of the gherkin supported languages',
35
35
  default: :en
@@ -237,10 +237,7 @@ module Sunomono
237
237
  default: :en
238
238
 
239
239
  def new(platform, name)
240
- if platform != 'calabash' && platform != 'appium'
241
- puts "#{platform} is a invalid platform, please type calabash or appium"
242
- exit 1
243
- end
240
+ framework_avaliable?(platform)
244
241
 
245
242
  I18n.config.default_locale = options[:lang]
246
243
  # Thor will be responsible to look for identical
@@ -1,3 +1,3 @@
1
1
  module Sunomono
2
- VERSION = '1.0.3'.freeze
2
+ VERSION = '1.0.4'.freeze
3
3
  end
@@ -1,13 +1,19 @@
1
1
  require 'appium_lib'
2
2
 
3
3
  class BaseScreen
4
- def self.element(element_name, &block)
4
+ def self.identificator(element_name, &block)
5
5
  define_method(element_name.to_s, *block)
6
6
  end
7
7
 
8
8
  class << self
9
- alias_method :value, :element
10
- alias_method :action, :element
11
- alias_method :trait, :element
9
+ alias_method :value, :identificator
10
+ alias_method :action, :identificator
11
+ alias_method :trait, :identificator
12
+ end
13
+
14
+ def check_trait(timeout = 10)
15
+ raise ElementNotFoundError,
16
+ "#{trait} not found" unless
17
+ wait_true(timeout) { find_element(:id, trait).displayed? }
12
18
  end
13
19
  end
@@ -1,7 +1,6 @@
1
1
  class <%= config[:name] %>Screen < BaseScreen
2
- # <%= I18n.translate 'comments.trait' %>
3
- #trait(:trait) { "'#{layout_name}'" }
2
+
4
3
  # <%= I18n.translate 'comments.elements' %>
5
- # element(:layout_name) { pending 'Insert button identificator' }
6
- # element(:button) { pending 'Insert button identificator' }
4
+ # identificator(:trait) { pending 'Insert button identificator' }
5
+ # identificator(:button) { pending 'Insert button identificator' }
7
6
  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.3
4
+ version: 1.0.4
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: 2017-10-30 00:00:00.000000000 Z
12
+ date: 2017-11-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -117,6 +117,7 @@ files:
117
117
  - SUNOMONO_CALABASH.md
118
118
  - bin/suno
119
119
  - bin/sunomono
120
+ - change_log.md
120
121
  - circle.yml
121
122
  - lib/aws/android/app_installation_hooks.rb
122
123
  - lib/aws/android/app_life_cycle_hooks.rb