SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
AMIR BARYLKO
                           INTRO TO
                          CAPYBARA


               EDMONTON RUBY USER GROUP
                              JUNE 2011


Amir Barylko - Capybara                   MavenThought Inc.
WHO AM I?

  • Architect

  • Developer

  • Mentor

  • Great     cook

  • The     one who’s entertaining you for the next hour!


Amir Barylko - Capybara                                     MavenThought Inc.
BDD




Amir Barylko - Capybara         MavenThought Inc.
WHY TRADITIONAL
                    PROJECTS FAIL?

  • Delivering       late or over budget

  • Delivering       the wrong thing

  • Unstable       in production

  • Costly     to maintain


Amir Barylko - Capybara                    MavenThought Inc.
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 behaviour


Amir Barylko - Capybara                                   MavenThought Inc.
OUTSIDE IN APPROACH




Amir Barylko - Capybara       MavenThought Inc.
GHERKIN DSL

  • Business      readable DSL

  • Flush    out requirements

  • Documentation

  • Automated             testing

  • Used  by Cucumber,
     SpecFlow, jBehave

Amir Barylko - Capybara                     MavenThought Inc.
CUCUMBER




Amir Barylko - Capybara              MavenThought Inc.
FEATURES
  Feature: Listing projects
    As a user
    I Want to see the list of projects
    So I can choose one to see the details

     Scenario: List all projects
       Given I'm logged in
       And   I have the projects:
               | Caruso    |
               | Pucini    |
               | Mariachi |
       When I go to the projects page
       Then I should see "Caruso"
       And   I should see "Pucini"
       And   I should see "Mariachi"



Amir Barylko - Capybara                      MavenThought Inc.
STEPS
  Given /^I have the projects:$/ do |table|

    projects = table.raw.collect do |project|

        {"id" => 4444,

            "name" => "#{project}",

            "description" => "Project developed in rails",
            "createTime" => "/Date(1256774726000-0500)/",

            "owner" => {"id" => 2222,"name" => "Some user"}}

    end

    fake_response = JSON.generate({"page" => 1,"pageSize" => 10,...})

    FakeWeb.register_uri(:get, "http://agilezen....", :body => fake_response)

    FakeWeb.register_uri(:get, "http://agilezen....", :body => JSON.generate(projects[0]))
  end




Amir Barylko - Capybara                                                     MavenThought Inc.
CAPYBARA




Amir Barylko - Capybara              MavenThought Inc.
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 capybara




Amir Barylko - Capybara                                  MavenThought Inc.
WHY

  • Support       for different web browsers

  • Provides       driver to run headless (without browser)

  • Can     combine different scenarios with different browsers

  • Supports        Rack and any remote web application

  • Supports        asynchronous calls


Amir Barylko - Capybara                                       MavenThought Inc.
FORMS

  • click_link(...)                  • check(...)

  • click_button(...)                • uncheck(...)

  • click_link_or_button(...)        • attach_file(...)

  • choose(...)                      • select_option(...)

  • fill_in(“FirstName”, :with   =>
     “John”)

Amir Barylko - Capybara                                     MavenThought Inc.
FINDERS

  • all(*args)                              • find_button
     •   page.all(:css, ‘a#user’)
                                            • find_by_id
     •   page.all(:xpath, ‘//[@id=user]’)

  • find     (same args as all)

  • find_field

  • find_link



Amir Barylko - Capybara                                    MavenThought Inc.
MATCHERS

  • has_selector?

  • has_no_selector?

  • has_content?

  • has_no_content




Amir Barylko - Capybara              MavenThought Inc.
STEPS

  • Given      I am on Home

  • When       I go to Projects

  • When       I press “login” within “user”

  • When       I follow “help” within “support”




Amir Barylko - Capybara                           MavenThought Inc.
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”

  • When       I attach then file “settings.xml” to “file”
Amir Barylko - Capybara                                    MavenThought Inc.
STEPS III

  • Then      I should see “Welcome”

  • Then      I should not see “Welcome”

  • Then      the field “user” should contain “Mel”

  • Then      show me the page




Amir Barylko - Capybara                              MavenThought Inc.
XPATH

  • Then      I should see “Welcome”

  • Then      I should not see “Welcome”

  • Then      the field “user” should contain “Mel”

  • Then      show me the page




Amir Barylko - Capybara                              MavenThought Inc.
QUESTIONS?




Amir Barylko - Capybara                MavenThought Inc.
RESOURCES

  • Email: amir@barylko.com,

  • Twitter: @abarylko

  • Blog: http://orthocoders.com

  • Materials: http://orthocoders.com/presentations

  • Website: http://maventhought.com



Amir Barylko - Capybara                        MavenThought Inc.
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.org



Amir Barylko - Capybara                               MavenThought Inc.

Weitere ähnliche Inhalte

Was ist angesagt?

PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1Amir Barylko
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with AdobeGrace Solivan
 
every-day-automation
every-day-automationevery-day-automation
every-day-automationAmir Barylko
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patternsAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsAmanda Giles
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 

Was ist angesagt? (9)

PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1PRDC-ror-trilogy-part1
PRDC-ror-trilogy-part1
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with Adobe
 
every-day-automation
every-day-automationevery-day-automation
every-day-automation
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patterns
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
Agile planning
Agile planningAgile planning
Agile planning
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 

Andere mochten auch

Performance testing with loadrunner by kc
Performance testing with loadrunner by kcPerformance testing with loadrunner by kc
Performance testing with loadrunner by kckrishna chaitanya
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep diveAmir Barylko
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web developmentAmir Barylko
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance TestingAtul Pant
 

Andere mochten auch (6)

Performance testing with loadrunner by kc
Performance testing with loadrunner by kcPerformance testing with loadrunner by kc
Performance testing with loadrunner by kc
 
No estimates
No estimatesNo estimates
No estimates
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance Testing
 

Ähnlich wie YEG-UG-Capybara

DevTeach12-Capybara
DevTeach12-CapybaraDevTeach12-Capybara
DevTeach12-CapybaraAmir Barylko
 
Page-objects-pattern
Page-objects-patternPage-objects-pattern
Page-objects-patternAmir Barylko
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptAmir Barylko
 
YEG-Agile-planning
YEG-Agile-planningYEG-Agile-planning
YEG-Agile-planningAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integrationAmir Barylko
 
PRDCW-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregatorAmir Barylko
 
2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resourcesAmir Barylko
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality drivenAmir Barylko
 
DevTeach12-betterspecs
DevTeach12-betterspecsDevTeach12-betterspecs
DevTeach12-betterspecsAmir Barylko
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsAmir Barylko
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsAmir Barylko
 
A baryklo design-patterns
A baryklo design-patternsA baryklo design-patterns
A baryklo design-patternssdeconf
 
sdec11-Advanced-design-patterns
sdec11-Advanced-design-patternssdec11-Advanced-design-patterns
sdec11-Advanced-design-patternsAmir Barylko
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashNiels Frydenholm
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublinroland99
 
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...Peter Leschev
 

Ähnlich wie YEG-UG-Capybara (20)

DevTeach12-Capybara
DevTeach12-CapybaraDevTeach12-Capybara
DevTeach12-Capybara
 
Page-objects-pattern
Page-objects-patternPage-objects-pattern
Page-objects-pattern
 
Capybara1
Capybara1Capybara1
Capybara1
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & Coffeescript
 
YEG-Agile-planning
YEG-Agile-planningYEG-Agile-planning
YEG-Agile-planning
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
PRDCW-avent-aggregator
PRDCW-avent-aggregatorPRDCW-avent-aggregator
PRDCW-avent-aggregator
 
2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources2012 regina TC - 101 welcome & resources
2012 regina TC - 101 welcome & resources
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven
 
DevTeach12-betterspecs
DevTeach12-betterspecsDevTeach12-betterspecs
DevTeach12-betterspecs
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patterns
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patterns
 
A baryklo design-patterns
A baryklo design-patternsA baryklo design-patterns
A baryklo design-patterns
 
sdec11-Advanced-design-patterns
sdec11-Advanced-design-patternssdec11-Advanced-design-patterns
sdec11-Advanced-design-patterns
 
Nuget
NugetNuget
Nuget
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 
In App Purchases
In  App  PurchasesIn  App  Purchases
In App Purchases
 
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake DubliniOS and Android Acceptance Testing with Calabash - Xcake Dublin
iOS and Android Acceptance Testing with Calabash - Xcake Dublin
 
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
Puppet Camp Melbourne Nov 2014 - A Build Engineering Team’s Journey of Infras...
 

Mehr von Amir Barylko

Functional converter project
Functional converter projectFunctional converter project
Functional converter projectAmir Barylko
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting trainingAmir Barylko
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessAmir Barylko
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6Amir Barylko
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideAmir Barylko
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityAmir Barylko
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentAmir Barylko
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilitiesAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
Teams and responsibilities
Teams and responsibilitiesTeams and responsibilities
Teams and responsibilitiesAmir Barylko
 

Mehr von Amir Barylko (17)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescript
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
Teams and responsibilities
Teams and responsibilitiesTeams and responsibilities
Teams and responsibilities
 

Kürzlich hochgeladen

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Kürzlich hochgeladen (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

YEG-UG-Capybara

  • 1. AMIR BARYLKO INTRO TO CAPYBARA EDMONTON RUBY USER GROUP JUNE 2011 Amir Barylko - Capybara MavenThought Inc.
  • 2. WHO AM I? • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko - Capybara MavenThought Inc.
  • 3. BDD Amir Barylko - Capybara MavenThought Inc.
  • 4. WHY TRADITIONAL PROJECTS FAIL? • Delivering late or over budget • Delivering the wrong thing • Unstable in production • Costly to maintain Amir Barylko - Capybara MavenThought Inc.
  • 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 behaviour Amir Barylko - Capybara MavenThought Inc.
  • 6. OUTSIDE IN APPROACH Amir Barylko - Capybara MavenThought Inc.
  • 7. GHERKIN DSL • Business readable DSL • Flush out requirements • Documentation • Automated testing • Used by Cucumber, SpecFlow, jBehave Amir Barylko - Capybara MavenThought Inc.
  • 8. CUCUMBER Amir Barylko - Capybara MavenThought Inc.
  • 9. FEATURES Feature: Listing projects As a user I Want to see the list of projects So I can choose one to see the details Scenario: List all projects Given I'm logged in And I have the projects: | Caruso | | Pucini | | Mariachi | When I go to the projects page Then I should see "Caruso" And I should see "Pucini" And I should see "Mariachi" Amir Barylko - Capybara MavenThought Inc.
  • 10. STEPS Given /^I have the projects:$/ do |table| projects = table.raw.collect do |project| {"id" => 4444, "name" => "#{project}", "description" => "Project developed in rails", "createTime" => "/Date(1256774726000-0500)/", "owner" => {"id" => 2222,"name" => "Some user"}} end fake_response = JSON.generate({"page" => 1,"pageSize" => 10,...}) FakeWeb.register_uri(:get, "http://agilezen....", :body => fake_response) FakeWeb.register_uri(:get, "http://agilezen....", :body => JSON.generate(projects[0])) end Amir Barylko - Capybara MavenThought Inc.
  • 11. CAPYBARA Amir Barylko - Capybara MavenThought Inc.
  • 12. 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 capybara Amir Barylko - Capybara MavenThought Inc.
  • 13. WHY • Support for different web browsers • Provides driver to run headless (without browser) • Can combine different scenarios with different browsers • Supports Rack and any remote web application • Supports asynchronous calls Amir Barylko - Capybara MavenThought Inc.
  • 14. FORMS • click_link(...) • check(...) • click_button(...) • uncheck(...) • click_link_or_button(...) • attach_file(...) • choose(...) • select_option(...) • fill_in(“FirstName”, :with => “John”) Amir Barylko - Capybara MavenThought Inc.
  • 15. FINDERS • all(*args) • find_button • page.all(:css, ‘a#user’) • find_by_id • page.all(:xpath, ‘//[@id=user]’) • find (same args as all) • find_field • find_link Amir Barylko - Capybara MavenThought Inc.
  • 16. MATCHERS • has_selector? • has_no_selector? • has_content? • has_no_content Amir Barylko - Capybara MavenThought Inc.
  • 17. STEPS • Given I am on Home • When I go to Projects • When I press “login” within “user” • When I follow “help” within “support” Amir Barylko - Capybara MavenThought Inc.
  • 18. 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” • When I attach then file “settings.xml” to “file” Amir Barylko - Capybara MavenThought Inc.
  • 19. STEPS III • Then I should see “Welcome” • Then I should not see “Welcome” • Then the field “user” should contain “Mel” • Then show me the page Amir Barylko - Capybara MavenThought Inc.
  • 20. XPATH • Then I should see “Welcome” • Then I should not see “Welcome” • Then the field “user” should contain “Mel” • Then show me the page Amir Barylko - Capybara MavenThought Inc.
  • 21. QUESTIONS? Amir Barylko - Capybara MavenThought Inc.
  • 22. RESOURCES • Email: amir@barylko.com, • Twitter: @abarylko • Blog: http://orthocoders.com • Materials: http://orthocoders.com/presentations • Website: http://maventhought.com Amir Barylko - Capybara MavenThought Inc.
  • 23. 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.org Amir Barylko - Capybara MavenThought Inc.