calabash 2.0.0.pre11 → 2.0.0.prelegacy

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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -5
  3. data/bin/calabash +4 -3
  4. data/lib/calabash/android/adb.rb +37 -34
  5. data/lib/calabash/android/application.rb +1 -1
  6. data/lib/calabash/android/build/builder.rb +1 -1
  7. data/lib/calabash/android/build/java_keystore.rb +1 -1
  8. data/lib/calabash/android/build/resigner.rb +1 -1
  9. data/lib/calabash/android/device.rb +46 -204
  10. data/lib/calabash/android/environment.rb +1 -14
  11. data/lib/calabash/android/gestures.rb +22 -6
  12. data/lib/calabash/android/interactions.rb +17 -14
  13. data/lib/calabash/android/legacy.rb +141 -4
  14. data/lib/calabash/android/lib/.irbrc +1 -9
  15. data/lib/calabash/android/lib/AndroidManifest.xml +2 -23
  16. data/lib/calabash/android/lib/TestServer.apk +0 -0
  17. data/lib/calabash/android/life_cycle.rb +3 -3
  18. data/lib/calabash/android/orientation.rb +8 -8
  19. data/lib/calabash/android/physical_buttons.rb +16 -19
  20. data/lib/calabash/android/server.rb +1 -6
  21. data/lib/calabash/android/text.rb +12 -12
  22. data/lib/calabash/android.rb +26 -92
  23. data/lib/calabash/application.rb +0 -3
  24. data/lib/calabash/cli/generate.rb +18 -8
  25. data/lib/calabash/cli/helpers.rb +9 -4
  26. data/lib/calabash/cli/run.rb +1 -1
  27. data/lib/calabash/console_helpers.rb +11 -179
  28. data/lib/calabash/device.rb +19 -4
  29. data/lib/calabash/gestures.rb +198 -292
  30. data/lib/calabash/http/retriable_client.rb +3 -18
  31. data/lib/calabash/http.rb +0 -1
  32. data/lib/calabash/interactions.rb +40 -3
  33. data/lib/calabash/ios/conditions.rb +1 -1
  34. data/lib/calabash/ios/console_helpers.rb +2 -2
  35. data/lib/calabash/ios/date_picker.rb +8 -10
  36. data/lib/calabash/ios/device/device_implementation.rb +21 -9
  37. data/lib/calabash/ios/device/gestures_mixin.rb +55 -53
  38. data/lib/calabash/ios/device/keyboard_mixin.rb +0 -21
  39. data/lib/calabash/ios/device/rotation_mixin.rb +65 -3
  40. data/lib/calabash/ios/device/text_mixin.rb +21 -0
  41. data/lib/calabash/ios/device.rb +1 -0
  42. data/lib/calabash/ios/gestures.rb +90 -24
  43. data/lib/calabash/ios/interactions.rb +6 -1
  44. data/lib/calabash/ios/lib/.irbrc +2 -9
  45. data/lib/calabash/ios/orientation.rb +8 -8
  46. data/lib/calabash/ios/runtime.rb +14 -14
  47. data/lib/calabash/ios/scroll.rb +17 -25
  48. data/lib/calabash/ios/slider.rb +18 -11
  49. data/lib/calabash/ios/text.rb +74 -20
  50. data/lib/calabash/ios/uia.rb +1 -1
  51. data/lib/calabash/ios.rb +16 -77
  52. data/lib/calabash/legacy.rb +6 -9
  53. data/lib/calabash/lib/skeleton/{Gemfile.skeleton → Gemfile} +0 -0
  54. data/lib/calabash/lib/skeleton/config/{cucumber.yml.skeleton → cucumber.yml} +0 -0
  55. data/lib/calabash/lib/skeleton/features/{sample.feature.skeleton → sample.feature} +0 -0
  56. data/lib/calabash/lib/skeleton/features/step_definitions/{sample_steps.rb.skeleton → calabash_steps.rb} +8 -8
  57. data/lib/calabash/lib/skeleton/features/support/{dry_run.rb.skeleton → dry_run.rb} +5 -2
  58. data/lib/calabash/lib/skeleton/features/support/{env.rb.skeleton → env.rb} +8 -2
  59. data/lib/calabash/lib/skeleton/features/support/hooks.rb +83 -0
  60. data/lib/calabash/life_cycle.rb +8 -16
  61. data/lib/calabash/location.rb +15 -14
  62. data/lib/calabash/orientation.rb +8 -8
  63. data/lib/calabash/page.rb +4 -1
  64. data/lib/calabash/screenshot.rb +3 -3
  65. data/lib/calabash/text.rb +19 -31
  66. data/lib/calabash/utility.rb +8 -41
  67. data/lib/calabash/version.rb +1 -1
  68. data/lib/calabash/wait.rb +192 -177
  69. data/lib/calabash.rb +10 -53
  70. metadata +32 -43
  71. data/lib/calabash/android/device/helper_application.rb +0 -95
  72. data/lib/calabash/android/lib/HelperApplication.apk +0 -0
  73. data/lib/calabash/android/lib/HelperApplicationTestServer.apk +0 -0
  74. data/lib/calabash/android/web.rb +0 -12
  75. data/lib/calabash/http/forwarding_client.rb +0 -23
  76. data/lib/calabash/internal.rb +0 -48
  77. data/lib/calabash/ios/automator/automator.rb +0 -217
  78. data/lib/calabash/ios/automator/coordinates.rb +0 -37
  79. data/lib/calabash/ios/automator/device_agent.rb +0 -379
  80. data/lib/calabash/ios/automator.rb +0 -9
  81. data/lib/calabash/ios/legacy.rb +0 -6
  82. data/lib/calabash/ios/web.rb +0 -10
  83. data/lib/calabash/lib/skeleton/features/support/hooks.rb.skeleton +0 -34
  84. data/lib/calabash/retry.rb +0 -33
  85. data/lib/calabash/stubs.rb +0 -21
  86. data/lib/calabash/web.rb +0 -44
@@ -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
@@ -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