Your SlideShare is downloading. ×
  • Like
Quality web-acceptance
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Quality web-acceptance

  • 491 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
491
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
6
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. AMIR BARYLKO QUALITY DRIVEN WEB ACCEPTANCE TESTING MVC CONFERENCE FEB 2011Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 2. WHO AM I? • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour!Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 3. BDDAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 4. WHY TRADITIONAL PROJECTS FAIL? • Delivering late or over budget • Delivering the wrong thing • Unstable in production • Costly to maintainAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 5. BDD PRINCIPLES • Behaviour Driven development is about implementing an application by describing its behaviour from the perspective of the stakeholder • Enough is Enough • Deliver stakeholder value • It’s all behaviourAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 6. OUTSIDE IN APPROACHAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 7. GHERKIN DSL • Business readable DSL • Flush out requirements • Documentation • Automated testing • Used by Cucumber, SpecFlow, jBehaveAmir Barylko - BDD MavenThought Inc.Tuesday, February 8, 2011
  • 8. CUCUMBERAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 9. WHAT DO I NEED? • The following folder structure features: Folder for all the .feature files step_definitions: all your step implementations (.rb) support: setup environment, capybara, etc (.rb)Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 10. SETUP features/support/paths.rb module NavigationHelpers # Maps a name to a path. Used by the # # When /^I go to (.+)$/ do |page_name| # # step definition in web_steps.rb # def path_to(page_name) case page_name when /home/ / when /Movies/ /Movies ...Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 11. FEATURES Feature: Addition In order to make my library grow As a registered user I want to add movies to the library Scenario: Add a movie Given I have no movies And I am on "home" When I follow "create" And I fill in "movie_title" with "Young Frankenstein" And I press "Submit" Then I should see "Young Frankenstein"Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 12. STEPS Given /^I have the following movies:$/ do |table| db = SQLite3::Database.new( "C:/temp/movielib.db" ) db.execute( "delete from Movie" ) ... end Given /^I have no movies$/ do clear_database endAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 13. HOW DOES IT WORK? • Read scenario step Given I have no movies • Match regular expression Given /^I have no movies$/ • Run the code associated to the regular expression clear_databaseAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 14. CAPYBARAAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 15. WHAT • Gem to simplify integration tests • Inspired by Webrat • Can be used with Cucumber steps or in any other test • Easy to install: gem install capybaraAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 16. WHY • Support for different web browsers (ie, firefox, chrome) • Provides driver to run headless (virtual browser) • Can tag scenarios to be run with a browser • Supports remote web application (not rack) • Supports asynchronous calls (AJAX)Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 17. SETUP features/support/capybara.rb require capybara/cucumber require selenium-webdriver #Capybara.default_driver = :culerity Capybara.default_driver = :selenium Capybara.app_host = "http://localhost:1591" Capybara.run_server = false Capybara.default_wait_time = 5 Capybara.default_selector = :css Capybara.register_driver :selenium do |app| #Capybara::Driver::Selenium.new(app, :browser => :ie) Capybara::Driver::Selenium.new(app, :browser => :chrome) endAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 18. STEPS • Given I am on the Home page • When I go to the Projects page • When I press “login” • When I follow “help” within “support”Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 19. STEPS II • When I fill “username” with “mel” • When I select “Winnipeg” from “cities” • When I check “remember_me” • When I uncheck “remember_me” • When I choose “Option”Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 20. STEPS III • Then I should see “Welcome” • Then I should not see “Welcome” • Then the field “user” should contain “Mel” • Then show me the pageAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 21. DEMOAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 22. QUESTIONS?Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 23. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Materials: http://www.orthocoders.com/presentationsAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 24. RESOURCES II • Capybara: https://github.com/jnicklas/capybara • Cucumber: https://github.com/aslakhellesoy/cucumber/wiki • Culerity: https://github.com/langalex/culerity • Celerity: http://celerity.rubyforge.org • Selenium: http://seleniumhq.orgAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011