calabash-android 0.4.22.pre4 → 0.5.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/bin/calabash-android +66 -45
  3. data/lib/calabash-android/calabash_steps.rb +0 -8
  4. data/lib/calabash-android/canned_steps.md +2 -30
  5. data/lib/calabash-android/lib/TestServer.apk +0 -0
  6. data/lib/calabash-android/operations.rb +199 -23
  7. data/lib/calabash-android/removed_actions.txt +52 -0
  8. data/lib/calabash-android/steps/assert_steps.rb +9 -24
  9. data/lib/calabash-android/steps/check_box_steps.rb +2 -2
  10. data/lib/calabash-android/steps/context_menu_steps.rb +11 -4
  11. data/lib/calabash-android/steps/date_picker_steps.rb +2 -2
  12. data/lib/calabash-android/steps/enter_text_steps.rb +13 -13
  13. data/lib/calabash-android/steps/l10n_steps.rb +5 -5
  14. data/lib/calabash-android/steps/map_steps.rb +12 -12
  15. data/lib/calabash-android/steps/navigation_steps.rb +12 -12
  16. data/lib/calabash-android/steps/press_button_steps.rb +16 -12
  17. data/lib/calabash-android/steps/progress_steps.rb +19 -22
  18. data/lib/calabash-android/steps/search_steps.rb +2 -2
  19. data/lib/calabash-android/steps/spinner_steps.rb +10 -2
  20. data/lib/calabash-android/steps/time_picker_steps.rb +2 -2
  21. data/lib/calabash-android/version.rb +1 -1
  22. data/lib/calabash-android/wait_helpers.rb +29 -1
  23. data/test-server/instrumentation-backend/antlr/UIQuery.g +11 -11
  24. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/CalabashInstrumentationTestRunner.java +3 -2
  25. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/InstrumentationBackend.java +9 -4
  26. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/Result.java +16 -12
  27. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/application/Backdoor.java +55 -0
  28. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/LongPressCoordinate.java +19 -2
  29. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/JavaScriptExecuter.java +105 -0
  30. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/QueryHelper.java +27 -30
  31. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ViewMapper.java +27 -18
  32. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/ComparisonOperator.java +7 -1
  33. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTPredicate.java +16 -4
  34. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryASTWith.java +13 -6
  35. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/ast/UIQueryUtils.java +94 -48
  36. metadata +5 -59
  37. data/lib/calabash-android/steps/additions_manual_steps.rb +0 -11
  38. data/lib/calabash-android/steps/app_steps.rb +0 -10
  39. data/lib/calabash-android/steps/list_steps.rb +0 -41
  40. data/lib/calabash-android/steps/rotation_steps.rb +0 -7
  41. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressButtonNumber.java +0 -22
  42. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressButtonText.java +0 -27
  43. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressImageButtonDescription.java +0 -39
  44. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressImageButtonNumber.java +0 -22
  45. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/WaitForButton.java +0 -47
  46. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/checkbox/ToggleCheckboxNumber.java +0 -22
  47. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressText.java +0 -22
  48. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressTextAndSelectFromMenuById.java +0 -26
  49. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressTextAndSelectFromMenuByIndex.java +0 -22
  50. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressTextAndSelectFromMenuByText.java +0 -26
  51. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/helpers/InspectCurrentDialog.java +0 -76
  52. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/GetListData.java +0 -85
  53. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/GetListItemProperties.java +0 -194
  54. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/GetListItemText.java +0 -136
  55. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/LongPressListItems.java +0 -22
  56. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/PressListItems.java +0 -22
  57. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/scrolling/ScrollDown.java +0 -22
  58. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/scrolling/ScrollUp.java +0 -22
  59. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/search/EnterQueryByIndex.java +0 -29
  60. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/SelectFromMenuByText.java +0 -24
  61. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/spinner/GetSelectedSpinnerItemText.java +0 -36
  62. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/spinner/SelectSpinnerItemByContentDescription.java +0 -43
  63. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/AssertGridViewContainsNoDuplicates.java +0 -72
  64. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/AssertText.java +0 -31
  65. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/AssertTextOfSpecificTextViewByContentDescription.java +0 -32
  66. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextById.java +0 -30
  67. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextByIndex.java +0 -22
  68. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java +0 -33
  69. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClickOnText.java +0 -22
  70. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/EnterTextByContentDescription.java +0 -32
  71. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/EnterTextById.java +0 -33
  72. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/EnterTextByIndex.java +0 -22
  73. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/GetTextById.java +0 -42
  74. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/AssertViewProperty.java +0 -141
  75. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/ClickOnViewByDescription.java +0 -46
  76. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/ClickOnViewById.java +0 -56
  77. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/GetViewProperty.java +0 -101
  78. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/HasView.java +0 -31
  79. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/IsEnabled.java +0 -30
  80. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/LongPressOnViewById.java +0 -34
  81. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/Press.java +0 -89
  82. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/SelectTab.java +0 -110
  83. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/Wait.java +0 -24
  84. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForDialogClose.java +0 -21
  85. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForProgress.java +0 -47
  86. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForScreen.java +0 -54
  87. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForTab.java +0 -108
  88. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForText.java +0 -37
  89. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForView.java +0 -43
  90. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForViewById.java +0 -58
  91. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/JavaScriptOperation.java +0 -44
  92. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/PressByCssSelector.java +0 -70
  93. data/test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetText.java +0 -64
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.4.22.pre4
4
+ version: 0.5.0.pre1
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: 2014-04-07 00:00:00.000000000 Z
11
+ date: 2014-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -182,21 +182,18 @@ files:
182
182
  - lib/calabash-android/management/adb.rb
183
183
  - lib/calabash-android/management/app_installation.rb
184
184
  - lib/calabash-android/operations.rb
185
- - lib/calabash-android/steps/additions_manual_steps.rb
186
- - lib/calabash-android/steps/app_steps.rb
185
+ - lib/calabash-android/removed_actions.txt
187
186
  - lib/calabash-android/steps/assert_steps.rb
188
187
  - lib/calabash-android/steps/check_box_steps.rb
189
188
  - lib/calabash-android/steps/context_menu_steps.rb
190
189
  - lib/calabash-android/steps/date_picker_steps.rb
191
190
  - lib/calabash-android/steps/enter_text_steps.rb
192
191
  - lib/calabash-android/steps/l10n_steps.rb
193
- - lib/calabash-android/steps/list_steps.rb
194
192
  - lib/calabash-android/steps/location_steps.rb
195
193
  - lib/calabash-android/steps/map_steps.rb
196
194
  - lib/calabash-android/steps/navigation_steps.rb
197
195
  - lib/calabash-android/steps/press_button_steps.rb
198
196
  - lib/calabash-android/steps/progress_steps.rb
199
- - lib/calabash-android/steps/rotation_steps.rb
200
197
  - lib/calabash-android/steps/screenshot_steps.rb
201
198
  - lib/calabash-android/steps/search_steps.rb
202
199
  - lib/calabash-android/steps/spinner_steps.rb
@@ -333,16 +330,7 @@ files:
333
330
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/ViewDump.java
334
331
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/activity/FinishOpenedActivities.java
335
332
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/activity/SetActivityOrientation.java
336
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressButtonNumber.java
337
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressButtonText.java
338
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressImageButtonDescription.java
339
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/PressImageButtonNumber.java
340
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/button/WaitForButton.java
341
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/checkbox/ToggleCheckboxNumber.java
342
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressText.java
343
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressTextAndSelectFromMenuById.java
344
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressTextAndSelectFromMenuByIndex.java
345
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/contextmenu/LongPressTextAndSelectFromMenuByText.java
333
+ - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/application/Backdoor.java
346
334
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/ClickOnScreen.java
347
335
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/DoubleTapCoordinate.java
348
336
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Drag.java
@@ -350,16 +338,10 @@ files:
350
338
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/LongPressCoordinate.java
351
339
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
352
340
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/TouchCoordinates.java
353
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/helpers/InspectCurrentDialog.java
354
341
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/helpers/ListActions.java
355
342
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/L10nHelper.java
356
343
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/PressElement.java
357
344
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/l10n/WaitForElement.java
358
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/GetListData.java
359
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/GetListItemProperties.java
360
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/GetListItemText.java
361
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/LongPressListItems.java
362
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/list/PressListItems.java
363
345
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/location/FakeGPSLocation.java
364
346
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/map/GetMapBounds.java
365
347
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/map/GetMapCenter.java
@@ -375,55 +357,21 @@ files:
375
357
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/preferences/GetPreferences.java
376
358
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/preferences/PreferencesUtils.java
377
359
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/preferences/SetPreferences.java
378
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/scrolling/ScrollDown.java
379
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/scrolling/ScrollUp.java
380
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/search/EnterQueryByIndex.java
381
360
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/DownKey.java
382
361
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/EnterKey.java
383
362
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/GoBack.java
384
363
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/LeftKey.java
385
364
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/PressMenu.java
386
365
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/RightKey.java
387
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/SelectFromMenuByText.java
388
366
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/softkey/UpKey.java
389
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/spinner/GetSelectedSpinnerItemText.java
390
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/spinner/SelectSpinnerItemByContentDescription.java
391
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/AssertGridViewContainsNoDuplicates.java
392
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/AssertText.java
393
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/AssertTextOfSpecificTextViewByContentDescription.java
394
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextById.java
395
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextByIndex.java
396
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClearTextFieldByContentDescription.java
397
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/ClickOnText.java
398
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/EnterTextByContentDescription.java
399
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/EnterTextById.java
400
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/EnterTextByIndex.java
401
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/GetTextById.java
402
367
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/text/KeyboardEnterText.java
403
368
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetDateByContentDescription.java
404
369
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetDateByIndex.java
405
370
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByContentDescription.java
406
371
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/time/SetTimeByIndex.java
407
372
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/version/Version.java
408
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/AssertViewProperty.java
409
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/ClickOnViewByDescription.java
410
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/ClickOnViewById.java
411
373
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/GetActivityName.java
412
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/GetViewProperty.java
413
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/HasView.java
414
374
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/IsCurrentActivityFocused.java
415
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/IsEnabled.java
416
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/LongPressOnViewById.java
417
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/Press.java
418
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/view/SelectTab.java
419
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/Wait.java
420
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForDialogClose.java
421
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForProgress.java
422
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForScreen.java
423
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForTab.java
424
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForText.java
425
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForView.java
426
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/wait/WaitForViewById.java
427
375
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/CalabashChromeClient.java
428
376
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpBodyHtml.java
429
377
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
@@ -432,12 +380,10 @@ files:
432
380
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/ExecuteJavascript.java
433
381
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/GetLoadProgress.java
434
382
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/GetUrl.java
435
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/JavaScriptOperation.java
436
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/PressByCssSelector.java
383
+ - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/JavaScriptExecuter.java
437
384
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/QueryHelper.java
438
385
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/ScrollTo.java
439
386
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetPropertyByCssSelector.java
440
- - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/SetText.java
441
387
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/UnableToFindChromeClientException.java
442
388
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/json/JSONUtils.java
443
389
  - test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/query/CompletedFuture.java
@@ -1,11 +0,0 @@
1
- Then /^I compare the current screen with the reference image "([^\"]*)" manually$/ do |name|
2
- # TODO: once test artifacts directory is configurable, the image location
3
- # will need to be either a fully qualified path somewhere (webserver?) or
4
- # be relative to the output HTML file
5
- raise Exception, "Reference image not found: #{name}" if !File.exists?(name)
6
- embed(name, 'image/png', name)
7
- end
8
-
9
- Then /^I manually (.*)$/ do |action|
10
- # Do nothing
11
- end
@@ -1,10 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- Given /^My app is running$/ do
3
- # rotate_phone(0)
4
- end
5
-
6
- Given /^my app is running$/ do
7
- # rotate_phone(0)
8
- end
9
-
10
-
@@ -1,41 +0,0 @@
1
- # By default "get_list_item_text" returns an array of arrays of text for each entry in the first ListView
2
- # The "get_list_item_text" action also supports:
3
- # (all items of 2nd list) <code>performAction( 'get_list_item_text', '2' )</code>
4
- # (1st item of 2nd list) <code>performAction( 'get_list_item_text', '2' , '1' )</code>
5
- Then /^I should see following list:$/ do | expected_table |
6
- result = performAction('get_list_item_text')
7
- response_table = result['bonusInformation']
8
- response_table_array = []
9
- response_table.each do | row_data|
10
- row_data = JSON.parse( row_data )
11
- tmpArray = [row_data.values.first]
12
- response_table_array.push(tmpArray)
13
- end
14
- expected_table.diff!(response_table_array)
15
- end
16
-
17
- # Note: This step is currently intended as more of an example rather than a rock-solid, well-tested step.
18
- # (The server implementation works well for me, but my test steps that use it are application-specific)
19
- # Similarly to the "get_list_item_text" action, the "get_list_item_properties" action defaults to
20
- # all rows of the first ListView, but can be instructed to target a specific row (or all rows) of a specific ListView.
21
- # Example TextView row: {"id":"title", "text":"My Title", "color":0, "background":0, "compoundDrawables":["left"]}
22
- # Example ViewGroup row: {"children":[{"id":"title", "text":"My Title"}, {"id":"subtitle", "text":"Second line"}]}
23
- # Example TableLayout row: {"cells":[{"column":0, "id":"colA", "text": "This is a Test"}]}
24
- Then /^The "([^\"]*)" for row (\d+) should be "([^\"]*)"$/ do | view_id, row, value |
25
- response = performAction( 'get_list_item_properties', '1' , row )['bonusInformation']
26
- response = JSON.parse( response[0] )
27
-
28
- if( response['children'] )
29
- found_id = false
30
- response['children'].each do | view |
31
- if( view['id'] == view_id )
32
- raise "Text is #{view['text']}, expected #{value}" unless( view['text'] == value )
33
- found_id = true
34
- end
35
- end
36
- raise "Could not find view with ID: #{view_id}" unless( found_id )
37
- else
38
- raise "ID is #{response['id']}, expected #{view_id}" unless( response['id'] == view_id )
39
- raise "Text is #{response['text']}, expected #{view_id}" unless( response['text'] == value )
40
- end
41
- end
@@ -1,7 +0,0 @@
1
- Then /^I rotate the device to landscape$/ do
2
- rotate_phone(90)
3
- end
4
-
5
- Then /^I rotate the device to portrait$/ do
6
- rotate_phone(0)
7
- end
@@ -1,22 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.button;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.actions.Action;
7
-
8
-
9
- public class PressButtonNumber implements Action {
10
-
11
- @Override
12
- public Result execute(String... args) {
13
- InstrumentationBackend.solo.clickOnButton(Integer.parseInt(args[0]) - 1);
14
- return Result.successResult();
15
- }
16
-
17
- @Override
18
- public String key() {
19
- return "press_button_number";
20
- }
21
-
22
- }
@@ -1,27 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.button;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.actions.Action;
7
- import android.widget.Button;
8
-
9
-
10
- public class PressButtonText implements Action {
11
-
12
- @Override
13
- public Result execute(String... args) {
14
- InstrumentationBackend.solo.searchButton(args[0]);
15
- for (Button b : InstrumentationBackend.solo.getCurrentViews(Button.class))
16
- System.out.println("Button text: " + b.getText());
17
- InstrumentationBackend.solo.clickOnButton(args[0]);
18
- return Result.successResult();
19
- }
20
-
21
- @Override
22
- public String key() {
23
- return "press_button_with_text";
24
- }
25
-
26
- }
27
-
@@ -1,39 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.button;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.actions.Action;
7
- import android.widget.ImageButton;
8
-
9
-
10
- public class PressImageButtonDescription implements Action {
11
-
12
- @Override
13
- public Result execute(String... args) {
14
- String err = "No image button found with description "+args[0]+" found. Found only:";
15
- int index = 0;
16
- if (args.length == 2) {
17
- index = Integer.parseInt(args[1]);
18
- }
19
-
20
- int count = 0;
21
- for (ImageButton b : InstrumentationBackend.solo.getCurrentViews(ImageButton.class)){
22
- err += " "+ b.getContentDescription();
23
- if (args[0].equals(b.getContentDescription())){
24
- if (count == index) {
25
- InstrumentationBackend.solo.clickOnView(b);
26
- return Result.successResult();
27
- }
28
- count++;
29
- }
30
- }
31
- return new Result(false, err);
32
- }
33
-
34
- @Override
35
- public String key() {
36
- return "press_image_button_description";
37
- }
38
-
39
- }
@@ -1,22 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.button;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.actions.Action;
7
-
8
-
9
- public class PressImageButtonNumber implements Action {
10
-
11
- @Override
12
- public Result execute(String... args) {
13
- InstrumentationBackend.solo.clickOnImageButton(Integer.parseInt(args[0]) - 1);
14
- return Result.successResult();
15
- }
16
-
17
- @Override
18
- public String key() {
19
- return "press_image_button_number";
20
- }
21
-
22
- }
@@ -1,47 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.button;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.TestHelpers;
7
- import sh.calaba.instrumentationbackend.actions.Action;
8
- import android.view.View;
9
- import android.widget.Button;
10
- import android.widget.ImageButton;
11
-
12
-
13
- public class WaitForButton implements Action {
14
-
15
- @Override
16
- public Result execute(String... args) {
17
- String text = args[0];
18
- long endTime = System.currentTimeMillis() + 60000;
19
- while (System.currentTimeMillis() < endTime) {
20
- if (InstrumentationBackend.solo.searchButton(text) || searchForButtonWithContentDescription(text)) {
21
- return Result.successResult();
22
- } else {
23
- try {
24
- Thread.sleep(500);
25
- } catch (InterruptedException e) {
26
- return Result.fromThrowable(e);
27
- }
28
- }
29
- }
30
- return new Result(false, "Timed out while waiting for button with text or contentDescription:'" + text + "'");
31
- }
32
-
33
- @Override
34
- public String key() {
35
- return "wait_for_button";
36
- }
37
-
38
- private boolean searchForButtonWithContentDescription(String description) {
39
- View view = TestHelpers.getViewByDescription(description);
40
- if (view != null && (view instanceof Button || view instanceof ImageButton)) {
41
- return true;
42
- } else {
43
- return false;
44
- }
45
- }
46
-
47
- }
@@ -1,22 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.checkbox;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.actions.Action;
7
-
8
-
9
- public class ToggleCheckboxNumber implements Action {
10
-
11
- @Override
12
- public Result execute(String... args) {
13
- InstrumentationBackend.solo.clickOnCheckBox(Integer.parseInt(args[0]) - 1);
14
- return Result.successResult();
15
- }
16
-
17
- @Override
18
- public String key() {
19
- return "toggle_numbered_checkbox";
20
- }
21
-
22
- }
@@ -1,22 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.contextmenu;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.actions.Action;
7
-
8
-
9
- public class LongPressText implements Action {
10
-
11
- @Override
12
- public Result execute(String... args) {
13
- InstrumentationBackend.solo.clickLongOnText(args[0]);
14
- return Result.successResult();
15
- }
16
-
17
- @Override
18
- public String key() {
19
- return "press_long_on_text";
20
- }
21
-
22
- }
@@ -1,26 +0,0 @@
1
- package sh.calaba.instrumentationbackend.actions.contextmenu;
2
-
3
-
4
- import sh.calaba.instrumentationbackend.InstrumentationBackend;
5
- import sh.calaba.instrumentationbackend.Result;
6
- import sh.calaba.instrumentationbackend.TestHelpers;
7
- import sh.calaba.instrumentationbackend.actions.Action;
8
-
9
-
10
- public class LongPressTextAndSelectFromMenuById implements Action {
11
-
12
- @Override
13
- public Result execute(String... args) {
14
- InstrumentationBackend.solo.clickLongOnText(args[0]);
15
- TestHelpers.wait(1);
16
- InstrumentationBackend.solo.clickOnText(args[1]);
17
-
18
- return Result.successResult();
19
- }
20
-
21
- @Override
22
- public String key() {
23
- return "press_long_on_text_and_select_with_id";
24
- }
25
-
26
- }