calabash-android 0.4.18 → 0.4.19.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 +0 -12
- data/lib/calabash-android/helpers.rb +13 -38
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/version.rb +1 -1
- data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTWith.java +8 -3
- metadata +4 -5
- data/lib/calabash-android/lib/apktool-cli-1.5.3-SNAPSHOT.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc390e245e5b9be8eb0ae9d5a6cb6cbe0a01a44d
|
4
|
+
data.tar.gz: 533f881055f03da5ef544bb7fb9343715a4b7218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d48a41c066bf1842e1fa31c21ca61d389700d06776882c678428381125b2d97f1833b5ddfd5939b0690d6956f0619ce6de3f4ba4468bd899b8416e940ef0cb
|
7
|
+
data.tar.gz: 2280fe20ead2d488704d0cd306cb03dbbf9dc596781ff6c259a3dac1bbf0fe855ddb7ab9d2fdaff0c129308cc01e4b01e2b2123d602631e8dc1526d144a1b226
|
data/bin/calabash-android
CHANGED
@@ -86,18 +86,6 @@ elsif cmd == 'console'
|
|
86
86
|
elsif cmd == 'setup'
|
87
87
|
Env.exit_if_env_not_set_up
|
88
88
|
calabash_setup
|
89
|
-
elsif cmd == 'extract-manifest'
|
90
|
-
Env.exit_if_env_not_set_up
|
91
|
-
if ARGV.empty?
|
92
|
-
puts "Please specify an app"
|
93
|
-
exit 1
|
94
|
-
end
|
95
|
-
unless File.exist? ARGV.first
|
96
|
-
puts "No such file #{ARGV.first}"
|
97
|
-
exit 1
|
98
|
-
end
|
99
|
-
|
100
|
-
puts manifest ARGV.first
|
101
89
|
elsif cmd == 'resign'
|
102
90
|
Env.exit_if_env_not_set_up
|
103
91
|
unless File.exist?(File.expand_path(ARGV.first))
|
@@ -1,45 +1,29 @@
|
|
1
1
|
require "stringio"
|
2
|
-
require 'rexml/document'
|
3
|
-
require 'rexml/xpath'
|
4
2
|
require 'zip/zip'
|
5
3
|
require 'tempfile'
|
6
4
|
require 'escape'
|
7
5
|
require 'rbconfig'
|
8
6
|
require 'calabash-android/java_keystore'
|
9
7
|
|
10
|
-
include REXML
|
11
|
-
|
12
8
|
def package_name(app)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
package_line = aapt_dump(app, "package").first
|
10
|
+
raise "'package' not found in aapt output" unless package_line
|
11
|
+
m = package_line.match(/name='([^']+)'/)
|
12
|
+
raise "Unexpected output from aapt: #{package_line}" unless m
|
13
|
+
m[1]
|
18
14
|
end
|
19
15
|
|
20
16
|
def main_activity(app)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
elsif not main_activity.include? "." #This is undocumentet behaviour but Android seems to accept shorthand naming that does not start with '.'
|
27
|
-
main_activity = "#{package_name(app)}.#{main_activity}"
|
28
|
-
end
|
29
|
-
main_activity
|
17
|
+
launchable_activity_line = aapt_dump(app, "launchable-activity").first
|
18
|
+
raise "'launchable-activity' not found in aapt output" unless launchable_activity_line
|
19
|
+
m = launchable_activity_line.match(/name='([^']+)'/)
|
20
|
+
raise "Unexpected output from aapt: #{launchable_activity_line}" unless m
|
21
|
+
m[1]
|
30
22
|
end
|
31
23
|
|
32
|
-
def
|
33
|
-
|
34
|
-
|
35
|
-
unless File.size?(manifest_file)
|
36
|
-
manifest_extractor = File.join(File.expand_path(File.dirname(__FILE__)),'lib', 'apktool-cli-1.5.3-SNAPSHOT.jar')
|
37
|
-
output = `#{Env.java_path} -jar "#{manifest_extractor}" d -s --frame-path "#{framework_path(app)}" -f "#{app}" #{out_path} 2>&1`
|
38
|
-
raise "Unable to extract manifest: #{output}" unless File.size?(manifest_file)
|
39
|
-
# Tidy up a bit. It would be nice if apktool could just dump the manifest alone.
|
40
|
-
FileUtils.rm_rf(%w{res assets classes.dex}.map {|f| File.join(out_path, f) })
|
41
|
-
end
|
42
|
-
File.read(manifest_file)
|
24
|
+
def aapt_dump(app, key)
|
25
|
+
lines = `#{Env.tools_dir}/aapt dump badging "#{app}"`.lines.collect(&:strip)
|
26
|
+
lines.select { |l| l.start_with?("#{key}:") }
|
43
27
|
end
|
44
28
|
|
45
29
|
def checksum(file_path)
|
@@ -51,15 +35,6 @@ def test_server_path(apk_file_path)
|
|
51
35
|
"test_servers/#{checksum(apk_file_path)}_#{Calabash::Android::VERSION}.apk"
|
52
36
|
end
|
53
37
|
|
54
|
-
def manifest_path(apk_file_path)
|
55
|
-
"test_servers/#{checksum(apk_file_path)}_#{Calabash::Android::VERSION}.res"
|
56
|
-
end
|
57
|
-
|
58
|
-
def framework_path(apk_file_path)
|
59
|
-
"test_servers/apktool-#{checksum(apk_file_path)}_#{Calabash::Android::VERSION}"
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
38
|
def build_test_server_if_needed(app_path)
|
64
39
|
unless File.exist?(test_server_path(app_path))
|
65
40
|
if ARGV.include? "--no-build"
|
Binary file
|
@@ -42,7 +42,7 @@ public class UIQueryASTWith implements UIQueryAST {
|
|
42
42
|
for (int i = 0; i < inputViews.size(); i++) {
|
43
43
|
Object o = inputViews.get(i);
|
44
44
|
|
45
|
-
if (o instanceof WebView) {
|
45
|
+
if (o instanceof WebView && isDomQuery()) {
|
46
46
|
Future webResult = evaluateForWebView((WebView) o);
|
47
47
|
if (webResult != null) {
|
48
48
|
futureResult.add(webResult);
|
@@ -90,8 +90,13 @@ public class UIQueryASTWith implements UIQueryAST {
|
|
90
90
|
|
91
91
|
}
|
92
92
|
|
93
|
-
|
94
|
-
|
93
|
+
private boolean isDomQuery() {
|
94
|
+
System.out.println("isDomQuery: " + propertyName);
|
95
|
+
return propertyName.equalsIgnoreCase("css") || propertyName.equalsIgnoreCase("xpath");
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
@SuppressWarnings("rawtypes")
|
95
100
|
private Map evaluateForMap(Map map) {
|
96
101
|
if (map.containsKey(this.propertyName)) {
|
97
102
|
Object value = map.get(this.propertyName);
|
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.4.
|
4
|
+
version: 0.4.19.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: 2013-12-
|
11
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -177,7 +177,6 @@ files:
|
|
177
177
|
- lib/calabash-android/helpers.rb
|
178
178
|
- lib/calabash-android/java_keystore.rb
|
179
179
|
- lib/calabash-android/lib/AXMLPrinter2.jar
|
180
|
-
- lib/calabash-android/lib/apktool-cli-1.5.3-SNAPSHOT.jar
|
181
180
|
- lib/calabash-android/lib/manifest_extractor.jar
|
182
181
|
- lib/calabash-android/lib/screenshotTaker.jar
|
183
182
|
- lib/calabash-android/management/adb.rb
|
@@ -890,9 +889,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
890
889
|
version: '0'
|
891
890
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
892
891
|
requirements:
|
893
|
-
- - '
|
892
|
+
- - '>'
|
894
893
|
- !ruby/object:Gem::Version
|
895
|
-
version:
|
894
|
+
version: 1.3.1
|
896
895
|
requirements: []
|
897
896
|
rubyforge_project:
|
898
897
|
rubygems_version: 2.1.10
|
Binary file
|