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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c44c0e993a7a43772eeba1e688c898e44bf09c6
4
- data.tar.gz: 3dfac41109392ced77865e6b0e8853c7fa90252d
3
+ metadata.gz: fc390e245e5b9be8eb0ae9d5a6cb6cbe0a01a44d
4
+ data.tar.gz: 533f881055f03da5ef544bb7fb9343715a4b7218
5
5
  SHA512:
6
- metadata.gz: fc19afcc81335aa79fd2eb45cc34c58fd0a21bc298f059ce7061a453d4ddf564c3347b0321ac7573828f6977dd9a39769d2f1463e498e484f5ef60061775c69b
7
- data.tar.gz: 3879719b56b1aa587f552ff601db1f36e7576d2b7105496d08b5fbf48206f739186c53037acc28c226edd928bb9dcdef402e23f9e1aa982e6126ef0d38e1b064
6
+ metadata.gz: a4d48a41c066bf1842e1fa31c21ca61d389700d06776882c678428381125b2d97f1833b5ddfd5939b0690d6956f0619ce6de3f4ba4468bd899b8416e940ef0cb
7
+ data.tar.gz: 2280fe20ead2d488704d0cd306cb03dbbf9dc596781ff6c259a3dac1bbf0fe855ddb7ab9d2fdaff0c129308cc01e4b01e2b2123d602631e8dc1526d144a1b226
@@ -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
- require 'rexml/document'
14
- require 'rexml/xpath'
15
-
16
- manifest = Document.new(manifest(app))
17
- manifest.root.attributes['package']
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
- manifest = Document.new(manifest(app))
22
- main_activity = manifest.elements["//action[@name='android.intent.action.MAIN']/../.."].attributes['name']
23
- #Handle situation where main activity is on the form '.class_name'
24
- if main_activity.start_with? "."
25
- main_activity = package_name(app) + main_activity
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 manifest(app)
33
- out_path = manifest_path(app)
34
- manifest_file = File.join(out_path, 'AndroidManifest.xml')
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"
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.4.18"
3
+ VERSION = "0.4.19.pre1"
4
4
  end
5
5
  end
@@ -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
- @SuppressWarnings("rawtypes")
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.18
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-02 00:00:00.000000000 Z
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: '0'
894
+ version: 1.3.1
896
895
  requirements: []
897
896
  rubyforge_project:
898
897
  rubygems_version: 2.1.10