豚专题提供豚的最新资讯内容,帮你更好的了解豚。
在RSpec我可以使用这样的代码切换到弹出窗口, link,我怎么能在Cucumber步骤中做这样的事情? login_window = page.driver.find_window('PPA_identity_window') main_window = page.driver.find_window('') # We use this to execute the next
使用黄瓜和水豚,有没有办法验证字符串不存在于页面上? 例如,我如何写这个步骤的相反: Then /^I should see "(.*?)"$/ do |arg1| page.should have_content(arg1) end 如果arg1存在,则通过. 如果找到arg1,我将如何编写失败的步骤? http://rubydoc.info/github/jnicklas/capybara
我正在执行一个懒惰的登录功能.我的黄瓜功能应该描述它: Feature: User log in Scenario: Lazy login Given I didn't log out the last time I was on the site When I go to the homepage Then
有一天,我在公司展示了一些我在黄瓜中编写的测试(2个功能,5个场景). 然后他问我不能回答的问题: How is this better than selenium or any other functionality test recording tool? 我知道黄瓜是一种不同的技术,它被放置在不同的测试水平上,但是我不明白为什么我应该打扰写和维护黄瓜/水豚测试. 有人可以给我一个合理的解释,
我正在使用黄瓜和水豚.在rails 3.0.9平台上.我得到这个测试案例失败: 日志是: (::) failed steps (::) No route matches "/wiki/Baltimore_Ravens" (ActionController::RoutingError) <internal:prelude>:10:in `synchronize' ./features/step_d
我需要检查一些内容是否存在于特定类型的选择器的页面上.例如,假设我有以下 HTML: <h2>HEADLINE ONE</h2> <h2>HEADLINE TWO</h2> 我知道如何仅在页面上选择第一个: find('h2').should have_content('Headline Two') # have_content is also case insensitive 我如何检查页面上
Given I have a rails app And I'm using cucumber And I'm using capybara And I have an action that results in a redirect_to "http://some.other.domain.com/some_path" When I test this action Then the in-a
Chrome版本:59.0.3071.104 使用Cucumber,Capybara,Selenium实现无头Chrome的自动化测试. features/support/env.rb require 'rubygems' require 'capybara/cucumber' Capybara.register_driver :selenium_chrome do |app| Capyba
背景: 我有一组针对我的Rails 3应用程序运行的Capybara集成测试.对于测试套件的其他部分,我正在使用Rspec. 我的Mac OSX开发机器上有一个selenium 2.6.0独立服务器集线器. java -jar selenium-server-standalone-2.6.0.jar -role hub 我正在运行几个虚拟机,每个虚拟机都与一个selenium节点连接到集线器: j
我正在尝试为黄瓜和水豚的新rails 3应用程序设置集成/验收测试. (我最初计划使用webrat,但它似乎不支持rails 3,所以我最终使用了capybara) 我正在尝试进行基本的登录测试: Feature: Login user In order to access the non-public parts of the site, as a user, I want to l
使用rspec和capybara处理新的Rails 3.2.9应用程序. 我在Gemfile中有以下内容: gem 'rspec-rails' gem 'capybara' 以及spec / spec_helper.rb中的以下内容: require 'rspec/rails' require 'capybara/rspec' 并在spec / requests / asdf_spec.rb中:
我比 Java和Capybara以及SitePrism更熟悉Java和Selenium,所以如果这个问题比较厚,我会道歉. Selenium有一个非常有用的类来管理Select标签Selenium::WebDriver::Support::Select,它可以通过传递代表select的Selenium Element(Selenium::WebDriver::Element)来创建.我想得到一个S
我试图用Capybara点击图像进行黄瓜测试,但找不到让Capybara将图像看作链接的方法. 我的图像代码是: link_to(image_tag('ico_edit_16.png', alt: 'Edit', class: 'icon16', title: "Edit #{qualification.title}"), edit_qualification_path(qualification
当我使用(使用:selenium驱动程序)多个浏览器与Capybara来测试我的前端时,我有一种情况.当我们不需要时,我如何关闭其中的一些呢? 如果使用 JavaScript打开标签/窗口,则允许JavaScript关闭它们.您可以使用page.execute_script在Capybara测试中执行JS. page.execute_script "window.close();"
我正在编写黄瓜测试来测试用户“记住我”的类型功能,为了在现实生活中做到这一点,用户将关闭他们的浏览器,重新打开浏览器,然后回到网站. 我的测试到目前为止看起来像这样: Scenario: 'Remember me' checked Given I have checked "Remember me" And I am logged in as "test@test.com" When
我试图针对远程服务器运行测试.即: require 'rubygems' require 'capybara' require 'capybara/dsl' Capybara.default_driver = :selenium Capybara.app_host = 'http://www.google.com' module MyCapybaraTest include Capyba