最新文章列表

capybara 定位最后一个元素

使用find可以定位第一个元素: find("table a i.fa-edit", match: :first) 我们有的时候需要定位最后一个或者第几个元素,可以使用 all,例如 all("table a i.fa-edit").last
zhangcaiyanbeyond 评论(0) 有382人浏览 2018-11-17 17:22

capybara & Rspec-1

  Rspec基本操作 1. let 设置变量 2. subject 定义测试对象 3. before 在执行测试用例it之前的操作   require 'spec_helper' describe "StaticPages" do let(:base_title) {"Ruby on Rails Tutorial Sample App&qu ...
michael_roshen 评论(0) 有481人浏览 2013-05-05 01:33

Rails自动化测试框架参考列表

最近在看Rails当前比较流行了的自动化测试框架,初步确定了下面几个东西。分别整理了相关DSL的用法参考列表: rspec http://cheat.errtheblog.com/s/rspec/ capybara https://gist.github.com/428105 factory_girl https://github.com/thoughtbot/factory_girl/blob ...
zjueman 评论(0) 有895人浏览 2012-06-02 09:27

Cucumber Capybara Selenium 如何触发一个dom的点击事件

就是 click_on 和 Press 只能针对button和link如果,有个页面元素是,javascript绑定的怎么触发 page.execute_script("$('#{css_selector}').trigger('click')") page.find('#element').trigger(:mouseover) page.execute_script( ...
夜鸣猪 评论(0) 有2668人浏览 2012-04-06 12:50

让 capybara 通过 selenium 运行所有rspec 测试用例

rspec2 selenium ,capybara 默认配置下只会运行一个it 测试用例,要想让 capybara 通过selenium 运行所有测试用例,( make Capybara run all your tests in Selenium by setting)则需在 spec/spec_helper.rb 中设置: Capybara.default_driver = :seleniu ...
pobing 评论(0) 有1672人浏览 2012-03-21 11:00

关于capybara ,rspec 测试rails3.2不能渲染view 的问题

https://www.relishapp.com/rspec/rspec-rails/v/2-8/docs/controller-specs/render-views http://stackoverflow.com/questions/4706370/rspec-view-testing-with-capybara-and-rails3/4773050#4773050# http://blog ...
pobing 评论(0) 有893人浏览 2012-03-15 13:56

脱离rails环境单独使用capybara以及使用capybara测试拖放

require 'rubygems' require 'capybara' require 'capybara/dsl' Capybara.run_server = false Capybara.current_driver = :selenium Capybara.app_host = 'http://www.google.com' module MyCapybaraTes ...
夜鸣猪 评论(0) 有3460人浏览 2012-01-17 12:49

Rspec Test

模拟浏览器,人工测试 http://hlee.iteye.com/blog/768459 1. 文本框填充:    直接填充   :     fill_in("#{@user.id}_name",:with=>"jdo")    通过节点赋值 :   find(:xpath,"//html/body/div[2]/div[2]/di ...
pobing 评论(0) 有947人浏览 2011-07-12 13:10

在view spec中用Capybara.string的结果替代rendered(Capybara版本0.4.12)

问题关键字:undefined method `has_selector?' for #<String:0x1034ecfb0> 版本: Capybara(0.4.12) RSpec-Rails(2.5.0) 补充:刚试了一下最新版本的RSpec-Rails2.6.0.rc6和Capybara1.0.0.beta1,已经把这个问题给解决了…… google一番后: https:// ...
yuan 评论(1) 有1566人浏览 2011-05-10 10:12

最近博客热门TAG

Java(141744) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54919) .net(54785) Web(54514) 工作(54118) Linux(50905) Oracle(49875) 应用服务器(43289) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37267) 数据结构(36424)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics