Skip to content

Instantly share code, notes, and snippets.

Feature: Submit Webform
As a visitor to xxx.com
I want to submit a form with some personal information
and be redirected to a thank-you page.
Scenario: Form Submission
Given I visit "http://xxx/webform.html"
And I type "home" into field "loan_purpose",
And I type "99999" into field "loan_amount",
And I type "Joe" into field "first_name",
#!/usr/bin/env ruby
require 'rubygems'
require 'webrat'
require 'webrat/mechanize'
require 'spec'
class MechanizeWorld < Webrat::MechanizeSession
include Spec::Matchers
include Webrat::Methods
import collection.immutable.TreeMap
import collection.mutable.ListBuffer
import reflect.Manifest
import util.matching.Regex
/*
Cucumber API for Scala
Other attempts are
http://gist.github.com/161702
button_steps.rb
I click the button "([^\"]*)" # button_steps.rb:1
I click the button "([^\"]*)" no block # button_steps.rb:7
checkbox_steps.rb
I click the checkbox "([^\"]*)" # checkbox_steps.rb:1
the checkbox "([^\"]*)" should (not )*be selected # checkbox_steps.rb:12
Then /^I should be logged in$/ do
UserSession.find.should_not == nil # RSpec style
assert_not_nil UserSession.find # Test::Unit style
end
Scenario Outline: Religious menus
Given I am "<Religion>"
When I ask to see a menu
Then I should be presented a menu with meats entrees
<Pork..Veal>
And I should be presented a menu with hamburger types
<Hamburger..Cheeseburger>
Examples:
| Religion | Pork | Lamb | Veal | Hamburger | Cheeseburger |
Scenario: User attempts to redeem a valid PIN, but there is a network issue
Given an activated user logged in as 'testuser'
And an active PIN code
And the connection to CardService fails
When she redeems the PIN code
Then she should be at the 'redemption/error.html.erb' page
And she should see a notice message 'Temporary problem with PIN redemption'
And the connection to CardService recovers
Scenario: User redeems a valid (active) PIN
.run
.info
date command project etc.
.summary
overview of run envisage this as being something like the progress output, with each entry being either a relative link to the feature or a drill into the feature
%ol.features
%li.feature.pass .
%li.feature.pass .
%li.feature.fail f
%li.feature.pending p
it 'should do something' do
on_failure warn_that "@foo shouldn't be nil" do
@foo.should_not be_nil
end
end
## NOTE
The error refers to the first line of the second multi-line pre-scenario comments
## sessions.feature file
Users want to know that nobody can masquerade as them. We want to extend trust
only to visitors who present the appropriate credentials. Everyone wants this
identity verification to be as secure and convenient as possible.
Feature: Logging in