我正在使用 calabash-ios 进行测试自动化,并且在启动时努力将命令行参数传递给我的 iOS 应用程序。我不是 Ruby 程序员,但查看源代码促使我尝试将 cmd 行参数附加到 APP 路径。我在 calabash-ios 控制台中尝试了这样的事情:
start_test_server_in_background({:app => "#{ENV['APP']} -OverrideWebApp test/index.html"})
“-OverrideWebApp test/index.html”是我试图传递的 cmd 行参数。我应该使用一些特殊的键或 Hook 来将 cmd 行参数传递给我的应用程序吗?
最佳答案
要将参数传递给应用,请使用:
options = {:args => ['-com.apple.CoreData.ConcurrencyDebug', '1']}
start_test_server_in_background(options)
有关详细信息,请参阅:https://github.com/calabash/calabash-ios/issues/363
要点是传递逗号分隔的字符串列表。在你的情况下:
options = {:args => ["-OverrideWebApp", "test/index.html"]}
关于ios - 使用 Calabash-ios 将命令行参数传递给应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33249737/