SlideShare ist ein Scribd-Unternehmen logo
1 von 14
@victorhg




Largamos o Cucumber
              http://www.flickr.com/photos/stuartpilbrow/3687751382/
Falando sobre cucumber!




“BDD outside in” em 2011
Bom e velho cucumber

 
 Accessing website with true credentials
  When I am on the login page
   And I fill in "email" with "bla@email.com"
   And I fill in "password" with "qwerty"
   And I click button "Login"
  Then I should see "Olá, bla@email.com"



                 smell gerado pelo web_steps.rb
Text
Não é esse o ponto!!
+1 Camada de abstração
                       Mais código para manter

          Clientes
         Duplicando código em linguagem natural


    esperam LER a
     especificação
Clientes não
     querem escrever testes!
Alcançando Valor com
      Cucumber
Acessing website with true
credentials:
 When I am on the login page
  And I use my credentials
 Then I should see a welcome
 message
Manutenção continuou um
            saco!
     Duplicando
  rspecs & cucumber
        steps
  Refactoring não é
      perfeito
Cada vez menos testes
  de aceitação com
      cucumber

                        source
Mantendo “Valor”
User accessing website
  In order to easy accessing process, As a user
  I can use my facebook account to connect

 When a visitant doesn't have a website account
   Accessing the registration process with facebook
     Should automatically fill in his personal data
     Should not present the password information
rspec + capybara
specs/acceptance/
           facebook_integration.rb
describe "User acessing website", """
  In order to easy accessing process
  As a user
  I can use a facebook account to connect with website""" do
    
   context "When a user doesn't have a go2doc account" do
     context "Acessing registration process with facebook" do
        before do
        end
        it "Should automatically fill in personal data" do
          (CODIGO RSPEC)
        end
        it "Should not present password information" do
          (CODIGO RSPEC)
        end
      end
    end                   https://gist.github.com/2992243
end
Given(:stack) { stack_with(initial_contents) }
  context "when empty" do
    Given(:initial_contents) { [] }
    Then { stack.depth.should == 0 }

    context "when pushing" do
      When { stack.push(:an_item) }

      Then { stack.depth.should == 1 }
      Then { stack.top.should == :an_item }
    end
  end


https://github.com/jimweirich/rspec-given
feature "Articles", %q{
  In order to have an awesome blog
  As an author
  I want to create and manage articles
} do
  background do
    Article.create!(:title => 'One')
  end
  scenario "Article index" do
    visit '/articles'
    page.should have_content('One')
  end

end


https://github.com/cavalle/steak
No final, é
apenas ruby!
Obrigado!
@victorhg
www.Lambda3.com.br

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (10)

Packages
PackagesPackages
Packages
 
WordPress for Witches : WordPress 100
WordPress for Witches : WordPress 100WordPress for Witches : WordPress 100
WordPress for Witches : WordPress 100
 
J309-14 Week One
J309-14 Week OneJ309-14 Week One
J309-14 Week One
 
Web Design Basics for Kids: HTML & CSS
Web Design Basics for Kids: HTML & CSSWeb Design Basics for Kids: HTML & CSS
Web Design Basics for Kids: HTML & CSS
 
Haml, Sass and Compass for Sane Web Development
Haml, Sass and Compass for Sane Web DevelopmentHaml, Sass and Compass for Sane Web Development
Haml, Sass and Compass for Sane Web Development
 
Password Reset Phish Campaign
Password Reset Phish CampaignPassword Reset Phish Campaign
Password Reset Phish Campaign
 
The Users are Restless
The Users are RestlessThe Users are Restless
The Users are Restless
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
2_cucumber
2_cucumber2_cucumber
2_cucumber
 
The Present Future of OAuth
The Present Future of OAuthThe Present Future of OAuth
The Present Future of OAuth
 

Andere mochten auch

Auschwitz open-air-incinerations-by-carlo-mattogno
Auschwitz open-air-incinerations-by-carlo-mattognoAuschwitz open-air-incinerations-by-carlo-mattogno
Auschwitz open-air-incinerations-by-carlo-mattogno
RareBooksnRecords
 

Andere mochten auch (20)

MMCC ADJUNCT WELCOME GUIDE
MMCC ADJUNCT WELCOME GUIDEMMCC ADJUNCT WELCOME GUIDE
MMCC ADJUNCT WELCOME GUIDE
 
Cisco Pass4sure 210-060 Collaboration Certification
Cisco Pass4sure 210-060 Collaboration CertificationCisco Pass4sure 210-060 Collaboration Certification
Cisco Pass4sure 210-060 Collaboration Certification
 
Automated Email Marketing Triggers Silverpop
Automated Email Marketing Triggers SilverpopAutomated Email Marketing Triggers Silverpop
Automated Email Marketing Triggers Silverpop
 
Esperanto por mezlernejoj_redaktebla
Esperanto por mezlernejoj_redakteblaEsperanto por mezlernejoj_redaktebla
Esperanto por mezlernejoj_redaktebla
 
Kimind - Towards Enterprise 2.0
Kimind - Towards Enterprise 2.0Kimind - Towards Enterprise 2.0
Kimind - Towards Enterprise 2.0
 
Recruiting the Next Generation Now
Recruiting the Next Generation NowRecruiting the Next Generation Now
Recruiting the Next Generation Now
 
VF100 SRE connect BCC
VF100 SRE connect BCCVF100 SRE connect BCC
VF100 SRE connect BCC
 
Auschwitz open-air-incinerations-by-carlo-mattogno
Auschwitz open-air-incinerations-by-carlo-mattognoAuschwitz open-air-incinerations-by-carlo-mattogno
Auschwitz open-air-incinerations-by-carlo-mattogno
 
ALPS Showcase
ALPS ShowcaseALPS Showcase
ALPS Showcase
 
Karaoke
KaraokeKaraoke
Karaoke
 
EL MEJOR EMAIL
EL MEJOR EMAIL EL MEJOR EMAIL
EL MEJOR EMAIL
 
Presentacion CDi servicios a empresas
Presentacion CDi servicios a empresasPresentacion CDi servicios a empresas
Presentacion CDi servicios a empresas
 
Ponderaciones
PonderacionesPonderaciones
Ponderaciones
 
Vektorika5
Vektorika5Vektorika5
Vektorika5
 
Cogneon Presentation - Regional and Urban KM
Cogneon Presentation - Regional and Urban KMCogneon Presentation - Regional and Urban KM
Cogneon Presentation - Regional and Urban KM
 
Orden de salida del Km Vertical de Ubiña 2014
Orden de salida del Km Vertical de Ubiña 2014Orden de salida del Km Vertical de Ubiña 2014
Orden de salida del Km Vertical de Ubiña 2014
 
About Interns for Peace
About Interns for PeaceAbout Interns for Peace
About Interns for Peace
 
Unchartered Waters Of Quantified Self - Sleep And Poo.
Unchartered Waters Of Quantified Self - Sleep And Poo.Unchartered Waters Of Quantified Self - Sleep And Poo.
Unchartered Waters Of Quantified Self - Sleep And Poo.
 
Vivienda2
Vivienda2Vivienda2
Vivienda2
 
Manual html
Manual htmlManual html
Manual html
 

Ähnlich wie Largamos o Cucumber!

Dmitry sharkov - Maturing Your Cucumber Suites
Dmitry sharkov   - Maturing Your Cucumber SuitesDmitry sharkov   - Maturing Your Cucumber Suites
Dmitry sharkov - Maturing Your Cucumber Suites
QA or the Highway
 
Testiranje s capybaro
Testiranje s capybaroTestiranje s capybaro
Testiranje s capybaro
Arto Artnik
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Brandon Keepers
 

Ähnlich wie Largamos o Cucumber! (20)

Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
Integration Test With Cucumber And Webrat
Integration Test With Cucumber And WebratIntegration Test With Cucumber And Webrat
Integration Test With Cucumber And Webrat
 
Quick ref capybara
Quick ref capybaraQuick ref capybara
Quick ref capybara
 
Quick ref capybara
Quick ref capybaraQuick ref capybara
Quick ref capybara
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
 
Gherkin for test automation in agile
Gherkin for test automation in agileGherkin for test automation in agile
Gherkin for test automation in agile
 
Design Web Api
Design Web ApiDesign Web Api
Design Web Api
 
How to improve our acceptance tests - Pyccuracy VS Splinter
How to improve our acceptance tests - Pyccuracy VS SplinterHow to improve our acceptance tests - Pyccuracy VS Splinter
How to improve our acceptance tests - Pyccuracy VS Splinter
 
Write Tests in End Users’ Lingo
Write Tests in End Users’ LingoWrite Tests in End Users’ Lingo
Write Tests in End Users’ Lingo
 
Testing ASP.net and C# using Ruby (NDC2010)
Testing ASP.net and C# using Ruby (NDC2010)Testing ASP.net and C# using Ruby (NDC2010)
Testing ASP.net and C# using Ruby (NDC2010)
 
Dmitry sharkov - Maturing Your Cucumber Suites
Dmitry sharkov   - Maturing Your Cucumber SuitesDmitry sharkov   - Maturing Your Cucumber Suites
Dmitry sharkov - Maturing Your Cucumber Suites
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven Testing
 
Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
Testiranje s capybaro
Testiranje s capybaroTestiranje s capybaro
Testiranje s capybaro
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behat
 
Social login integration
Social login integrationSocial login integration
Social login integration
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canada
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 

Mehr von iMasters

Mehr von iMasters (20)

O que você precisa saber para modelar bancos de dados NoSQL - Dani Monteiro
O que você precisa saber para modelar bancos de dados NoSQL - Dani MonteiroO que você precisa saber para modelar bancos de dados NoSQL - Dani Monteiro
O que você precisa saber para modelar bancos de dados NoSQL - Dani Monteiro
 
Postgres: wanted, beloved or dreaded? - Fabio Telles
Postgres: wanted, beloved or dreaded? - Fabio TellesPostgres: wanted, beloved or dreaded? - Fabio Telles
Postgres: wanted, beloved or dreaded? - Fabio Telles
 
Por que minha query esta lenta? - Suellen Moraes
Por que minha query esta lenta? - Suellen MoraesPor que minha query esta lenta? - Suellen Moraes
Por que minha query esta lenta? - Suellen Moraes
 
Relato das trincheiras: o dia a dia de uma consultoria de banco de dados - Ig...
Relato das trincheiras: o dia a dia de uma consultoria de banco de dados - Ig...Relato das trincheiras: o dia a dia de uma consultoria de banco de dados - Ig...
Relato das trincheiras: o dia a dia de uma consultoria de banco de dados - Ig...
 
ORMs heróis ou vilões dentro da arquitetura de dados? - Otávio gonçalves
ORMs heróis ou vilões dentro da arquitetura de dados? - Otávio gonçalvesORMs heróis ou vilões dentro da arquitetura de dados? - Otávio gonçalves
ORMs heróis ou vilões dentro da arquitetura de dados? - Otávio gonçalves
 
SQL e NoSQL trabalhando juntos: uma comparação para obter o melhor de ambos -...
SQL e NoSQL trabalhando juntos: uma comparação para obter o melhor de ambos -...SQL e NoSQL trabalhando juntos: uma comparação para obter o melhor de ambos -...
SQL e NoSQL trabalhando juntos: uma comparação para obter o melhor de ambos -...
 
Arquitetando seus dados na prática para a LGPD - Alessandra Martins
Arquitetando seus dados na prática para a LGPD - Alessandra MartinsArquitetando seus dados na prática para a LGPD - Alessandra Martins
Arquitetando seus dados na prática para a LGPD - Alessandra Martins
 
O papel do DBA no mundo de ciência de dados e machine learning - Mauro Pichil...
O papel do DBA no mundo de ciência de dados e machine learning - Mauro Pichil...O papel do DBA no mundo de ciência de dados e machine learning - Mauro Pichil...
O papel do DBA no mundo de ciência de dados e machine learning - Mauro Pichil...
 
Desenvolvimento Mobile Híbrido, Nativo ou Web: Quando usá-los - Juliana Chahoud
Desenvolvimento Mobile Híbrido, Nativo ou Web: Quando usá-los - Juliana ChahoudDesenvolvimento Mobile Híbrido, Nativo ou Web: Quando usá-los - Juliana Chahoud
Desenvolvimento Mobile Híbrido, Nativo ou Web: Quando usá-los - Juliana Chahoud
 
Use MDD e faça as máquinas trabalharem para você - Andreza Leite
 Use MDD e faça as máquinas trabalharem para você - Andreza Leite Use MDD e faça as máquinas trabalharem para você - Andreza Leite
Use MDD e faça as máquinas trabalharem para você - Andreza Leite
 
Entendendo os porquês do seu servidor - Talita Bernardes
Entendendo os porquês do seu servidor - Talita BernardesEntendendo os porquês do seu servidor - Talita Bernardes
Entendendo os porquês do seu servidor - Talita Bernardes
 
Backend performático além do "coloca mais máquina lá" - Diana Arnos
Backend performático além do "coloca mais máquina lá" - Diana ArnosBackend performático além do "coloca mais máquina lá" - Diana Arnos
Backend performático além do "coloca mais máquina lá" - Diana Arnos
 
Dicas para uma maior performance em APIs REST - Renato Groffe
Dicas para uma maior performance em APIs REST - Renato GroffeDicas para uma maior performance em APIs REST - Renato Groffe
Dicas para uma maior performance em APIs REST - Renato Groffe
 
7 dicas de desempenho que equivalem por 21 - Danielle Monteiro
7 dicas de desempenho que equivalem por 21 - Danielle Monteiro7 dicas de desempenho que equivalem por 21 - Danielle Monteiro
7 dicas de desempenho que equivalem por 21 - Danielle Monteiro
 
Quem se importa com acessibilidade Web? - Mauricio Maujor
Quem se importa com acessibilidade Web? - Mauricio MaujorQuem se importa com acessibilidade Web? - Mauricio Maujor
Quem se importa com acessibilidade Web? - Mauricio Maujor
 
Service Mesh com Istio e Kubernetes - Wellington Figueira da Silva
Service Mesh com Istio e Kubernetes - Wellington Figueira da SilvaService Mesh com Istio e Kubernetes - Wellington Figueira da Silva
Service Mesh com Istio e Kubernetes - Wellington Figueira da Silva
 
Erros: Como eles vivem, se alimentam e se reproduzem? - Augusto Pascutti
Erros: Como eles vivem, se alimentam e se reproduzem? - Augusto PascuttiErros: Como eles vivem, se alimentam e se reproduzem? - Augusto Pascutti
Erros: Como eles vivem, se alimentam e se reproduzem? - Augusto Pascutti
 
Elasticidade e engenharia de banco de dados para alta performance - Rubens G...
Elasticidade e engenharia de banco de dados para alta performance  - Rubens G...Elasticidade e engenharia de banco de dados para alta performance  - Rubens G...
Elasticidade e engenharia de banco de dados para alta performance - Rubens G...
 
Construindo aplicações mais confiantes - Carolina Karklis
Construindo aplicações mais confiantes - Carolina KarklisConstruindo aplicações mais confiantes - Carolina Karklis
Construindo aplicações mais confiantes - Carolina Karklis
 
Monitoramento de Aplicações - Felipe Regalgo
Monitoramento de Aplicações - Felipe RegalgoMonitoramento de Aplicações - Felipe Regalgo
Monitoramento de Aplicações - Felipe Regalgo
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Largamos o Cucumber!

  • 1. @victorhg Largamos o Cucumber http://www.flickr.com/photos/stuartpilbrow/3687751382/
  • 2. Falando sobre cucumber! “BDD outside in” em 2011
  • 3. Bom e velho cucumber   Accessing website with true credentials When I am on the login page And I fill in "email" with "bla@email.com" And I fill in "password" with "qwerty" And I click button "Login" Then I should see "Olá, bla@email.com" smell gerado pelo web_steps.rb
  • 4. Text Não é esse o ponto!!
  • 5. +1 Camada de abstração Mais código para manter Clientes Duplicando código em linguagem natural esperam LER a especificação Clientes não querem escrever testes!
  • 6. Alcançando Valor com Cucumber Acessing website with true credentials: When I am on the login page And I use my credentials Then I should see a welcome message
  • 7. Manutenção continuou um saco! Duplicando rspecs & cucumber steps Refactoring não é perfeito Cada vez menos testes de aceitação com cucumber source
  • 8. Mantendo “Valor” User accessing website In order to easy accessing process, As a user I can use my facebook account to connect When a visitant doesn't have a website account Accessing the registration process with facebook Should automatically fill in his personal data Should not present the password information
  • 10. specs/acceptance/ facebook_integration.rb describe "User acessing website", """ In order to easy accessing process As a user I can use a facebook account to connect with website""" do      context "When a user doesn't have a go2doc account" do      context "Acessing registration process with facebook" do         before do         end         it "Should automatically fill in personal data" do           (CODIGO RSPEC)         end         it "Should not present password information" do           (CODIGO RSPEC)         end       end     end https://gist.github.com/2992243 end
  • 11. Given(:stack) { stack_with(initial_contents) }   context "when empty" do     Given(:initial_contents) { [] }     Then { stack.depth.should == 0 }     context "when pushing" do       When { stack.push(:an_item) }       Then { stack.depth.should == 1 }       Then { stack.top.should == :an_item }     end   end https://github.com/jimweirich/rspec-given
  • 12. feature "Articles", %q{ In order to have an awesome blog As an author I want to create and manage articles } do background do Article.create!(:title => 'One') end scenario "Article index" do visit '/articles' page.should have_content('One') end end https://github.com/cavalle/steak

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n