一旦我按照正确的程序在被测试的App上安装calabash框架,并在用相关的定义步骤编写测试场景后,如果我通过控制台运行:
$ calabash-android console C:\..\app-unaligned.apk
$ start_test_server_in_background
应用程序在我的设备上启动没有问题(连接到电脑)。
相反,当我在命令提示符下运行时:
$ calabash-android run C:\..\app-unaligned.apk
应用程序在大约40秒后启动,显然也是如此,因为在这个时间范围内,前两个测试场景已经离开,而无法在应用程序中实际启动。然后应用程序启动(大约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
所以我想知道是否可以延迟测试场景的开始,直到移动版上的应用程序真正启动,以便所有测试场景都得到有效执行。
答案 0 :(得分:0)
使用此空步骤。
特征:
Given App is running
step_definition:
Given(/^App is running$/) do
end
对我来说这项工作。