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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c9445a58d9bd30e8b0d5aa6691064e0856734690
4
- data.tar.gz: e8e84944fa934a5f73b315aa1b17416e8cee1680
3
+ metadata.gz: 831d2b4dce9f6bcfa375d6b8d95b30f1036c484b
4
+ data.tar.gz: 818eef4be9be56128ad22bb97c7c806c65ed316a
5
5
  SHA512:
6
- metadata.gz: 73512b4cacecc01e1147c741939a94ce61a372c11ee49f321e64a3949749944fefa29e86936d152cd1714efd3c7b4cfac3b822f53238b7669b593eb83749b43f
7
- data.tar.gz: 19653c42db6d20e38d476574f720ef29fc11d0ed75320005f5104affe20b2fa5c5f41dc43b2b3d9a8f05a037d023061b7d2b63de870b7945a90855aa7e38e477
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
 
@@ -2,5 +2,5 @@
2
2
  # Gem version
3
3
  #
4
4
  module CaliosUIAExtension
5
- VERSION = '0.0.5'
5
+ VERSION = '0.0.6'
6
6
  end
@@ -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.5
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-14 00:00:00.000000000 Z
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: calabash-cucumber