栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

运行selenium ruby​​ webdriver脚本以从命令提示符ruby窗口输出文件时如何导出结果

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

运行selenium ruby​​ webdriver脚本以从命令提示符ruby窗口输出文件时如何导出结果

我在单元框架内运行所有测试。我自己使用测试单元,但您也可以使用rspec。这也使您能够向代码中添加断言,然后由单元框架将其报告。如果一个测试失败或错误,则可以继续进行下一个测试。

我的rakefile的简化版本如下所示

require 'rake/testtask'#this will run all tests in directory with no dependencies Rake::TestTask.new do |t|  t.libs << "test"  t.test_files = FileList['FAL*.rb']  t.verbose = trueend#or you could run individual files like thistask :FAL001 do   ruby "FAL001.rb"end

每个测试用例看起来像这样

require "test-unit"gem "test-unit"require "selenium-webdriver"class FAL001 < Test::Unit::TestCase  def testFAL001 #methods that begin with test are automatically run     #selenium pre goes here     assert_true(1 == 1)  end  def test002     #another test goes here   endend


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/471004.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号