- 浏览: 2072691 次
- 性别:
- 来自: NYC
文章分类
- 全部博客 (628)
- Linux (53)
- RubyOnRails (294)
- HTML (8)
- 手册指南 (5)
- Mysql (14)
- PHP (3)
- Rails 汇总 (13)
- 读书 (22)
- plugin 插件介绍与应用 (12)
- Flex (2)
- Ruby技巧 (7)
- Gem包介绍 (1)
- javascript Jquery ext prototype (21)
- IT生活 (6)
- 小工具 (4)
- PHP 部署 drupal (1)
- javascript Jquery sort plugin 插件 (2)
- iphone siri ios (1)
- Ruby On Rails (106)
- 编程概念 (1)
- Unit Test (4)
- Ruby 1.9 (24)
- rake (1)
- Postgresql (6)
- ruby (5)
- respond_to? (1)
- method_missing (1)
- git (8)
- Rspec (1)
- ios (1)
- jquery (1)
- Sinatra (1)
最新评论
-
dadadada2x:
user模型里加上 protected def email ...
流行的权限管理 gem devise的定制 -
Sev7en_jun:
shrekting 写道var pattern = /^(0| ...
强悍的ip格式 正则表达式验证 -
jiasanshou:
好文章!!!
RPM包rpmbuild SPEC文件深度说明 -
寻得乐中乐:
link_to其实就是个a标签,使用css控制,添加一个参数: ...
Rails在link_to中加参数 -
aiafei0001:
完全看不懂,不知所然.能表达清楚一点?
"$ is not defined" 的问题怎么办
= Webrat - Ruby Acceptance Testing for Web applications
- http://gitrdoc.com/brynary/webrat
- http://groups.google.com/group/webrat
- http://webrat.lighthouseapp.com/
- http://github.com/brynary/webrat
- #webrat on Freenode
== Description
Webrat lets you quickly write expressive and robust acceptance tests for a Ruby
web application.
== Features
* Browser Simulator for expressive, high level acceptance testing without the
performance hit and browser dependency of Selenium or Watir (See
Webrat::Session)
* Use the same API for Browser Simulator and real Selenium tests using
Webrat::Selenium when necessary (eg. for testing AJAX interactions)
* Supports multiple Ruby web frameworks: Rails, Merb and Sinatra
* Supports popular test frameworks: RSpec, Cucumber, Test::Unit and Shoulda
* Webrat::Matchers API for verifying rendered HTML using CSS, XPath, etc.
== Simulating browser events
# GET a URL, following any redirects, and making sure final page is successful
visit "/some/url"
# In general, elements can be located by their inner text, their 'title'
attribute, their 'name' attribute, and their 'id' attribute.
# They can be selected using a String, which is converted to an escaped Regexp
effectively making it a substring match, or using a Regexp.
# An exception is that using Strings for ids are compared exactly (using ==)
rather than converted to a Regexp
# If the element you are trying to look up does not exist, an error occurs
# Links can be looked up by text, title, or id
# To match... <a href="/signup" title="Sign up" id="signup_link">Click here to
join!</a>
click_link "Click here to join!" # substring text
click_link /join/i # regexp text
click_link "Sign up" # substring title
click_link /sign.*up/i # regexp title
click_link /signup.*link/i # regexp id
click_link "signup_link" # exact id
# All fields can be looked up by ID, name, or label inner text
# text fields, password fields, and text areas can be filled in
# <label for="user[email]">Enter your Email</label><input type="text"
name="user[email]" id="user_name">
fill_in "user_email", :with => "good@example" # exact id
fill_in /user.*email/, :with => "good@example" # regexp id
fill_in "user[email]", :with => "good@example" # substring name
fill_in /user[.*mail.*]/, :with => "good@example" # substring name
fill_in "Email", :with => "good@example.com" # substring label text
fill_in /enter your email/i, :with => "good@example.com" # regexp label text
# Hidden fields can be set
set_hidden_field 'user[l337_hax0r]', :to => 'true'
# Select options can be 'selected' by inner text (an exact String or a Regexp
to match). It can optionally be selected from a particular select field, using
the usual id, name, or label text.
select "Free account"
select "Free account", :from => "Account Types"
select "Free account", :from => "user[account_type]"
select "Free account", :from => "user_account_type"
# Check boxes can be 'checked' and 'unchecked'
check 'Remember me'
uncheck 'Remember me'
# Radio buttons can be choosen, using the usual label text, name, or id.
choose "Yes"
click_button "Register"
== Assertions
# check for text in the body of html tags
# can be a string or regexp
assert_contain("BURNINATOR")
assert_contain(/trogdor/i)
assert_not_contain("peasants")
# check for a css3 selector
assert_have_selector 'div.pagination'
assert_have_no_selector 'form input#name'
== Matchers
# check for text in the body of html tags
# can be a string or regexp
# Matchers are verbs used with auxillary verbs should, should_not, etc.
response.should contain("BURNINATOR")
response.should contain(/trogdor/i)
response.should_not contain("peasants")
# check for a css3 selector
response.should have_selector('div.pagination')
response.should_not have_selector('form input#name')
== Targetted actions/matchers
# selectors syntax is defined here: http://www.w3.org/TR/css3-selectors/
within 'div.pagination' do |scope|
scope.click_link "1"
end
within '.shows' do |scope|
scope.should contain("NFL")
# unfortunately, assertions don't support this currently
end
within 'form[name="search"] select[name="type"]' do |scope|
scope.should have_selector 'option[value="blah"]'
scope.should have_selector 'option[value="gah"]'
scope.should have_selector 'option[value="eep"]'
scope.should have_selector 'input:only-of-type'
scope.should have_selector 'input[name="query"]'
scope.should have_selector 'input[type="text"]'
end
- http://gitrdoc.com/brynary/webrat
- http://groups.google.com/group/webrat
- http://webrat.lighthouseapp.com/
- http://github.com/brynary/webrat
- #webrat on Freenode
== Description
Webrat lets you quickly write expressive and robust acceptance tests for a Ruby
web application.
== Features
* Browser Simulator for expressive, high level acceptance testing without the
performance hit and browser dependency of Selenium or Watir (See
Webrat::Session)
* Use the same API for Browser Simulator and real Selenium tests using
Webrat::Selenium when necessary (eg. for testing AJAX interactions)
* Supports multiple Ruby web frameworks: Rails, Merb and Sinatra
* Supports popular test frameworks: RSpec, Cucumber, Test::Unit and Shoulda
* Webrat::Matchers API for verifying rendered HTML using CSS, XPath, etc.
== Simulating browser events
# GET a URL, following any redirects, and making sure final page is successful
visit "/some/url"
# In general, elements can be located by their inner text, their 'title'
attribute, their 'name' attribute, and their 'id' attribute.
# They can be selected using a String, which is converted to an escaped Regexp
effectively making it a substring match, or using a Regexp.
# An exception is that using Strings for ids are compared exactly (using ==)
rather than converted to a Regexp
# If the element you are trying to look up does not exist, an error occurs
# Links can be looked up by text, title, or id
# To match... <a href="/signup" title="Sign up" id="signup_link">Click here to
join!</a>
click_link "Click here to join!" # substring text
click_link /join/i # regexp text
click_link "Sign up" # substring title
click_link /sign.*up/i # regexp title
click_link /signup.*link/i # regexp id
click_link "signup_link" # exact id
# All fields can be looked up by ID, name, or label inner text
# text fields, password fields, and text areas can be filled in
# <label for="user[email]">Enter your Email</label><input type="text"
name="user[email]" id="user_name">
fill_in "user_email", :with => "good@example" # exact id
fill_in /user.*email/, :with => "good@example" # regexp id
fill_in "user[email]", :with => "good@example" # substring name
fill_in /user[.*mail.*]/, :with => "good@example" # substring name
fill_in "Email", :with => "good@example.com" # substring label text
fill_in /enter your email/i, :with => "good@example.com" # regexp label text
# Hidden fields can be set
set_hidden_field 'user[l337_hax0r]', :to => 'true'
# Select options can be 'selected' by inner text (an exact String or a Regexp
to match). It can optionally be selected from a particular select field, using
the usual id, name, or label text.
select "Free account"
select "Free account", :from => "Account Types"
select "Free account", :from => "user[account_type]"
select "Free account", :from => "user_account_type"
# Check boxes can be 'checked' and 'unchecked'
check 'Remember me'
uncheck 'Remember me'
# Radio buttons can be choosen, using the usual label text, name, or id.
choose "Yes"
click_button "Register"
== Assertions
# check for text in the body of html tags
# can be a string or regexp
assert_contain("BURNINATOR")
assert_contain(/trogdor/i)
assert_not_contain("peasants")
# check for a css3 selector
assert_have_selector 'div.pagination'
assert_have_no_selector 'form input#name'
== Matchers
# check for text in the body of html tags
# can be a string or regexp
# Matchers are verbs used with auxillary verbs should, should_not, etc.
response.should contain("BURNINATOR")
response.should contain(/trogdor/i)
response.should_not contain("peasants")
# check for a css3 selector
response.should have_selector('div.pagination')
response.should_not have_selector('form input#name')
== Targetted actions/matchers
# selectors syntax is defined here: http://www.w3.org/TR/css3-selectors/
within 'div.pagination' do |scope|
scope.click_link "1"
end
within '.shows' do |scope|
scope.should contain("NFL")
# unfortunately, assertions don't support this currently
end
within 'form[name="search"] select[name="type"]' do |scope|
scope.should have_selector 'option[value="blah"]'
scope.should have_selector 'option[value="gah"]'
scope.should have_selector 'option[value="eep"]'
scope.should have_selector 'input:only-of-type'
scope.should have_selector 'input[name="query"]'
scope.should have_selector 'input[type="text"]'
end
发表评论
-
Destroying a Postgres DB on Heroku
2013-04-24 10:58 928heroku pg:reset DATABASE -
VIM ctags setup ack
2012-04-17 22:13 3255reference ctags --extra=+f --e ... -
alias_method_chain方法在3.1以后的替代使用方式
2012-02-04 02:14 3288alias_method_chain() 是rails里的一个 ... -
一些快速解决的问题
2012-01-19 12:35 1470问题如下: 引用Could not open library ... -
API service 安全问题
2011-12-04 08:47 1380这是一个长期关注的课题 rest api Service的 ... -
Module方法调用好不好
2011-11-20 01:58 1344以前说,用module给class加singleton方法,和 ... -
一个ajax和rails交互的例子
2011-11-19 01:53 1903首先,这里用了一个,query信息解析的包,如下 https: ... -
Rails 返回hash给javascript
2011-11-19 01:43 2272这是一个特别的,不太正统的需求, 因为,大部分时候,ajax的 ... -
关于Rubymine
2011-11-18 23:21 2263开个帖子收集有关使用上的问题 前一段时间,看到半价就买了。想 ... -
ruby中和javascript中,动态方法的创建
2011-11-18 21:01 1234class Klass def hello(*args) ... -
textmate快捷键 汇总
2011-11-16 07:20 8138TextMate 列编辑模式 按住 Alt 键,用鼠标选择要 ... -
Ruby面试系列六,面试继续面试
2011-11-15 05:55 2018刚才受到打击了,充分报漏了自己基础不扎实,不肯向虎炮等兄弟学习 ... -
说说sharding
2011-11-13 00:53 1481这个东西一面试就有人 ... -
rails面试碎碎念
2011-11-12 23:51 1939面试继续面试 又有问ru ... -
最通常的git push reject 和non-fast forward是因为
2011-11-12 23:29 17209git push To git@github.com:use ... -
Rails 自身的many to many关系 self has_many
2011-11-12 01:43 2732简单点的 #注意外键在person上people: id ... -
Rails 3下的 in place editor edit in place
2011-11-12 01:20 945第一个版本 http://code.google.com/p ... -
Heroku 的诡异问题集合
2011-11-11 07:22 1692开个Post记录,在用heroku过程中的一些诡异问题和要注意 ... -
SCSS 和 SASS 和 HAML 和CoffeeScript
2011-11-07 07:52 12952Asset Pipeline 提供了内建 ... -
Invalid gemspec because of the date format in specification
2011-11-07 02:14 2115又是这个date format的错误。 上次出错忘了,记录下 ...
相关推荐
当通过执行以下步骤开发框架时,Cucumber测试自动化框架可以是一个强大的框架 •Cucumber中带有Selenium PageFactory的页面对象设计模式 •页面对象管理器 •从属性文件读取配置 •文件读取器管理器 •Web驱动程序...
这个配置指南详细地列出了在 Windows 环境下设置 Cucumber 测试框架的步骤,确保了所有必要的依赖和工具都已就绪,可以进行 BDD 测试。遵循这些步骤,开发者能够成功地在本地环境中运行 Cucumber 的测试用例。
在“Api_test_cucumber_java_framework_BDD-master”这个压缩包中,我们可能找到以下关键文件和目录: 1. `pom.xml`: Maven的项目对象模型(Project Object Model),定义了项目依赖和构建过程。 2. `src/main/java...
RestAssured_Selenium_Java_Cucumber_BDD_Sikuli_TestNG 这是一个 API 自动化测试框架,使用: RestAssuredSeleniumJavaCucumber BDDSikulilog4jsMavenTestNGPage Object Model安装先决条件: JavaEditorMavenVS ...
JaCoCo涵盖了Cucumber和JUnit测试的示例Gradle项目。 概述 为了满足较高的安全标准,假设已验证这些要求,并且一旦通过验证,则软件的质量应该很好,因此,一个软件应该具有较高和可能较低水平的软件要求。 该示例...
Cucumber_BDD_Sikuli_TestNG 这是一个 Web 自动化测试框架,使用: SeleniumJavaCucumber BDDlog4j2SikuliMavenTestNGPage Object Model安装先决条件: JavaEditorMavenVS Code 中的扩展: Cucumber Eclipse Plugin...
【SelTestWithJunit:Modified_After_cucumber_deleted_recreated_WithJUNIT 项目】是一个基于Java语言的自动化测试项目,其主要目的是使用JUnit进行功能测试。在项目名称中,“Modified”表明这是一个经过修改的版本...
RestAssured_Selenium_Java_Cucumber_BDD_Sikuli_JUnit 这是一个 API 自动化测试框架,使用: RestAssuredSeleniumJavaCucumber BDDSikulilog4j2MavenJUnitPage Object Model安装先决条件: JavaEditorMavenVS Code ...
【LibraryApp_Cucumber_JDBC】项目是一个基于Java的图书馆管理应用程序,它利用了Cucumber进行自动化测试,并结合JDBC(Java Database Connectivity)进行数据库交互。这个项目的核心目标是实现一个功能完善的图书...
Maven 搭建cucumber 简单示例 1.新建Maven 项目 2.Eclipse安装 cucumber 插件:Help->Install New Software->Add name:cucumber location:http://cucumber.github.com/cucumber-eclipse/update-site 3.导入示例项目,...
它的这种设计哲学,使得每个团队成员都可以理解Cucumber编写的测试脚本,即便是非技术背景的业务分析师、产品经理也能轻松参与其中。 在敏捷开发过程中,Cucumber通过它的独特功能帮助团队成员保持沟通的连贯性。它...
Cucumber,一个强大的自动化测试框架,以其易读性和可维护性在软件开发领域备受推崇,尤其在集成测试和行为驱动开发(BDD)中扮演着关键角色。它不仅支持Web应用的测试,还能够应用于移动应用(APP)以及API接口的...
这个JAR文件包含了运行Cucumber测试所必需的类和资源,使得开发者和非技术人员可以通过自然语言编写可执行的测试场景。 Cucumber的核心理念是将测试描述为人类可读的故事,这些故事称为特性文件,通常使用Gherkin...
总结起来,Cucumber_小Cucumber_POM 是关于使用 Java 和 Cucumber 进行自动化测试,特别是采用 Page Object Model 设计模式来组织和管理测试代码。通过 Gherkin 语法,团队可以以非技术语言编写测试场景,而 Step ...
Android使用的MQTT客户端,支持订阅、发送消息;支持创建连接到本地保存;支持话题消息筛选; 使用视频:https://dwz.cn/undJFEnq 好像小米应用商店也有~
Cucumber 是一种流行的自动化测试工具,特别是在BDD(行为驱动开发)中,它允许开发者、测试人员和非技术人员使用自然语言编写可执行的规范。在Java项目中,Cucumber经常被用来验证软件功能是否按预期工作。然而,当...
项目移至 LEARNINGWELL 内部 GITLAB 服务器Cucumber STDDTool 格式化程序将测试结果发送到 STDDTool 的 -formatter开始: 在您的 Gemfile 中: gem 'stddtool' 并在您的/support/env.rb文件或支持目录下的任何其他...
Cucumber-rust是一个针对Rust编程语言的Cucumber测试框架,它专为行为驱动开发(BDD)设计,同时也适用于测试驱动开发(TDD)和验收测试驱动开发(ATDD)。Cucumber-rust的独特之处在于它完全原生,不依赖任何外部...
在测试类中,你可以调用 `@RunWith(Cucumber.class)` 来指示 JUnit 使用 Cucumber 运行测试。 5. **生成报告**: Cucumber 可以生成详细的测试报告,显示每个步骤的执行情况。你可以通过配置 CucumberOptions 来定制...
Cucumber是一个自动化测试工具,它属于行为驱动开发(BDD)的范畴。这个工具的特点是可以用自然语言来描述测试用例,因此...开发人员可以使用Cucumber进行公共方法的封装,而功能测试人员则可以专注于编写测试用例。