calabash-android 0.5.15 → 0.5.16.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/calabash-android-build.rb +11 -0
- data/lib/calabash-android/canned_steps.md +5 -5
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/operations.rb +4 -2
- data/lib/calabash-android/steps/l10n_steps.rb +9 -9
- data/lib/calabash-android/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bb7b1d479f70d02d21cb13ac79c342a4636d8a1
|
4
|
+
data.tar.gz: a0054f26ac58558e5a93060ec6ba07819a522e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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:
|
Binary file
|
@@ -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
|
-
|
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
|
2
|
-
perform_action('press_l10n_element',
|
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
|
6
|
-
perform_action('press_l10n_element',
|
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
|
10
|
-
perform_action('press_l10n_element',
|
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
|
14
|
-
perform_action('press_l10n_element',
|
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 "([^\"]*)"
|
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
|
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.
|
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
|
+
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:
|
272
|
+
version: 1.3.1
|
273
273
|
requirements: []
|
274
274
|
rubyforge_project:
|
275
275
|
rubygems_version: 2.4.5.1
|