calios-uia-extension 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/lib/calios-uia-extension/uia_target.rb +8 -1
- data/lib/calios-uia-extension/version.rb +1 -1
- data/spec/spec_uia_target.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 831d2b4dce9f6bcfa375d6b8d95b30f1036c484b
|
4
|
+
data.tar.gz: 818eef4be9be56128ad22bb97c7c806c65ed316a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d9b286067b3c1c01de138868df4cf46549788288873f8bec2e83736af55329e53c6e383e885c13eb481b1178f3b8b53c84ca570fd0cfbb72548f1416365e47a
|
7
|
+
data.tar.gz: fba16911958aa7883d50d7f0323eca9df5369dfda4481b4945b872b3d8f531f83790c2c12384904dd32dedf6d84f107e75413b849806a0c344d2d4dfaa5a8dd2
|
@@ -29,7 +29,14 @@ class UIATarget < UIABase
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def deactivate_app_for_duration(aDuration = 5)
|
32
|
-
res = execute("target.deactivateAppForDuration(#{aDuration})")
|
32
|
+
# res = execute("target.deactivateAppForDuration(#{aDuration})")
|
33
|
+
|
34
|
+
# Workaround for https://github.com/JaniJegoroff/calios-uia-extension/issues/1
|
35
|
+
# rubocop:disable Metrics/LineLength
|
36
|
+
command = %[var x = target.deactivateAppForDuration(#{aDuration}); var MAX_RETRY = 5, retries = 0; while (!x && retries < MAX_RETRY) { x = target.deactivateAppForDuration(#{aDuration}); retries += 1}; x]
|
37
|
+
# rubocop:enable Metrics/LineLength
|
38
|
+
res = execute(command)
|
39
|
+
|
33
40
|
response(res)
|
34
41
|
end
|
35
42
|
|
data/spec/spec_uia_target.rb
CHANGED
@@ -78,19 +78,23 @@ class SpecUIATarget < Minitest::Spec
|
|
78
78
|
}
|
79
79
|
|
80
80
|
res = UIATarget.deactivate_app_for_duration
|
81
|
-
$uia_command.must_equal('target.deactivateAppForDuration(5)')
|
81
|
+
# $uia_command.must_equal('target.deactivateAppForDuration(5)')
|
82
|
+
$uia_command.must_equal('var x = target.deactivateAppForDuration(5); var MAX_RETRY = 5, retries = 0; while (!x && retries < MAX_RETRY) { x = target.deactivateAppForDuration(5); retries += 1}; x')
|
82
83
|
res.must_equal(true)
|
83
84
|
|
84
85
|
res = UIATarget.deactivate_app_for_duration(10)
|
85
|
-
$uia_command.must_equal('target.deactivateAppForDuration(10)')
|
86
|
+
# $uia_command.must_equal('target.deactivateAppForDuration(10)')
|
87
|
+
$uia_command.must_equal('var x = target.deactivateAppForDuration(10); var MAX_RETRY = 5, retries = 0; while (!x && retries < MAX_RETRY) { x = target.deactivateAppForDuration(10); retries += 1}; x')
|
86
88
|
res.must_equal(true)
|
87
89
|
|
88
90
|
res = UIATarget.send_application_to_background
|
89
|
-
$uia_command.must_equal('target.deactivateAppForDuration(5)')
|
91
|
+
# $uia_command.must_equal('target.deactivateAppForDuration(5)')
|
92
|
+
$uia_command.must_equal('var x = target.deactivateAppForDuration(5); var MAX_RETRY = 5, retries = 0; while (!x && retries < MAX_RETRY) { x = target.deactivateAppForDuration(5); retries += 1}; x')
|
90
93
|
res.must_equal(true)
|
91
94
|
|
92
95
|
res = UIATarget.send_application_to_background(10)
|
93
|
-
$uia_command.must_equal('target.deactivateAppForDuration(10)')
|
96
|
+
# $uia_command.must_equal('target.deactivateAppForDuration(10)')
|
97
|
+
$uia_command.must_equal('var x = target.deactivateAppForDuration(10); var MAX_RETRY = 5, retries = 0; while (!x && retries < MAX_RETRY) { x = target.deactivateAppForDuration(10); retries += 1}; x')
|
94
98
|
res.must_equal(true)
|
95
99
|
end
|
96
100
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calios-uia-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jani Jegoroff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: calabash-cucumber
|