Quality web-acceptance
Upcoming SlideShare
Loading in...5
×
 

Quality web-acceptance

on

  • 718 views

 

Statistics

Views

Total Views
718
Views on SlideShare
718
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

Quality web-acceptance Quality web-acceptance Presentation Transcript

  • AMIR BARYLKO QUALITY DRIVEN WEB ACCEPTANCE TESTING MVC CONFERENCE FEB 2011Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 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
  • BDDAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 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
  • 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
  • OUTSIDE IN APPROACHAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • GHERKIN DSL • Business readable DSL • Flush out requirements • Documentation • Automated testing • Used by Cucumber, SpecFlow, jBehaveAmir Barylko - BDD MavenThought Inc.Tuesday, February 8, 2011
  • CUCUMBERAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 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
  • 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
  • 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
  • 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
  • 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
  • CAPYBARAAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • DEMOAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • QUESTIONS?Amir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Materials: http://www.orthocoders.com/presentationsAmir Barylko - MvcConf MavenThought Inc.Tuesday, February 8, 2011
  • 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