calabash-android 0.0.15 → 0.0.16
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/CHANGES.txt +4 -0
- data/lib/calabash-android/canned_steps.md +4 -0
- data/lib/calabash-android/lib/screenShotTaker.jar +0 -0
- data/lib/calabash-android/operations.rb +10 -2
- data/lib/calabash-android/version.rb +2 -2
- metadata +2 -5
- data/test-server/instrumentation-backend/.settings/org.eclipse.jdt.core.prefs +0 -12
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/CoreXMLDeserializers.java +0 -114
- data/test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/CoreXMLSerializers.java +0 -72
data/CHANGES.txt
CHANGED
@@ -120,6 +120,8 @@ Presses the image button by index.
|
|
120
120
|
Then /^I press view with id "([^\"]*)"$/
|
121
121
|
|
122
122
|
Looks for a view with the provided id. If it is found and visible tries to click it.
|
123
|
+
Note that use the short name and not the fully quantified name. That means if your id
|
124
|
+
is 'com.foo.R.id.bar_label' you would use 'I press view with id "bar_label"'.
|
123
125
|
|
124
126
|
Then /^I press "([^\"]*)"$/ do |identifier|
|
125
127
|
Will look for a view in the following order:
|
@@ -165,6 +167,8 @@ Waits for a particular screen (Android Activity) to appear.
|
|
165
167
|
|
166
168
|
Then /^I wait for the view with id "([^\"]*)" to appear$/ do |text|
|
167
169
|
Waits for a view view that id to appear.
|
170
|
+
Note that use the short name and not the fully quantified name. That means if your id
|
171
|
+
is 'com.foo.R.id.bar_label' you would use 'I press view with id "bar_label"'.
|
168
172
|
|
169
173
|
Then /^I wait upto (\d+) seconds for the "([^\"]*)" screen to appear$/
|
170
174
|
Waits for a particular screen (Android Activity) to appear with a timeout.
|
Binary file
|
@@ -78,7 +78,7 @@ module Operations
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def query(uiquery, *args)
|
81
|
-
raise "Currently
|
81
|
+
raise "Currently queries are only supported for webviews" unless uiquery.start_with? "webView"
|
82
82
|
|
83
83
|
uiquery.slice!(0, "webView".length)
|
84
84
|
if uiquery =~ /(css|xpath):\s*(.*)/
|
@@ -169,7 +169,15 @@ module Operations
|
|
169
169
|
|
170
170
|
|
171
171
|
def set_text(uiquery, txt)
|
172
|
-
|
172
|
+
raise "Currently queries are only supported for webviews" unless uiquery.start_with? "webView"
|
173
|
+
|
174
|
+
uiquery.slice!(0, "webView".length)
|
175
|
+
if uiquery =~ /(css|xpath):\s*(.*)/
|
176
|
+
r = performAction("set_text", $1, $2, txt)
|
177
|
+
JSON.parse(r["message"])
|
178
|
+
else
|
179
|
+
raise "Invalid query #{uiquery}"
|
180
|
+
end
|
173
181
|
end
|
174
182
|
|
175
183
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|
@@ -120,7 +120,6 @@ files:
|
|
120
120
|
- test-server/build.xml
|
121
121
|
- test-server/instrumentation-backend/.classpath
|
122
122
|
- test-server/instrumentation-backend/.project
|
123
|
-
- test-server/instrumentation-backend/.settings/org.eclipse.jdt.core.prefs
|
124
123
|
- test-server/instrumentation-backend/AndroidManifest.xml
|
125
124
|
- test-server/instrumentation-backend/assets/foo.bar
|
126
125
|
- test-server/instrumentation-backend/gen/com/lesspainful/simpleui/test/R.java
|
@@ -393,8 +392,6 @@ files:
|
|
393
392
|
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/UntypedObjectDeserializer.java
|
394
393
|
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/deser/std/package-info.java
|
395
394
|
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/exc/UnrecognizedPropertyException.java
|
396
|
-
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/CoreXMLDeserializers.java
|
397
|
-
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/CoreXMLSerializers.java
|
398
395
|
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/DOMDeserializer.java
|
399
396
|
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/OptionalHandlerFactory.java
|
400
397
|
- test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/ext/package-info.java
|
@@ -1,12 +0,0 @@
|
|
1
|
-
#Mon Mar 19 14:45:07 BRT 2012
|
2
|
-
eclipse.preferences.version=1
|
3
|
-
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
4
|
-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
5
|
-
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
6
|
-
org.eclipse.jdt.core.compiler.compliance=1.6
|
7
|
-
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
8
|
-
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
9
|
-
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
10
|
-
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
11
|
-
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
12
|
-
org.eclipse.jdt.core.compiler.source=1.6
|
@@ -1,114 +0,0 @@
|
|
1
|
-
package sh.calaba.org.codehaus.jackson.map.ext;
|
2
|
-
|
3
|
-
import java.io.IOException;
|
4
|
-
import java.util.*;
|
5
|
-
|
6
|
-
import javax.xml.datatype.DatatypeConfigurationException;
|
7
|
-
import javax.xml.datatype.DatatypeFactory;
|
8
|
-
import javax.xml.datatype.Duration;
|
9
|
-
import javax.xml.datatype.XMLGregorianCalendar;
|
10
|
-
import javax.xml.namespace.QName;
|
11
|
-
|
12
|
-
import sh.calaba.org.codehaus.jackson.JsonParser;
|
13
|
-
import sh.calaba.org.codehaus.jackson.JsonProcessingException;
|
14
|
-
import sh.calaba.org.codehaus.jackson.map.DeserializationContext;
|
15
|
-
import sh.calaba.org.codehaus.jackson.map.deser.std.FromStringDeserializer;
|
16
|
-
import sh.calaba.org.codehaus.jackson.map.deser.std.StdDeserializer;
|
17
|
-
import sh.calaba.org.codehaus.jackson.map.deser.std.StdScalarDeserializer;
|
18
|
-
import sh.calaba.org.codehaus.jackson.map.util.Provider;
|
19
|
-
|
20
|
-
/**
|
21
|
-
* Container deserializers that handle "core" XML types: ones included in standard
|
22
|
-
* JDK 1.5. Types are directly needed by JAXB, and are thus supported within core
|
23
|
-
* mapper package, not in "xc" package.
|
24
|
-
*
|
25
|
-
* @since 1.3
|
26
|
-
*/
|
27
|
-
public class CoreXMLDeserializers
|
28
|
-
implements Provider<StdDeserializer<?>>
|
29
|
-
{
|
30
|
-
/**
|
31
|
-
* Data type factories are thread-safe after instantiation (and
|
32
|
-
* configuration, if any); and since instantion (esp. implementation
|
33
|
-
* introspection) can be expensive we better reuse the instance.
|
34
|
-
*/
|
35
|
-
final static DatatypeFactory _dataTypeFactory;
|
36
|
-
static {
|
37
|
-
try {
|
38
|
-
_dataTypeFactory = DatatypeFactory.newInstance();
|
39
|
-
} catch (DatatypeConfigurationException e) {
|
40
|
-
throw new RuntimeException(e);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
/*
|
45
|
-
/**********************************************************
|
46
|
-
/* Provider implementation
|
47
|
-
/**********************************************************
|
48
|
-
*/
|
49
|
-
|
50
|
-
/**
|
51
|
-
* Method called by {@link sh.calaba.org.codehaus.jackson.map.deser.BasicDeserializerFactory}
|
52
|
-
* to register deserializers this class provides.
|
53
|
-
*/
|
54
|
-
@Override
|
55
|
-
public Collection<StdDeserializer<?>> provide()
|
56
|
-
{
|
57
|
-
return Arrays.asList(new StdDeserializer<?>[] {
|
58
|
-
new DurationDeserializer()
|
59
|
-
,new GregorianCalendarDeserializer()
|
60
|
-
,new QNameDeserializer()
|
61
|
-
});
|
62
|
-
}
|
63
|
-
|
64
|
-
/*
|
65
|
-
/**********************************************************
|
66
|
-
/* Concrete deserializers
|
67
|
-
/**********************************************************
|
68
|
-
*/
|
69
|
-
|
70
|
-
public static class DurationDeserializer
|
71
|
-
extends FromStringDeserializer<Duration>
|
72
|
-
{
|
73
|
-
public DurationDeserializer() { super(Duration.class); }
|
74
|
-
|
75
|
-
@Override
|
76
|
-
protected Duration _deserialize(String value, DeserializationContext ctxt)
|
77
|
-
throws IllegalArgumentException
|
78
|
-
{
|
79
|
-
return _dataTypeFactory.newDuration(value);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
|
83
|
-
public static class GregorianCalendarDeserializer
|
84
|
-
extends StdScalarDeserializer<XMLGregorianCalendar>
|
85
|
-
{
|
86
|
-
public GregorianCalendarDeserializer() { super(XMLGregorianCalendar.class); }
|
87
|
-
|
88
|
-
@Override
|
89
|
-
public XMLGregorianCalendar deserialize(JsonParser jp, DeserializationContext ctxt)
|
90
|
-
throws IOException, JsonProcessingException
|
91
|
-
{
|
92
|
-
Date d = _parseDate(jp, ctxt);
|
93
|
-
if (d == null) {
|
94
|
-
return null;
|
95
|
-
}
|
96
|
-
GregorianCalendar calendar = new GregorianCalendar();
|
97
|
-
calendar.setTime(d);
|
98
|
-
return _dataTypeFactory.newXMLGregorianCalendar(calendar);
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
|
-
public static class QNameDeserializer
|
103
|
-
extends FromStringDeserializer<QName>
|
104
|
-
{
|
105
|
-
public QNameDeserializer() { super(QName.class); }
|
106
|
-
|
107
|
-
@Override
|
108
|
-
protected QName _deserialize(String value, DeserializationContext ctxt)
|
109
|
-
throws IllegalArgumentException
|
110
|
-
{
|
111
|
-
return QName.valueOf(value);
|
112
|
-
}
|
113
|
-
}
|
114
|
-
}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
package sh.calaba.org.codehaus.jackson.map.ext;
|
2
|
-
|
3
|
-
import java.io.IOException;
|
4
|
-
import java.lang.reflect.Type;
|
5
|
-
import java.util.Collection;
|
6
|
-
import java.util.HashMap;
|
7
|
-
import java.util.Map;
|
8
|
-
|
9
|
-
import javax.xml.datatype.Duration;
|
10
|
-
import javax.xml.datatype.XMLGregorianCalendar;
|
11
|
-
import javax.xml.namespace.QName;
|
12
|
-
|
13
|
-
import sh.calaba.org.codehaus.jackson.JsonGenerationException;
|
14
|
-
import sh.calaba.org.codehaus.jackson.JsonGenerator;
|
15
|
-
import sh.calaba.org.codehaus.jackson.JsonNode;
|
16
|
-
import sh.calaba.org.codehaus.jackson.map.JsonMappingException;
|
17
|
-
import sh.calaba.org.codehaus.jackson.map.JsonSerializer;
|
18
|
-
import sh.calaba.org.codehaus.jackson.map.SerializerProvider;
|
19
|
-
import sh.calaba.org.codehaus.jackson.map.ser.std.CalendarSerializer;
|
20
|
-
import sh.calaba.org.codehaus.jackson.map.ser.std.SerializerBase;
|
21
|
-
import sh.calaba.org.codehaus.jackson.map.ser.std.ToStringSerializer;
|
22
|
-
import sh.calaba.org.codehaus.jackson.map.util.Provider;
|
23
|
-
|
24
|
-
/**
|
25
|
-
* Provider for serializers of XML types that are part of full JDK 1.5, but
|
26
|
-
* that some alleged 1.5 platforms are missing (Android, GAE).
|
27
|
-
* And for this reason these are added using more dynamic mechanism.
|
28
|
-
*<p>
|
29
|
-
* Note: since many of classes defined are abstract, caller must take
|
30
|
-
* care not to just use straight equivalency check but rather consider
|
31
|
-
* subclassing as well.
|
32
|
-
*
|
33
|
-
* @since 1.4
|
34
|
-
*/
|
35
|
-
public class CoreXMLSerializers
|
36
|
-
implements Provider<Map.Entry<Class<?>,JsonSerializer<?>>>
|
37
|
-
{
|
38
|
-
final static HashMap<Class<?>,JsonSerializer<?>> _serializers = new HashMap<Class<?>,JsonSerializer<?>>();
|
39
|
-
/**
|
40
|
-
* We will construct instances statically, during class loading, to try to
|
41
|
-
* make things fail-fast, i.e. to catch problems as soon as possible.
|
42
|
-
*/
|
43
|
-
static {
|
44
|
-
ToStringSerializer tss = ToStringSerializer.instance;
|
45
|
-
_serializers.put(Duration.class, tss);
|
46
|
-
_serializers.put(XMLGregorianCalendar.class, new XMLGregorianCalendarSerializer());
|
47
|
-
_serializers.put(QName.class, tss);
|
48
|
-
}
|
49
|
-
|
50
|
-
@Override
|
51
|
-
public Collection<Map.Entry<Class<?>,JsonSerializer<?>>> provide() {
|
52
|
-
return _serializers.entrySet();
|
53
|
-
}
|
54
|
-
|
55
|
-
public static class XMLGregorianCalendarSerializer extends SerializerBase<XMLGregorianCalendar>
|
56
|
-
{
|
57
|
-
public XMLGregorianCalendarSerializer() {
|
58
|
-
super(XMLGregorianCalendar.class);
|
59
|
-
}
|
60
|
-
|
61
|
-
@Override
|
62
|
-
public void serialize(XMLGregorianCalendar value, JsonGenerator jgen, SerializerProvider provider)
|
63
|
-
throws IOException, JsonGenerationException {
|
64
|
-
CalendarSerializer.instance.serialize(value.toGregorianCalendar(), jgen, provider);
|
65
|
-
}
|
66
|
-
|
67
|
-
@Override
|
68
|
-
public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException {
|
69
|
-
return CalendarSerializer.instance.getSchema(provider, typeHint);
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|