我有一台Android设备连接到我的电脑。 运行蠡测试我使用下面的命令:葫芦保存登录凭据
calabash-android run <NAME>.apk features/<NAME>.feature
我每次运行此再次我也有,因为没有存储的凭据重新登录到我的应用程序。
任何帮助,将不胜感激!
谢谢!
我有一台Android设备连接到我的电脑。 运行蠡测试我使用下面的命令:葫芦保存登录凭据
calabash-android run <NAME>.apk features/<NAME>.feature
我每次运行此再次我也有,因为没有存储的凭据重新登录到我的应用程序。
任何帮助,将不胜感激!
谢谢!
当应用程序重新安装时,很有可能是凭据未被存储,因为它们已被擦除。一旦你重新安装这些测试关闭它应该没问题。
Whever运行
calabash-android run <NAME>.apk features/<NAME>.feature
你以前的应用程序将被卸载&新的应用程序将被安装。
但是,您可以尝试使用
处理这种情况看看
features/support/app_installation_hooks.rb
您可以删除整个
"Before scenario" hook
,因为所有需要的护理是重新安装的测试应用程序和测试应用程序。您可以删除该代码并重试。
你能避免,如果你改变你的app_life_cycle_hooks.rb以这种方式重新安装应用程序在每次执行测试时间:
Before do |scenario|
scenario_tags = scenario.source_tag_names
if scenario_tags.include?('@first')
if scenario_tags.include?('@reinstall')
uninstall_apps
install_app(ENV['TEST_APP_PATH'])
install_app(ENV['APP_PATH'])
end
start_test_server_in_background
end
end
现在,你可以使用标签在你的情况来决定何时start_test_server_in_background以及何时重新安装应用程序。例如,你可以这样做:
@first @reinstall @test1
Scenario: Run application reinstalling the app
Given lorem ipsum
When lorem ipsum
Then lorem ipsum
@first @test2
Scenario: Run application WITHOUT reinstalling the app
Given lorem ipsum
When lorem ipsum
Then lorem ipsum
@test1 @test2
Scenario: Other scenario without relaunching app
Given lorem ipsum
When lorem ipsum
Then lorem ipsum
如果启动与@ test1的标签测试,蠡将执行方案1和方案3,和应用程序将被重新安装。如果您使用@ test2标签启动,则情景2和3将在无需重新安装应用程序的情况下启动。
真的!不擦拭它被存储。 – lony