calabash 2.0.0.pre11 → 2.0.0.prelegacy
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -5
- data/bin/calabash +4 -3
- data/lib/calabash/android/adb.rb +37 -34
- data/lib/calabash/android/application.rb +1 -1
- data/lib/calabash/android/build/builder.rb +1 -1
- data/lib/calabash/android/build/java_keystore.rb +1 -1
- data/lib/calabash/android/build/resigner.rb +1 -1
- data/lib/calabash/android/device.rb +46 -204
- data/lib/calabash/android/environment.rb +1 -14
- data/lib/calabash/android/gestures.rb +22 -6
- data/lib/calabash/android/interactions.rb +17 -14
- data/lib/calabash/android/legacy.rb +141 -4
- data/lib/calabash/android/lib/.irbrc +1 -9
- data/lib/calabash/android/lib/AndroidManifest.xml +2 -23
- data/lib/calabash/android/lib/TestServer.apk +0 -0
- data/lib/calabash/android/life_cycle.rb +3 -3
- data/lib/calabash/android/orientation.rb +8 -8
- data/lib/calabash/android/physical_buttons.rb +16 -19
- data/lib/calabash/android/server.rb +1 -6
- data/lib/calabash/android/text.rb +12 -12
- data/lib/calabash/android.rb +26 -92
- data/lib/calabash/application.rb +0 -3
- data/lib/calabash/cli/generate.rb +18 -8
- data/lib/calabash/cli/helpers.rb +9 -4
- data/lib/calabash/cli/run.rb +1 -1
- data/lib/calabash/console_helpers.rb +11 -179
- data/lib/calabash/device.rb +19 -4
- data/lib/calabash/gestures.rb +198 -292
- data/lib/calabash/http/retriable_client.rb +3 -18
- data/lib/calabash/http.rb +0 -1
- data/lib/calabash/interactions.rb +40 -3
- data/lib/calabash/ios/conditions.rb +1 -1
- data/lib/calabash/ios/console_helpers.rb +2 -2
- data/lib/calabash/ios/date_picker.rb +8 -10
- data/lib/calabash/ios/device/device_implementation.rb +21 -9
- data/lib/calabash/ios/device/gestures_mixin.rb +55 -53
- data/lib/calabash/ios/device/keyboard_mixin.rb +0 -21
- data/lib/calabash/ios/device/rotation_mixin.rb +65 -3
- data/lib/calabash/ios/device/text_mixin.rb +21 -0
- data/lib/calabash/ios/device.rb +1 -0
- data/lib/calabash/ios/gestures.rb +90 -24
- data/lib/calabash/ios/interactions.rb +6 -1
- data/lib/calabash/ios/lib/.irbrc +2 -9
- data/lib/calabash/ios/orientation.rb +8 -8
- data/lib/calabash/ios/runtime.rb +14 -14
- data/lib/calabash/ios/scroll.rb +17 -25
- data/lib/calabash/ios/slider.rb +18 -11
- data/lib/calabash/ios/text.rb +74 -20
- data/lib/calabash/ios/uia.rb +1 -1
- data/lib/calabash/ios.rb +16 -77
- data/lib/calabash/legacy.rb +6 -9
- data/lib/calabash/lib/skeleton/{Gemfile.skeleton → Gemfile} +0 -0
- data/lib/calabash/lib/skeleton/config/{cucumber.yml.skeleton → cucumber.yml} +0 -0
- data/lib/calabash/lib/skeleton/features/{sample.feature.skeleton → sample.feature} +0 -0
- data/lib/calabash/lib/skeleton/features/step_definitions/{sample_steps.rb.skeleton → calabash_steps.rb} +8 -8
- data/lib/calabash/lib/skeleton/features/support/{dry_run.rb.skeleton → dry_run.rb} +5 -2
- data/lib/calabash/lib/skeleton/features/support/{env.rb.skeleton → env.rb} +8 -2
- data/lib/calabash/lib/skeleton/features/support/hooks.rb +83 -0
- data/lib/calabash/life_cycle.rb +8 -16
- data/lib/calabash/location.rb +15 -14
- data/lib/calabash/orientation.rb +8 -8
- data/lib/calabash/page.rb +4 -1
- data/lib/calabash/screenshot.rb +3 -3
- data/lib/calabash/text.rb +19 -31
- data/lib/calabash/utility.rb +8 -41
- data/lib/calabash/version.rb +1 -1
- data/lib/calabash/wait.rb +192 -177
- data/lib/calabash.rb +10 -53
- metadata +32 -43
- data/lib/calabash/android/device/helper_application.rb +0 -95
- data/lib/calabash/android/lib/HelperApplication.apk +0 -0
- data/lib/calabash/android/lib/HelperApplicationTestServer.apk +0 -0
- data/lib/calabash/android/web.rb +0 -12
- data/lib/calabash/http/forwarding_client.rb +0 -23
- data/lib/calabash/internal.rb +0 -48
- data/lib/calabash/ios/automator/automator.rb +0 -217
- data/lib/calabash/ios/automator/coordinates.rb +0 -37
- data/lib/calabash/ios/automator/device_agent.rb +0 -379
- data/lib/calabash/ios/automator.rb +0 -9
- data/lib/calabash/ios/legacy.rb +0 -6
- data/lib/calabash/ios/web.rb +0 -10
- data/lib/calabash/lib/skeleton/features/support/hooks.rb.skeleton +0 -34
- data/lib/calabash/retry.rb +0 -33
- data/lib/calabash/stubs.rb +0 -21
- data/lib/calabash/web.rb +0 -44
data/lib/calabash/retry.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
module Calabash
|
2
|
-
module Retry
|
3
|
-
DEFAULT_INTERVAL = 0.5
|
4
|
-
|
5
|
-
def self.retry(retries: nil, interval: DEFAULT_INTERVAL, timeout: nil, on_errors: [StandardError], &block)
|
6
|
-
if retries.nil?
|
7
|
-
raise ArgumentError, "Must supply retries"
|
8
|
-
end
|
9
|
-
|
10
|
-
if retries < 1
|
11
|
-
raise ArgumentError, "'retries' must be greater or equal to 1, it is #{retries}"
|
12
|
-
end
|
13
|
-
|
14
|
-
last_error = nil
|
15
|
-
start_time = Time.now
|
16
|
-
|
17
|
-
retries.times do
|
18
|
-
begin
|
19
|
-
return block.call
|
20
|
-
rescue *on_errors => e
|
21
|
-
last_error = e
|
22
|
-
sleep interval
|
23
|
-
|
24
|
-
if timeout && Time.now - start_time > timeout
|
25
|
-
break
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
raise last_error
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/calabash/stubs.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Stubs for Calabash. Used for example when running Cucumber's dry-run
|
2
|
-
|
3
|
-
# Page class
|
4
|
-
unless Object.const_defined?(:Calabash)
|
5
|
-
Object.const_set(:Calabash, Module.new)
|
6
|
-
end
|
7
|
-
|
8
|
-
unless Calabash.const_defined?(:Page)
|
9
|
-
Calabash.const_set(:Page, Class.new)
|
10
|
-
end
|
11
|
-
|
12
|
-
# Android module (used for pages)
|
13
|
-
unless Object.const_defined?(:Android)
|
14
|
-
Object.const_set(:Android, Module.new)
|
15
|
-
end
|
16
|
-
|
17
|
-
# IOS module (used for pages)
|
18
|
-
unless Object.const_defined?(:IOS)
|
19
|
-
Object.const_set(:IOS, Module.new)
|
20
|
-
end
|
21
|
-
|
data/lib/calabash/web.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
module Calabash
|
2
|
-
module Web
|
3
|
-
# Evaluate javascript in a Web View. On iOS, an implicit return is
|
4
|
-
# inserted, on Android an explicit return is needed.
|
5
|
-
#
|
6
|
-
# @example
|
7
|
-
# # iOS
|
8
|
-
# cal.evaluate_javascript_in("UIWebView", "2+2")
|
9
|
-
#
|
10
|
-
# # Android
|
11
|
-
# cal.evaluate_javascript_in("WebView", "return 2+2")
|
12
|
-
#
|
13
|
-
# @example
|
14
|
-
# # iOS
|
15
|
-
# cal.evaluate_javascript_in("WKWebView",
|
16
|
-
# "document.body.style.backgroundColor = 'red';")
|
17
|
-
#
|
18
|
-
# # Android
|
19
|
-
# cal.evaluate_javascript_in("XWalkContent",
|
20
|
-
# "document.body.style.backgroundColor = 'red';")
|
21
|
-
#
|
22
|
-
# @note No error will be raised if the javascript given is invalid, or
|
23
|
-
# throws an exception.
|
24
|
-
#
|
25
|
-
# @param [String, Hash, Calabash::Query] query Query that matches the
|
26
|
-
# webview
|
27
|
-
# @param [String] javascript The javascript to evaluate
|
28
|
-
#
|
29
|
-
# @raise ViewNotFoundError If no views are found matching `query`
|
30
|
-
def evaluate_javascript_in(query, javascript)
|
31
|
-
wait_for_view(query,
|
32
|
-
timeout: Calabash::Gestures::DEFAULT_GESTURE_WAIT_TIMEOUT)
|
33
|
-
|
34
|
-
_evaluate_javascript_in(query, javascript)
|
35
|
-
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
# @!visibility private
|
40
|
-
define_method(:_evaluate_javascript_in) do |query, javascript|
|
41
|
-
abstract_method!
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|