惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
博客园 - 司徒正美
Last Week in AI
Last Week in AI
博客园 - 聂微东
Jina AI
Jina AI
月光博客
月光博客
爱范儿
爱范儿
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
T
Tailwind CSS Blog
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
有赞技术团队
有赞技术团队
罗磊的独立博客
小众软件
小众软件
雷峰网
雷峰网
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog

博客园 - Tachikoma

用Ruby实现 Web Service Server ,并用Ruby发送 HTTP请求 Web Service Android 使用 Ksoap2 出现的低级错误... - Tachikoma Cygwin中通过RJB在Ruby下调用ICTCLAS(JAVA) ICTCLAS4J 的编译脚本 Ruby Sandbox 实现运行客户代码 - Tachikoma Ruby在使用MongoDB时,对Cursor的重新包装 ruby 下使用 ICTCLAS(JAVA) RJB 在windows下的一些安装事项 Ruby手工测试正确,rcov测试失败的解决 在dell dimension 5150 上安装 leopard 手记 Rails测试中清空数据表/载入空fixtures RDoc 解决同名module 与 Class的问题 C 实用的 e-editor 的bundle Best of Ruby Quiz - Animal Quiz Best of Ruby Quiz - GEDCOM Parser Best of Ruby Quiz - MadLib - Tachikoma 使用selenium-on-rails的一些讨论 3]assertXpathCount的使用 使用selenium-on-rails的一些讨论 [0,1] 关于 rails ActiveRecord 属性 以及 foreign_key 不直接用数据库项目 时的一些讨论
使用selenium-on-rails的一些讨论 2]清理缓存 - Tachikoma - ...
Tachikoma · 2008-04-27 · via 博客园 - Tachikoma

2. selenium-on-rails 清理cache
并没有提供这个功能,但是在测试开始时确实需要,方案在Align书的"基于时间的缓存失效策略"里描述了,就是删除文件夹tmp/cache
这里直接清理tmp文件夹

# selenium-on-rails/lib/selenium-on-rails/paths.rb
def tmp_path
      File.expand_path File.join(RAILS_ROOT,
'tmp')
end

# selenium
-on-rails/lib/controllers/selenium-controller.rb

def tmp_clear  ## tachikoma add
    FileUtils.rm_r Dir.glob(tmp_path
+"/*")
    RAILS_DEFAULT_LOGGER.info(
"Tmp directory fully sweeped.")
    render :file 
=> view_path('tmp_clear.rhtml')
end

另外做一个tmp_clear.rhtml就可以了
在测试文件中调用

open '/selenium/tmp_clear"

就OK