我有一个类似
的应用安装挂钩文件 require 'calabash-android/management/app_installation'
AfterConfiguration do |config|
FeatureNameMemory.feature_name = nil
end
Before do |scenario|
@scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
if @scenario_is_outline
scenario = scenario.scenario_outline
end
feature_name = scenario.feature.title
if FeatureNameMemory.feature_name != feature_name \
or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
log "New scenario - reinstalling apps"
else
log "First scenario in feature - reinstalling apps"
end
uninstall_apps
install_app(ENV["TEST_APP_PATH"])
install_app(ENV["APP_PATH"])
FeatureNameMemory.feature_name = feature_name
FeatureNameMemory.invocation = 1
else
FeatureNameMemory.invocation += 1
end
end
FeatureNameMemory = Class.new
class << FeatureNameMemory
@feature_name = nil
attr_accessor :feature_name, :invocation
end
这里将重新安装每个功能的应用程序。但我希望应用程序只安装一次, 所以如何更改此文件。
答案 0 :(得分:0)
我在calabash-android google组中找到了这个帖子,听起来就像你要求的那样。
它说删除这3行 uninstall_apps install_app(ENV [ “TEST_APP_PATH”]) install_app(ENV [ “APP_PATH”])
然后确保在开始测试时安装应用程序。
有关完整帖子,请参阅此链接 https://groups.google.com/forum/#!topic/calabash-android/Ql3iluRMijg Preeti Jindal的回复。