calabash-android 0.5.15 → 0.5.16.pre1

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
  SHA1:
3
- metadata.gz: c5fc3c80afa4803ad6a80ab1de3bdddbe3edfeb4
4
- data.tar.gz: cf60c09fd25bf0c5b7006b0d8e096769815f2892
3
+ metadata.gz: 1bb7b1d479f70d02d21cb13ac79c342a4636d8a1
4
+ data.tar.gz: a0054f26ac58558e5a93060ec6ba07819a522e16
5
5
  SHA512:
6
- metadata.gz: f591a4b557f3111921375940cd7b38a8f6383abd57fba7a29c044b95defcccec082fc95ad92168423563b553075a0883231e244601c91c91248675f5ce99d1ba
7
- data.tar.gz: 9a1f33abccf7d7c9ba1d75b59803816ba430477a69461bc964c13837aeea4765bdf2d10d562cc00fcb149bec52c73f13e40f7394569a4838cb9d002febe29800
6
+ metadata.gz: 412afba1c956f1390cb7516125cbf4f56853bb0c153bd5c68215c70ba5d551e4a981f6899b380f7dc092532eb66c4c7f51ca6498591d627dcdc6010499d61017
7
+ data.tar.gz: ebb6d1a2a0cdd7d9837c9ce19d931d3a716adfd6ccf9a0977c1710d18fd3319f267b96b1ec81a481f73676271c3f943695298e99ae8fda3954ca76f7803ed69e
@@ -52,6 +52,17 @@ def calabash_build(app)
52
52
 
53
53
  Zip::File.new("dummy.apk").extract("AndroidManifest.xml","customAndroidManifest.xml")
54
54
  Zip::File.open("TestServer.apk") do |zip_file|
55
+ begin
56
+ check_file("AndroidManifest.xml")
57
+ manifest_exists = true
58
+ rescue
59
+ manifest_exists = false
60
+ end
61
+
62
+ if manifest_exists
63
+ zip_file.remove("AndroidManifest.xml")
64
+ end
65
+
55
66
  zip_file.add("AndroidManifest.xml", "customAndroidManifest.xml")
56
67
  end
57
68
  end
@@ -208,19 +208,19 @@ To use a set of concrete GPS cordinates
208
208
  Internationalization
209
209
  --------------------
210
210
 
211
- Then /^I press text of translated l10key (\d+)$/
211
+ Then /^I press text of translated l10nkey "?([^\"]*)"?$/
212
212
  Simulates that the user pressed the text of the l10nkey.
213
213
 
214
- Then /^I press button of translated l10key (\d+)$/
214
+ Then /^I press button of translated l10nkey "?([^\"]*)"?$/
215
215
  Simulates that the user pressed the button with the label text of the l10nkey.
216
216
 
217
- Then /^I press menu item of translated l10key (\d+)$/
217
+ Then /^I press menu item of translated l10nkey "?([^\"]*)"?$/
218
218
  Simulates that the user pressed the menu item with the label text of the l10nkey.
219
219
 
220
- Then /^I press toggle button of translated l10key (\d+)$/
220
+ Then /^I press toggle button of translated l10nkey "?([^\"]*)?"$/
221
221
  Simulates that the user pressed the toggle button with the label text of the l10nkey.
222
222
 
223
- Then /^I wait for the translated "([^\"]*)" l10nkey to appear$/
223
+ Then /^I wait for the translated "?([^\"]*)"? l10nkey to appear$/
224
224
  Waits until the text of the translated l10nkey is displayed.
225
225
 
226
226
  Note: you can assert or press interface elements using [Android's String resources](http://developer.android.com/reference/android/R.string.html) by passing a package in a custom step:
@@ -19,6 +19,7 @@ require 'retriable'
19
19
  require 'cucumber'
20
20
  require 'date'
21
21
  require 'time'
22
+ require 'shellwords'
22
23
 
23
24
 
24
25
  module Calabash module Android
@@ -42,7 +43,7 @@ module Calabash module Android
42
43
  end
43
44
 
44
45
  def current_activity
45
- `#{default_device.adb_command} shell dumpsys window windows`.each_line.grep(/mFocusedApp.+[\.\/]([^.\s\/\}]+)/){$1}.first
46
+ `#{default_device.adb_command} shell dumpsys window windows`.force_encoding('UTF-8').each_line.grep(/mFocusedApp.+[\.\/]([^.\s\/\}]+)/){$1}.first
46
47
  end
47
48
 
48
49
  def log(message)
@@ -777,7 +778,8 @@ module Calabash module Android
777
778
  params = hash.map {|k,v| "-e \"#{k}\" \"#{v}\""}.join(" ")
778
779
 
779
780
  logcat_id = get_logcat_id()
780
- cmd = "#{adb_command} shell am instrument -e logcat #{logcat_id} -e name \"#{name}\" #{params} #{package_name(@test_server_path)}/sh.calaba.instrumentationbackend.SetPreferences"
781
+ am_cmd = Shellwords.escape("am instrument -e logcat #{logcat_id} -e name \"#{name}\" #{params} #{package_name(@test_server_path)}/sh.calaba.instrumentationbackend.SetPreferences")
782
+ cmd = "#{adb_command} shell #{am_cmd}"
781
783
 
782
784
  raise "Could not set preferences" unless system(cmd)
783
785
 
@@ -1,19 +1,19 @@
1
- Then /^I press text of translated l10key (\d+)$/ do |l10key|
2
- perform_action('press_l10n_element', l10key)
1
+ Then /^I press text of translated l10n?key "?([^\"]*)"?$/ do |l10nkey|
2
+ perform_action('press_l10n_element', l10nkey)
3
3
  end
4
4
 
5
- Then /^I press button of translated l10key (\d+)$/ do |l10key|
6
- perform_action('press_l10n_element', l10key,'button')
5
+ Then /^I press button of translated l10n?key "?([^\"]*)"?$/ do |l10nkey|
6
+ perform_action('press_l10n_element', l10nkey,'button')
7
7
  end
8
8
 
9
- Then /^I press menu item of translated l10key (\d+)$/ do |l10key|
10
- perform_action('press_l10n_element', l10key,'menu_item')
9
+ Then /^I press menu item of translated l10n?key "?([^\"]*)"?$/ do |l10nkey|
10
+ perform_action('press_l10n_element', l10nkey,'menu_item')
11
11
  end
12
12
 
13
- Then /^I press toggle button of translated l10key (\d+)$/ do |l10key|
14
- perform_action('press_l10n_element', l10key,'toggle_button')
13
+ Then /^I press toggle button of translated l10n?key "?([^\"]*)"?$/ do |l10nkey|
14
+ perform_action('press_l10n_element', l10nkey,'toggle_button')
15
15
  end
16
16
 
17
- Then /^I wait for the translated "([^\"]*)" l10nkey to appear$/ do |l10nkey|
17
+ Then /^I wait for the translated "?([^\"]*)"? l10n?key to appear$/ do |l10nkey|
18
18
  perform_action('wait_for_l10n_element', l10nkey)
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.5.15"
3
+ VERSION = "0.5.16.pre1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-android
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.15
4
+ version: 0.5.16.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Maturana Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-19 00:00:00.000000000 Z
11
+ date: 2015-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -267,9 +267,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
267
267
  version: '0'
268
268
  required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  requirements:
270
- - - ">="
270
+ - - ">"
271
271
  - !ruby/object:Gem::Version
272
- version: '0'
272
+ version: 1.3.1
273
273
  requirements: []
274
274
  rubyforge_project:
275
275
  rubygems_version: 2.4.5.1