我想让我的坦诚测试套件能够重复登录。我在http://www.testingwithfrank.com/user_steps.html找到了“将应用重置为首次启动状态”:
Given /^I reset the (iphone|ipad) app$/ do |device|
steps "When I quit the simulator"
SDK = "4.3"
APPLICATIONS_DIR = "/Users/#{ENV['USER']}/Library/Application Support/iPhone Simulator/#{SDK}/Applications"
USERDEFAULTS_PLIST = "Library/Preferences/com.yourcompany.#{APPNAME}.dist.plist"
Dir.foreach(APPLICATIONS_DIR) do |item|
next if item == '.' or item == '..'
if File::exists?("#{APPLICATIONS_DIR}/#{item}/#{USERDEFAULTS_PLIST}")
FileUtils.rm "#{APPLICATIONS_DIR}/#{item}/#{USERDEFAULTS_PLIST}"
end
end
steps "Given I launch the #{device} app"
end
=。=我已将“SDK”更改为“7.1”,但似乎无效,我收到此错误:
uninitialized constant APPNAME (NameError)
=。=我检查了目录 - /Users/#{ENV['USER']}/Library/Application Support/iPhone Simulator/#{SDK}/Applications
,但我找不到
我正在测试的应用程序...我正在使用xcode6.2
任何人都可以帮我解决这个问题吗?谢谢!抱歉,我不擅长英语......