calabash-android 0.8.0.pre1 → 0.8.0.pre2
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/bin/calabash-android-console.rb +0 -5
- data/bin/calabash-android-run.rb +4 -4
- data/lib/calabash-android/lib/TestServer.apk +0 -0
- data/lib/calabash-android/operations.rb +23 -5
- data/lib/calabash-android/retry.rb +24 -0
- data/lib/calabash-android/steps/navigation_steps.rb +2 -1
- data/lib/calabash-android/version.rb +1 -1
- metadata +3 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc0a5ca87b41a3b21f898f7d27a156e6a12c2679
|
4
|
+
data.tar.gz: 3a3efb9ed3632879c1fc8476d77e11207c3e19bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df6bda16ea2e67aa9904badbb85d81ac36bf4cbb57222df20fae15c6069c0e7d7753fa8c735fa30417f74b781c94fdfaf5b313245a445d1c2eba989bc97b8d1f
|
7
|
+
data.tar.gz: 8c727c35e57d94f9f7be437f7eea008357401724df69015415a265d70769870b5e4bd795e5afb2c91067c44ba5bd0d885c2686e0eeeecfd8a469e19d914a976c
|
data/bin/calabash-android-run.rb
CHANGED
@@ -17,11 +17,11 @@ def calabash_run(app_path = nil)
|
|
17
17
|
|
18
18
|
test_server_path = test_server_path(app_path)
|
19
19
|
|
20
|
-
|
20
|
+
env = "APP_PATH=\"#{app_path}\" TEST_APP_PATH=\"#{test_server_path}\""
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
if ENV['MAIN_ACTIVITY']
|
23
|
+
env = "#{env} MAIN_ACTIVITY=#{ENV['MAIN_ACTIVITY']}"
|
24
|
+
end
|
25
25
|
else
|
26
26
|
env = ""
|
27
27
|
end
|
Binary file
|
@@ -18,10 +18,10 @@ require 'calabash-android/env'
|
|
18
18
|
require 'calabash-android/environment'
|
19
19
|
require 'calabash-android/dot_dir'
|
20
20
|
require 'calabash-android/logging'
|
21
|
+
require 'calabash-android/retry'
|
21
22
|
require 'calabash-android/store/preferences'
|
22
23
|
require 'calabash-android/usage_tracker'
|
23
24
|
require 'calabash-android/dependencies'
|
24
|
-
require 'retriable'
|
25
25
|
require 'cucumber'
|
26
26
|
require 'date'
|
27
27
|
require 'time'
|
@@ -188,6 +188,24 @@ module Calabash module Android
|
|
188
188
|
default_device.clear_preferences(name)
|
189
189
|
end
|
190
190
|
|
191
|
+
def set_activity_orientation(orientation)
|
192
|
+
unless orientation.is_a?(Symbol)
|
193
|
+
raise ArgumentError, "Orientation is not a symbol"
|
194
|
+
end
|
195
|
+
|
196
|
+
unless orientation == :landscape || orientation == :portrait ||
|
197
|
+
orientation == :reverse_landscape || orientation == :reverse_portrait
|
198
|
+
raise ArgumentError, "Invalid orientation given. Use :landscape, :portrait, :reverse_landscape, or :reverse_portrait"
|
199
|
+
end
|
200
|
+
|
201
|
+
perform_action("set_activity_orientation", orientation.to_s)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Note: Android 2.2 will always return either portrait or landscape, not reverse_portrait or reverse_landscape
|
205
|
+
def get_activity_orientation
|
206
|
+
perform_action("get_activity_orientation")
|
207
|
+
end
|
208
|
+
|
191
209
|
def query(uiquery, *args)
|
192
210
|
converted_args = []
|
193
211
|
args.each do |arg|
|
@@ -618,7 +636,7 @@ module Calabash module Android
|
|
618
636
|
log wake_up_cmd
|
619
637
|
raise "Could not wake up the device" unless system(wake_up_cmd)
|
620
638
|
|
621
|
-
|
639
|
+
Calabash::Android::Retry.retry :tries => 10, :interval => 1 do
|
622
640
|
raise "Could not remove the keyguard" if keyguard_enabled?
|
623
641
|
end
|
624
642
|
end
|
@@ -648,7 +666,7 @@ module Calabash module Android
|
|
648
666
|
env_options = options.clone
|
649
667
|
env_options.delete(:intent)
|
650
668
|
|
651
|
-
env_options[:main_activity] ||=
|
669
|
+
env_options[:main_activity] ||= ENV['MAIN_ACTIVITY'] || 'null'
|
652
670
|
env_options[:test_server_port] ||= @test_server_port
|
653
671
|
env_options[:class] ||= "sh.calaba.instrumentationbackend.InstrumentationBackend"
|
654
672
|
|
@@ -668,12 +686,12 @@ module Calabash module Android
|
|
668
686
|
log cmd
|
669
687
|
raise "Could not execute command to start test server" unless system("#{cmd} 2>&1")
|
670
688
|
|
671
|
-
|
689
|
+
Calabash::Android::Retry.retry :tries => 100, :interval => 0.1 do
|
672
690
|
raise "App did not start" unless app_running?
|
673
691
|
end
|
674
692
|
|
675
693
|
begin
|
676
|
-
|
694
|
+
Calabash::Android::Retry.retry :tries => 300, :interval => 0.1 do
|
677
695
|
log "Checking if instrumentation backend is ready"
|
678
696
|
|
679
697
|
log "Is app running? #{app_running?}"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Calabash
|
2
|
+
module Android
|
3
|
+
module Retry
|
4
|
+
def self.retry(opts, &blk)
|
5
|
+
tries = opts[:tries]
|
6
|
+
interval = opts[:interval]
|
7
|
+
|
8
|
+
tries.times do |try|
|
9
|
+
begin
|
10
|
+
blk.call
|
11
|
+
return
|
12
|
+
|
13
|
+
rescue => e
|
14
|
+
if (try + 1) >= tries
|
15
|
+
raise
|
16
|
+
else
|
17
|
+
sleep interval
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.0.
|
4
|
+
version: 0.8.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Maturana Larsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -38,26 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.8'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: retriable
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.3.3.1
|
48
|
-
- - "<"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '1.5'
|
51
|
-
type: :runtime
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 1.3.3.1
|
58
|
-
- - "<"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '1.5'
|
61
41
|
- !ruby/object:Gem::Dependency
|
62
42
|
name: slowhandcuke
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -367,6 +347,7 @@ files:
|
|
367
347
|
- lib/calabash-android/monkey_helpers.rb
|
368
348
|
- lib/calabash-android/operations.rb
|
369
349
|
- lib/calabash-android/removed_actions.txt
|
350
|
+
- lib/calabash-android/retry.rb
|
370
351
|
- lib/calabash-android/steps/assert_steps.rb
|
371
352
|
- lib/calabash-android/steps/check_box_steps.rb
|
372
353
|
- lib/calabash-android/steps/context_menu_steps.rb
|