• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Wellrailed - Cucumber tips
 

Wellrailed - Cucumber tips

on

  • 1,221 views

 

Statistics

Views

Total Views
1,221
Views on SlideShare
1,199
Embed Views
22

Actions

Likes
0
Downloads
1
Comments
0

2 Embeds 22

http://www.breccan.com 21
http://www.slideshare.net 1

Accessibility

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Wellrailed - Cucumber tips Wellrailed - Cucumber tips Presentation Transcript

    • Cucumber and Tips(briefly)
    • Scenarios
      • Written in YAML
      • Scenario: Eat Cake
          • given there is cake
          • when I go to the cake page
          • and I press “Eat Cake”
          • then I should see “There is no more cake”
      • Get clients or stakeholders in on the writing process.
    • Steps
        When /^I go to (.+)$/ do |page_name| visit path_to(page_name) end Generic is better.
    • Dealing with slow test suites Just target one feature: Cucumber features/feature.rb Specify by line number: Cucumber features/feature.rb:2:29
    • Avoid Excessive Givens
      • Each given loads data and is held in a transaction for the scenario.
      • Seed data where possible rather than establishing it in givens
    • Tagging features
      • Tag features and scenarios with :
        • @tag @tag2
        • Feature: cake
      • Run specific tags with:
        • cucumber --tags @tag
      • The @wip tag is special for WIP.
    • Validate your HTML
      • Throw in a step to validate your HTML
        • markup_validity gem
        • Then %r/the page is valid XHTML/ do
        • $browser.html.should be_xhtml_strict if ENV["VALIDATION"]
        • end
      • Equal opportunity for front end people to get laughed at for breaking the build.