honeydew 0.19.0 → 0.20.0
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.
data/lib/honeydew/device.rb
CHANGED
@@ -11,8 +11,7 @@ module Honeydew
|
|
11
11
|
include Honeydew::DeviceLogFormatter
|
12
12
|
|
13
13
|
ServerTimeoutError = Class.new(Timeout::Error)
|
14
|
-
ActionFailedError = Class.new(
|
15
|
-
FinderTimeout = Class.new(Timeout::Error)
|
14
|
+
ActionFailedError = Class.new(RuntimeError)
|
16
15
|
|
17
16
|
attr_reader :serial, :port
|
18
17
|
|
@@ -59,7 +58,8 @@ module Honeydew
|
|
59
58
|
response = benchmark do
|
60
59
|
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
61
60
|
http.read_timeout = Honeydew.config.server_timeout
|
62
|
-
http.request request
|
61
|
+
response = http.request request
|
62
|
+
{response: response, action: action}
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -69,7 +69,7 @@ module Honeydew
|
|
69
69
|
response.body
|
70
70
|
when Net::HTTPNoContent
|
71
71
|
info "action failed, response: #{response.body}"
|
72
|
-
raise ActionFailedError.new
|
72
|
+
raise ActionFailedError.new "Action #{action} called with arguments #{arguments.inspect} failed"
|
73
73
|
else
|
74
74
|
raise "honeydew-server failed to process command, response: #{response.body}"
|
75
75
|
end
|
@@ -80,8 +80,8 @@ module Honeydew
|
|
80
80
|
realtime = Benchmark.realtime do
|
81
81
|
result = yield
|
82
82
|
end
|
83
|
-
debug "action completed in #{(realtime * 1000).to_i}ms"
|
84
|
-
result
|
83
|
+
debug "action '#{result[:action]}' completed in #{(realtime * 1000).to_i}ms"
|
84
|
+
result[:response]
|
85
85
|
end
|
86
86
|
|
87
87
|
def ensure_device_ready
|
data/lib/honeydew/version.rb
CHANGED
data/server/pom.xml
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
<groupId>amplify</groupId>
|
7
7
|
<artifactId>honeydew-server</artifactId>
|
8
|
-
<version>0.
|
8
|
+
<version>0.20.0</version>
|
9
9
|
<packaging>jar</packaging>
|
10
10
|
<name>Honeydew Android Server</name>
|
11
11
|
|
12
12
|
<properties>
|
13
|
-
<platform.version>4.
|
13
|
+
<platform.version>4.2.2_r2</platform.version>
|
14
14
|
</properties>
|
15
15
|
|
16
16
|
<repositories>
|
@@ -31,13 +31,13 @@
|
|
31
31
|
|
32
32
|
<dependencies>
|
33
33
|
<dependency>
|
34
|
-
|
34
|
+
<groupId>android</groupId>
|
35
35
|
<artifactId>android</artifactId>
|
36
36
|
<version>${platform.version}</version>
|
37
37
|
<scope>provided</scope>
|
38
38
|
</dependency>
|
39
39
|
<dependency>
|
40
|
-
<groupId>
|
40
|
+
<groupId>android.test.uiautomator</groupId>
|
41
41
|
<artifactId>uiautomator</artifactId>
|
42
42
|
<version>${platform.version}</version>
|
43
43
|
<scope>provided</scope>
|
@@ -68,7 +68,7 @@
|
|
68
68
|
<artifactId>commons-io</artifactId>
|
69
69
|
<version>2.4</version>
|
70
70
|
</dependency>
|
71
|
-
|
71
|
+
<dependency>
|
72
72
|
<groupId>fi.iki.elonen</groupId>
|
73
73
|
<artifactId>nanohttpd</artifactId>
|
74
74
|
<version>2.0.3</version>
|
@@ -81,19 +81,18 @@
|
|
81
81
|
</dependencies>
|
82
82
|
|
83
83
|
<build>
|
84
|
-
<testSourceDirectory>${test.directory}</testSourceDirectory>
|
85
84
|
<plugins>
|
86
85
|
<plugin>
|
87
86
|
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
|
88
87
|
<artifactId>android-maven-plugin</artifactId>
|
89
|
-
<version>3.
|
88
|
+
<version>3.6.1</version>
|
90
89
|
<configuration>
|
91
90
|
<zipalign>
|
92
91
|
<verbose>true</verbose>
|
93
92
|
</zipalign>
|
94
93
|
<undeployBeforeDeploy>true</undeployBeforeDeploy>
|
95
94
|
<sdk>
|
96
|
-
<platform>
|
95
|
+
<platform>17</platform>
|
97
96
|
</sdk>
|
98
97
|
<lint>
|
99
98
|
<skip>true</skip>
|
@@ -194,32 +193,6 @@
|
|
194
193
|
<artifactId>build-helper-maven-plugin</artifactId>
|
195
194
|
<version>1.5</version>
|
196
195
|
</plugin>
|
197
|
-
<!--This plugin's configuration is used to store Eclipse m2e settings
|
198
|
-
only. It has no influence on the Maven build itself. -->
|
199
|
-
<plugin>
|
200
|
-
<groupId>org.eclipse.m2e</groupId>
|
201
|
-
<artifactId>lifecycle-mapping</artifactId>
|
202
|
-
<version>1.0.0</version>
|
203
|
-
<configuration>
|
204
|
-
<lifecycleMappingMetadata>
|
205
|
-
<pluginExecutions>
|
206
|
-
<pluginExecution>
|
207
|
-
<pluginExecutionFilter>
|
208
|
-
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
|
209
|
-
<artifactId>android-maven-plugin</artifactId>
|
210
|
-
<versionRange>[3.2.0,)</versionRange>
|
211
|
-
<goals>
|
212
|
-
<goal>manifest-update</goal>
|
213
|
-
</goals>
|
214
|
-
</pluginExecutionFilter>
|
215
|
-
<action>
|
216
|
-
<execute/>
|
217
|
-
</action>
|
218
|
-
</pluginExecution>
|
219
|
-
</pluginExecutions>
|
220
|
-
</lifecycleMappingMetadata>
|
221
|
-
</configuration>
|
222
|
-
</plugin>
|
223
196
|
</plugins>
|
224
197
|
</build>
|
225
198
|
</project>
|
@@ -3,9 +3,14 @@ package com.amplify.honeydew_server;
|
|
3
3
|
import android.util.Log;
|
4
4
|
import com.amplify.honeydew_server.actions.*;
|
5
5
|
import com.android.uiautomator.core.UiDevice;
|
6
|
+
import com.android.uiautomator.core.UiObjectNotFoundException;
|
7
|
+
import com.google.common.base.Stopwatch;
|
6
8
|
|
7
|
-
import java.lang.reflect
|
8
|
-
import java.
|
9
|
+
import java.lang.reflect.Constructor;
|
10
|
+
import java.lang.reflect.InvocationTargetException;
|
11
|
+
import java.util.HashMap;
|
12
|
+
import java.util.Set;
|
13
|
+
import java.util.concurrent.TimeUnit;
|
9
14
|
|
10
15
|
import static com.google.common.collect.Sets.newHashSet;
|
11
16
|
|
@@ -32,12 +37,26 @@ public class ActionsExecutor {
|
|
32
37
|
if (action == null) {
|
33
38
|
return new Result("Action: " + actionName + " does not exists");
|
34
39
|
}
|
35
|
-
|
40
|
+
|
41
|
+
Result result = executeWithStopwatch(command, action);
|
42
|
+
|
43
|
+
return result;
|
36
44
|
} catch (Exception e) {
|
37
45
|
return new Result("Exception, on calling " + actionName, e);
|
38
46
|
}
|
39
47
|
}
|
40
48
|
|
49
|
+
private Result executeWithStopwatch(Command command, Action action) throws UiObjectNotFoundException {
|
50
|
+
Stopwatch timer = new Stopwatch().start();
|
51
|
+
|
52
|
+
Result result = action.execute(command.getArguments());
|
53
|
+
|
54
|
+
timer.stop();
|
55
|
+
Log.i(getClass().getName(), String.format("action '%s' took %d ms to execute on the tablet",
|
56
|
+
command.getAction(), timer.elapsed(TimeUnit.MILLISECONDS)));
|
57
|
+
return result;
|
58
|
+
}
|
59
|
+
|
41
60
|
private static Set<Class<? extends Action>> allActionClasses() {
|
42
61
|
Set<Class<? extends Action>> actionClasses = newHashSet();
|
43
62
|
actionClasses.add(LaunchApp.class);
|
metadata
CHANGED
@@ -1,121 +1,128 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeydew
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.20.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Selvakumar Natesan
|
9
9
|
- Christopher Rex
|
10
10
|
- Shyam Vala
|
11
11
|
- John Barker
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-08-
|
15
|
+
date: 2013-08-19 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
19
|
-
|
20
|
-
none: false
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
20
|
requirements:
|
22
|
-
- -
|
21
|
+
- - ">="
|
23
22
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
25
|
-
|
26
|
-
prerelease: false
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
version: !binary |-
|
24
|
+
MA==
|
28
25
|
none: false
|
26
|
+
requirement: !ruby/object:Gem::Requirement
|
29
27
|
requirements:
|
30
|
-
- -
|
28
|
+
- - ">="
|
31
29
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
30
|
+
version: !binary |-
|
31
|
+
MA==
|
32
|
+
none: false
|
33
|
+
prerelease: false
|
34
|
+
type: :runtime
|
33
35
|
- !ruby/object:Gem::Dependency
|
34
36
|
name: json
|
35
|
-
|
36
|
-
none: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- -
|
39
|
+
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
|
42
|
-
prerelease: false
|
43
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
version: !binary |-
|
42
|
+
MA==
|
44
43
|
none: false
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: !binary |-
|
49
|
+
MA==
|
50
|
+
none: false
|
51
|
+
prerelease: false
|
52
|
+
type: :runtime
|
49
53
|
- !ruby/object:Gem::Dependency
|
50
54
|
name: bundler
|
51
|
-
|
52
|
-
none: false
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
56
|
requirements:
|
54
|
-
- - ~>
|
57
|
+
- - "~>"
|
55
58
|
- !ruby/object:Gem::Version
|
56
59
|
version: '1.3'
|
57
|
-
type: :development
|
58
|
-
prerelease: false
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
none: false
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
61
62
|
requirements:
|
62
|
-
- - ~>
|
63
|
+
- - "~>"
|
63
64
|
- !ruby/object:Gem::Version
|
64
65
|
version: '1.3'
|
66
|
+
none: false
|
67
|
+
prerelease: false
|
68
|
+
type: :development
|
65
69
|
- !ruby/object:Gem::Dependency
|
66
70
|
name: rake
|
67
|
-
|
68
|
-
none: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
69
72
|
requirements:
|
70
|
-
- -
|
73
|
+
- - ">="
|
71
74
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
-
|
74
|
-
prerelease: false
|
75
|
-
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
version: !binary |-
|
76
|
+
MA==
|
76
77
|
none: false
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
77
79
|
requirements:
|
78
|
-
- -
|
80
|
+
- - ">="
|
79
81
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
82
|
+
version: !binary |-
|
83
|
+
MA==
|
84
|
+
none: false
|
85
|
+
prerelease: false
|
86
|
+
type: :development
|
81
87
|
- !ruby/object:Gem::Dependency
|
82
88
|
name: rspec
|
83
|
-
|
84
|
-
none: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
90
|
requirements:
|
86
|
-
- -
|
91
|
+
- - ">="
|
87
92
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
89
|
-
|
90
|
-
prerelease: false
|
91
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
version: !binary |-
|
94
|
+
MA==
|
92
95
|
none: false
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
93
97
|
requirements:
|
94
|
-
- -
|
98
|
+
- - ">="
|
95
99
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
100
|
+
version: !binary |-
|
101
|
+
MA==
|
102
|
+
none: false
|
103
|
+
prerelease: false
|
104
|
+
type: :development
|
97
105
|
- !ruby/object:Gem::Dependency
|
98
106
|
name: simplecov
|
99
|
-
|
100
|
-
none: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
108
|
requirements:
|
102
|
-
- -
|
109
|
+
- - ">="
|
103
110
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
105
|
-
|
106
|
-
prerelease: false
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
version: !binary |-
|
112
|
+
MA==
|
108
113
|
none: false
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
109
115
|
requirements:
|
110
|
-
- -
|
116
|
+
- - ">="
|
111
117
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
113
|
-
|
114
|
-
|
115
|
-
|
118
|
+
version: !binary |-
|
119
|
+
MA==
|
120
|
+
none: false
|
121
|
+
prerelease: false
|
122
|
+
type: :development
|
123
|
+
description: |
|
124
|
+
Honeydew is a Ruby driver for UIAutomator which enables automated testing of
|
116
125
|
Android devices.
|
117
|
-
|
118
|
-
'
|
119
126
|
email:
|
120
127
|
- scmp-team@amplify.com
|
121
128
|
- jbarker@amplify.com
|
@@ -123,10 +130,10 @@ executables: []
|
|
123
130
|
extensions: []
|
124
131
|
extra_rdoc_files: []
|
125
132
|
files:
|
126
|
-
- .gitignore
|
127
|
-
- .rspec
|
128
|
-
- .ruby-gemset
|
129
|
-
- .ruby-version
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".ruby-gemset"
|
136
|
+
- ".ruby-version"
|
130
137
|
- Gemfile
|
131
138
|
- LICENSE.txt
|
132
139
|
- README.md
|
@@ -203,33 +210,35 @@ files:
|
|
203
210
|
- spec/honeydew/device_matchers_spec.rb
|
204
211
|
- spec/honeydew/device_spec.rb
|
205
212
|
- spec/spec_helper.rb
|
206
|
-
- server/target/honeydew-server-0.
|
207
|
-
homepage:
|
213
|
+
- server/target/honeydew-server-0.20.0.jar
|
214
|
+
homepage:
|
208
215
|
licenses: []
|
209
|
-
post_install_message:
|
216
|
+
post_install_message:
|
210
217
|
rdoc_options: []
|
211
218
|
require_paths:
|
212
219
|
- lib
|
213
220
|
required_ruby_version: !ruby/object:Gem::Requirement
|
214
|
-
none: false
|
215
221
|
requirements:
|
216
|
-
- -
|
222
|
+
- - ">="
|
217
223
|
- !ruby/object:Gem::Version
|
218
|
-
version:
|
219
|
-
|
224
|
+
version: !binary |-
|
225
|
+
MA==
|
220
226
|
none: false
|
227
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
228
|
requirements:
|
222
|
-
- -
|
229
|
+
- - ">="
|
223
230
|
- !ruby/object:Gem::Version
|
224
|
-
version:
|
231
|
+
version: !binary |-
|
232
|
+
MA==
|
233
|
+
none: false
|
225
234
|
requirements: []
|
226
|
-
rubyforge_project:
|
227
|
-
rubygems_version: 1.8.
|
228
|
-
signing_key:
|
235
|
+
rubyforge_project:
|
236
|
+
rubygems_version: 1.8.24
|
237
|
+
signing_key:
|
229
238
|
specification_version: 3
|
230
239
|
summary: Ruby DSL for controlling Android devices
|
231
240
|
test_files:
|
232
|
-
- .rspec
|
241
|
+
- ".rspec"
|
233
242
|
- examples/rspec/Gemfile
|
234
243
|
- examples/rspec/Rakefile
|
235
244
|
- examples/rspec/spec/browse_spec.rb
|