Integration Test With Cucumber And Webrat

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 2 Groups

    Integration Test With Cucumber And Webrat - Presentation Transcript

    1. Integration Test with Cucumber and Webrat Kang-min Liu gugod@gugod.org
    2. Integration Test • • • Web App:
    3. : twitter
    4. : twitter 1. http://twitter.com/home 2. status 3. update 4.
    5. Webrat visit "http://twitter.com/home" fill_in "status", :with => "lorem ipsum" click_button "update" response.body.should =~ /lorem ipsum/
    6. Webrat Browser emulation / control
    7. Webrat • • • •
    8. Webrat • javascript • css
    9. Webrat • • Selenium • Watir
    10. Webrat Core API • visit • select • click_link • attach_file • fill_in • click_button • check • uncheck • choose
    11. Webrat Core API • visit, click_link • get + assert_response :success • click_button • submit form + assert_response :success • submit form default values if any
    12. Webrat + RSpec describe "tweeting" do it "should show my tweets" do visit "/home" fill_in "status", :with => "lorem ipsum" click_button "update" response.body.should =~ /lorem ipsum/ end end
    13. ?
    14. Goods • • HTML •
    15. Cucumber • BDD (Behavior Driven Development) Tool • Ruby implementation • •
    16. Feature: Update my status In order to keep friends posted As a friendly person I post my status to twitter Scenario: Update my status Given I go to “/home” When I fill in “status” with “lorem ipsum” And I click “send” Then I should see “lorem ipsum”
    17. Feature: Update my status In order to keep friends posted As a friendly person I post my status to twitter Scenario: Update my status Given I go to “/home” When I fill in “status” with “lorem ipsum” And I click “send” Then I should see “lorem ipsum”
    18. Feature: Update my status In order to keep friends posted As a friendly person I post my status to twitter Scenario: Update my status Given I go to “/home” When I fill in “status” with “lorem ipsum” And I click “send” Then I should see “lorem ipsum”
    19. Scenario: Update my status Given I go to “/home” When I fill in “status” with “lorem ipsum” And I click “send” Then I should see “lorem ipsum” Given – When – Then –
    20. Given /^I go to "(.*)"$/ do |url| visit url end When /^I fill in "(.*)" with "(.*)"$/ do |field,value| fill_in field, :with => value end When /^I click "(.*)"$/ do |link| click_link(link) end Then /^I should see "(.*)"$/ do |text| response.body.should =~ /#{text}/m end
    21. ?
    22. Goods... • • • •
    23. Goods... • •
    24. Scenario: Update my status Given I go to “/home” When I fill in “status” with “lorem ipsum” And I click “send” Then I should see “lorem ipsum”
    25. describe "tweeting" do it "should show my tweets" do visit "/home" fill_in "status", :with => "lorem ipsum" click_button "update" response.body.should =~ /lorem ipsum/ end end
    26. Reference • Cucumber http://cukes.info/ • Webrat http://github.com/brynary/webrat/ tree/master • Test::Cukes http://search.cpan.org/dist/Test- Cukes/ (Perl implementation)

    + Kang-min LiuKang-min Liu, 4 months ago

    custom

    1430 views, 1 favs, 0 embeds more stats

    my talk about cucumber and webrat on ruby tuesday

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1430
      • 1430 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 8
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events