calabash-android 0.3.2.pre5 → 0.3.2
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.
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
package sh.calaba.instrumentationbackend.actions.view;
|
2
|
+
|
3
|
+
import sh.calaba.instrumentationbackend.InstrumentationBackend;
|
4
|
+
import sh.calaba.instrumentationbackend.Result;
|
5
|
+
import sh.calaba.instrumentationbackend.actions.Action;
|
6
|
+
import android.app.Activity;
|
7
|
+
|
8
|
+
/**
|
9
|
+
* This action checks that the current activity under test has the focus.
|
10
|
+
*
|
11
|
+
* This is useful to run tests across different applications (for example,
|
12
|
+
* your application launching the browser). Since the instrumentation can
|
13
|
+
* only work with the application under test, then all we can assert is that
|
14
|
+
* said application has lost the focus.
|
15
|
+
*
|
16
|
+
* @author Gianpiero Puleo (gianpi@ustwo.co.uk)
|
17
|
+
* @author Juan Delgado (juan@ustwo.co.uk)
|
18
|
+
*/
|
19
|
+
@SuppressWarnings("deprecation")
|
20
|
+
public class IsCurrentActivityFocused implements Action {
|
21
|
+
|
22
|
+
@Override
|
23
|
+
public Result execute(String... args) {
|
24
|
+
|
25
|
+
Activity currentActivity = InstrumentationBackend.solo.getCurrentActivity();
|
26
|
+
|
27
|
+
String hasFocus = "false";
|
28
|
+
|
29
|
+
if (currentActivity.hasWindowFocus()) {
|
30
|
+
hasFocus = "true";
|
31
|
+
}
|
32
|
+
|
33
|
+
return new Result(true, hasFocus);
|
34
|
+
}
|
35
|
+
|
36
|
+
@Override
|
37
|
+
public String key() {
|
38
|
+
return "is_current_activity_focused";
|
39
|
+
}
|
40
|
+
}
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.2
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.2
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jonas Maturana Larsen
|
@@ -256,6 +256,7 @@ files:
|
|
256
256
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/GetActivityName.java
|
257
257
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/GetViewProperty.java
|
258
258
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/HasView.java
|
259
|
+
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/IsCurrentActivityFocused.java
|
259
260
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/IsEnabled.java
|
260
261
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/LongPressOnViewById.java
|
261
262
|
- test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/Press.java
|
@@ -707,9 +708,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
707
708
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
708
709
|
none: false
|
709
710
|
requirements:
|
710
|
-
- - ! '
|
711
|
+
- - ! '>='
|
711
712
|
- !ruby/object:Gem::Version
|
712
|
-
version:
|
713
|
+
version: '0'
|
713
714
|
requirements: []
|
714
715
|
rubyforge_project:
|
715
716
|
rubygems_version: 1.8.24
|