如何在不重置的情况下 运行 calabash android 场景

How to run scenarios in calabash android without reset

我想要 运行 包含不同场景的功能文件。 没有每个场景后重置。

我试图通过带有 'RESET_BETWEEN_SCENARIOS' 标记的命令行 运行 此测试。

RESET_BETWEEN_SCENARIOS=0 calabash-android run

无效。

我试图取消注释('#')app_life_cycle_hooks.rb 文件中的某些行:

require 'calabash-android/management/adb'
require 'calabash-android/operations'

Before do |scenario|
 #start_test_server_in_background
end

After do |scenario|
 if scenario.failed?
 screenshot_embed
end
#shutdown_test_server
end

无效。

我试图在 app_installation_hooks.rb

中取消注释以下几行
uninstall_apps
install_app(ENV['TEST_APP_PATH'])
install_app(ENV['APP_PATH'])

无效。

知道了。

我在 app_installation_hooks.rb

中删除了(通过评论)这一行
uninstall_apps

和 app_life_cycle_hooks.rb

中的这一行
start_test_server_in_background
shutdown_test_server

我在 /start_server.rb 中创建了一个文件 step_definitions 定义了一个自定义步骤:

Given /^I started the server$/ do
 start_test_server_in_background
end

我在第一个场景中使用的

Scenario: S1
Given I started the server
...

我 运行 这是我的 .sh 脚本(在 shell 中),包括 运行 语句

calabash-android run PATH_TO_APK