【发布时间】:2016-07-21 20:20:06
【问题描述】:
一旦我按照正确的程序在被测应用上安装葫芦框架,并在使用相关定义步骤编写测试场景后,如果我通过控制台运行:
$ calabash-android console C:\..\app-unaligned.apk
$ start_test_server_in_background
应用程序在我的设备(连接到电脑)上启动没有问题。
当我在命令提示符下运行时:
$ calabash-android run C:\..\app-unaligned.apk
App 大约在 40 秒后启动,显然也是如此,因为在这个时间范围内,前两个测试场景已经离开,无法在 App 中实际启动。当 App 启动时(大约 40 秒后),其余场景(尚未启动)在 App 上正确执行。所以第一个场景失败了,剩下的通过了。
C:\..\MyApp>calabash-android run C:\..\app-unaligned.apk
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
Feature: Testing MyApp
6278 KB/s (585926 bytes in 0.091s)
6759 KB/s (5721923 bytes in 0.826s)
Background: # features/my_first.feature:3
App did not start (RuntimeError)
./features/support/app_life_cycle_hooks.rb:5:in `Before'
Given I wait # calabash-android-0.7.3/lib/calabash-android/steps/progress_steps.rb:5
Then I press on the tutorial screen # features/step_definitions/calabash_steps.rb:3
.
.
Scenario: Test One # features/my_first.feature:14
.
.
Scenario: Test two # features/my_first.feature:25
.
.
Scenario: Test three # features/my_first.feature:60
.
.
Failing Scenarios:
cucumber features/my_first.feature:14 # Scenario: Test one
cucumber features/my_first.feature:25 # Scenario: Test two
3 scenarios (2 failed, 1 passed)
56 steps (44 skipped, 12 passed)
1m12.056s
所以我想知道我是否可以将测试场景的启动延迟到移动应用程序真正启动时,以便所有测试场景都有效执行。
【问题讨论】:
标签: android delay calabash-android