SlideShare uma empresa Scribd logo
1 de 200
Why Cucumber(s) make
your TYPO3 project
better

Søren Schaffstein,
CEO @ dkd Internet Service GmbH
Frankfurt Germany
                                                         r
                                                       fo s
                                                   ble rian
                                               uita ta
                                            s s ege
                                          ki v
                                       tal and
                                   his ns
                                  T a
                                   v eg
About Cucumbers
Cucumber
Behaviour Driven
Development (BDD)
What is BDD?




 Behaviour Driven Development (BDD)

    Test Driven Development (TDD)
TDD vs. BDD

Test Driven   Behaviour Driven
TDD vs. BDD

Test Driven              Behaviour Driven
 Technical perspective    Business perspective
TDD vs. BDD

Test Driven              Behaviour Driven
 Technical perspective    Business perspective
 Verification focus        Specification focus
TDD vs. BDD

Test Driven              Behaviour Driven
 Technical perspective    Business perspective
 Verification focus        Specification focus
 Unit tests               Acceptance tests
TDD vs. BDD

Test Driven                Behaviour Driven
 Technical perspective      Business perspective
 Verification focus          Specification focus
 Unit tests                 Acceptance tests
 “build the thing right”    “build the right thing”
TDD vs. BDD

Test Driven                Behaviour Driven
 Technical perspective      Business perspective
 Verification focus          Specification focus
 Unit tests                 Acceptance tests
 “build the thing right”    “build the right thing”
                            Documentation
When should we test?


      Before development starts
When should we test?


      Before development starts



        During development
When should we test?


      Before development starts



         During development



    After development has finished
User Acceptance
Tests (UAT)
What is an UAT?

 The client or user specifies a feature and its
 behaviour
What is an UAT?

 The client or user specifies a feature and its
 behaviour
 One or more tests are written to verify the
 intended behaviour
What is an UAT?

 The client or user specifies a feature and its
 behaviour
 One or more tests are written to verify the
 intended behaviour
 If all tests pass, then the client will accept the
 feature as functional
Who should write the tests?
Who should write the tests?




                              Information
                                Architect
Who should write the tests?


            Developer


                              Information
                                Architect
Who should write the tests?


            Developer


                              Information
                                Architect




                  Tester
Who should write the tests?


            Developer


                                      Information
                                        Architect




                            Project
                  Tester
                           Manager
Who should write the tests?


             Developer


                                       Information
Client                                   Architect




                             Project
                   Tester
                            Manager
Why automated testing is great

 It’s easy
Why automated testing is great

 It’s easy
 It’s fast
Why automated testing is great

 It’s easy
 It’s fast
 It’s cheap
Why automated testing is great

 It’s easy
 It’s fast
 It’s cheap
 Complex scenarios can be tested regularly
Why automated testing is great

 It’s easy
 It’s fast
 It’s cheap
 Complex scenarios can be tested regularly
 External components can be tested regularly
Why automated testing is great

 It’s easy
 It’s fast
 It’s cheap
 Complex scenarios can be tested regularly
 External components can be tested regularly
 It increases the overall quality and robustness
Why automated testing is great

 It’s easy
 It’s fast
 It’s cheap
 Complex scenarios can be tested regularly
 External components can be tested regularly
 It increases the overall quality and robustness
 Gives a good feeling of control
dkd contact

Default contact form
Form validation
Addressed contact form
Form aftermath

 Send a confirmation mail to the sender
Form aftermath

 Send a confirmation mail to the sender
 Create a record in the CRM system
Form aftermath

 Send a confirmation mail to the sender
 Create a record in the CRM system
 Temporarily save form data to database
Form aftermath

 Send a confirmation mail to the sender
 Create a record in the CRM system
 Temporarily save form data to database
 For data protection reasons clear form database
 entries after a week
Recurring tests

 Does the website work without “www.”?
Recurring tests

 Does the website work without “www.”?
 Are .htaccess protections switched on/off?
Recurring tests

 Does the website work without “www.”?
 Are .htaccess protections switched on/off?
 Does the website contain a legal notice page?
Recurring tests

 Does the website work without “www.”?
 Are .htaccess protections switched on/off?
 Does the website contain a legal notice page?
 Does the legal notice page contain a
 VAT-number?
Recurring tests

 Does the website work without “www.”?
 Are .htaccess protections switched on/off?
 Does the website contain a legal notice page?
 Does the legal notice page contain a
 VAT-number?
 Does the search work?
Recurring tests

 Does the website work without “www.”?
 Are .htaccess protections switched on/off?
 Does the website contain a legal notice page?
 Does the legal notice page contain a
 VAT-number?
 Does the search work?
 Is the standard-functionality of a certain TYPO3
 extension provided?
Working with
Cucumber
First, let’s say what we want!
First, let’s say what we want!
First, let’s say what we want!

 Given I am on the homepage
First, let’s say what we want!

 Given I am on the homepage
 When I click on the contact link
First, let’s say what we want!

 Given I am on the homepage
 When I click on the contact link
 Then I should see the contact form
Smashing.
That was already nearly perfect Cucumber.
Smashing.
That was already nearly perfect Cucumber.

                        Ghe rkin
Cucumber test structure

Given I am on the homepage
Cucumber test structure

Given I am on the homepage




 Define the initial situation
Cucumber test structure

Given I am on the homepage
When I click on the contact link




 Define the initial situation
 Do something
Cucumber test structure

Given I am on the homepage
When I click on the contact link
Then I should see the contact form


 Define the initial situation
 Do something
 Examine the outcome
Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form
A dash more Gherkin

Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form
Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form
Let’s write some tests for our
form

Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form
Let’s write some tests for our
form

Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    And I wait for 2 seconds
    Then I should see the contact form
Scenario: Submit the form
    Given I am on the homepage
    When I click on the contact link
    And I wait for 2 seconds
    And I submit the contact form
    Then I should see "Thank you!"
Submit the form

Scenario: Submit the form
    Given I am on the homepage
    When I click on the contact link
    And I wait for 2 seconds
    And I submit the contact form
    Then I should see "Thank you!"
Submit the form

Scenario: Submit the form
    Given I am on the contact form
    And I submit the contact form
    Then I should see "Thank you!"
Scenario: Submit the form without any data
    Given I am on the contact form
    And I submit the contact form
    Then I should see "enter a name"
    And I should see "enter an email"
    And I should see "enter a phone number"
    And I should see "enter a message"
How about form validation?

Scenario: Submit the form without any data
    Given I am on the contact form
    And I submit the contact form
    Then I should see "enter a name"
    And I should see "enter an email"
    And I should see "enter a phone number"
    And I should see "enter a message"
Scenario: Submit the form with invalid data
    Given I am on the contact form
    When I fill in "email" with "test"
    And I submit the contact form
    Then I should see "enter an email"
Email validation

Scenario: Submit the form with invalid data
    Given I am on the contact form
    When I fill in "email" with "test"
    And I submit the contact form
    Then I should see "enter an email"
Email validation

Scenario: Submit the form with invalid data
    Given I am on the contact form
    When I fill in "email" with "test"
    And I submit the contact form
    Then I should see "enter an email"
Email validation

Scenario Outline: Submit the form with
typical invalid entries for email
    Given I am on the contact form
    When I fill in "email" with "<test>"
    And I submit the contact form
    Then I should see "enter an email"

   Examples: List of invalid entries
   | test             |
   | not_an_email     |
   | address@no_tld   |
   | no_at_symbol.tld |
A feature has multiple
Scenarios
Feature: Contact form
A feature has multiple
Scenarios
Feature: Contact form
As a website owner I want to have a contact
form so that website visitors can easily
contact us
A feature has multiple
Scenarios
Feature: Contact form
As a website owner I want to have a contact
form so that website visitors can easily
contact us

Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form
A feature has multiple
Scenarios
Feature: Contact form
As a website owner I want to have a contact
form so that website visitors can easily
contact us

Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form

Scenario: Submit the form
    Given I am on the contact form
    And I submit the contact form
    Then I should see "Thank you!"
Testing pitfalls

 Testing the “wrong” state
 Then I should not see "fatal error"
Testing pitfalls

 Testing the “wrong” state
 Then I should not see "fatal error"

 Testing for content on a page that might change
 Then I should see "John Doe"
My client doesn’t speak
english :(
My client doesn’t speak
english :(
 Gherkin is available in over 40 languages
My client doesn’t speak
english :(
 Gherkin is available in over 40 languages
Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form
My client doesn’t speak
english :(
 Gherkin is available in over 40 languages
Scenario: Show default contact form
    Given I am on the homepage
    When I click on the contact link
    Then I should see the contact form


Scenario: Visa standard kontaktformuläret
    Givet jag är på hemsidan
    När jag klickar på kontaktlänken
    Så jag ska se kontaktformuläret
How does Cucumber work?
How does Cucumber work?


   Write a Scenario in Gherkin
How does Cucumber work?


   Write a Scenario in Gherkin

   Cucumber reads each step
How does Cucumber work?


    Write a Scenario in Gherkin

    Cucumber reads each step

For each step you can execute Code:
  Cucumber = Ruby / Behat = PHP              ara
                                          yb s
                                       ap ck
                                      C ro
                                            or ting
                                           f s
                                       we bte
How does Cucumber work?


    Write a Scenario in Gherkin

    Cucumber reads each step

For each step you can execute Code:
  Cucumber = Ruby / Behat = PHP              ara
                                          yb s
                                       ap ck
                                      C ro
                                            or ting
                                           f s
   Cucumber reports about the
                                       we bte
         test results
What Output do I get?

 Cucumber supports different Output formats
What Output do I get?

  Cucumber supports different Output formats

Feature: Check if the default contact form opens when clicking on the link
Kontakt

 Scenario: Show default contact form # features/testfeature.feature:3
   Given I am on the homepage         # features/steps/simple_steps.rb:1
   When I click on the contact link   # features/steps/simple_steps.rb:5
     TODO (Cucumber::Pending)
     ./features/steps/simple_steps.rb:6:in `/^I click on the contact link$/'
     features/testfeature.feature:5:in `When I click on the contact link'
   Then I should see the contact form # features/steps/simple_steps.rb:9

1 scenario (1 pending)
3 steps (1 skipped, 1 pending, 1 passed)
0m14.604s
What Output do I get?

 Cucumber supports different Output formats
How fast can I
How fast can I

  Get Cucumber running in under

  90 seconds
$ sudo gem install cucumber capybara --no-ri --no-rdoc
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

Thank you for installing cucumber-1.1.0.
Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading
for important information about this release. Happy cuking!

(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

Successfully installed cucumber-1.1.0
Successfully installed capybara-1.1.1
2 gems installed




                                                                             35s
                                                                       55s
Install Cucumber

$ sudo gem install cucumber capybara --no-ri --no-rdoc
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

Thank you for installing cucumber-1.1.0.
Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading
for important information about this release. Happy cuking!

(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

Successfully installed cucumber-1.1.0
Successfully installed capybara-1.1.1
2 gems installed




                                                                             35s
                                                                       55s
$ mkdir -p features/{support,steps}




                                      50s
                                            40s
Create directories

$ mkdir -p features/{support,steps}




                                      50s
                                            40s
$ cat > features/contact_form.feature
Feature: Check if the default contact form opens when clicking on the link
Kontakt

   Scenario: Show default contact form
       Given I am on the homepage
       When I click on the contact link
       Then I should see the contact form

<Press ctrl+d>




                                                                      40s
                                                                             50s
Create Feature file

$ cat > features/contact_form.feature
Feature: Check if the default contact form opens when clicking on the link
Kontakt

   Scenario: Show default contact form
       Given I am on the homepage
       When I click on the contact link
       Then I should see the contact form

<Press ctrl+d>




                                                                      40s
                                                                             50s
$ cat > features/steps/steps.rb
Given /^I am on the homepage$/ do
  visit('http://www.dkd.de')
end

When /^I click on the contact link$/ do
  click_link('Kontakt')
end

Then /^I should see the contact form$/ do
  text = 'Call Back'
  if page.respond_to? :should
    page.should have_content(text)
  else
    assert page.has_content?(text)
  end
end                                         30s

<Press ctrl+d>
                                                  60s
Create step definitions file

$ cat > features/steps/steps.rb
Given /^I am on the homepage$/ do
  visit('http://www.dkd.de')
end

When /^I click on the contact link$/ do
  click_link('Kontakt')
end

Then /^I should see the contact form$/ do
  text = 'Call Back'
  if page.respond_to? :should
    page.should have_content(text)
  else
    assert page.has_content?(text)
  end
end                                         30s

<Press ctrl+d>
                                                  60s
$ cat > features/support/env.rb
# Capybara configuration
require 'capybara'
require 'capybara/cucumber'

Capybara.default_driver = :selenium
Capybara.run_server = false

# set the host of the website you want to test
Capybara.app_host = 'http://www.dkd.de'

<Press ctrl+d>




                                                 20s



                                                       70s
Create settings file

$ cat > features/support/env.rb
# Capybara configuration
require 'capybara'
require 'capybara/cucumber'

Capybara.default_driver = :selenium
Capybara.run_server = false

# set the host of the website you want to test
Capybara.app_host = 'http://www.dkd.de'

<Press ctrl+d>




                                                 20s



                                                       70s
$ cucumber
Feature: Check if the default contact form opens when clicking on the link
Kontakt

  Scenario: Show default contact form    #   features/contact_form.feature:3
    Given I am on the homepage           #   features/steps/steps.rb:1
    When I click on the contact link     #   features/steps/steps.rb:5
    Then I should see the contact form   #   features/steps/steps.rb:9

1 scenario (1 passed)
3 steps (3 passed)
0m18.874s



                                                                               1s




                                                                               89s
Run Cucumber

$ cucumber
Feature: Check if the default contact form opens when clicking on the link
Kontakt

  Scenario: Show default contact form    #   features/contact_form.feature:3
    Given I am on the homepage           #   features/steps/steps.rb:1
    When I click on the contact link     #   features/steps/steps.rb:5
    Then I should see the contact form   #   features/steps/steps.rb:9

1 scenario (1 passed)
3 steps (3 passed)
0m18.874s



                                                                               1s




                                                                               89s
Aren’t there already helpful
tests?
 Have a look at https://www.relishapp.com/
Using the right
tool for the job
Useful tools we use at dkd

 Plaintext Editor
Useful tools we use at dkd

 Plaintext Editor
 TextMate with Cucumber Bundle
Useful tools we use at dkd

 Plaintext Editor
 TextMate with Cucumber Bundle
 Redmine
Useful tools we use at dkd

 Plaintext Editor
 TextMate with Cucumber Bundle
 Redmine
 REACTApp
Useful tools we use at dkd

 Plaintext Editor
 TextMate with Cucumber Bundle
 Redmine
 REACTApp
 Jenkins
Use REACTApp
Use Jenkins to
What to take
home
What to take home

 Automate your testing
What to take home

 Automate your testing
 Give Cucumber a try
What to take home

 Automate your testing
 Give Cucumber a try
 If you already do these two,
 connect Cucumber to Jenkins
soeren.schaffstein@dkd.de
dkd
     development
     kommunikation
     design




thank you!
Cocktail ingredients
| Quantity | Ingredient           |
| 1 l       | club soda           |
| 250 ml    | gin                 |
| 60 ml     | lemon juice         |
| 12 slices | lemon               |
| 12 slices | cucumber            |
| 12 slices | sprigs fresh mint   |



Scenario: Refreshing Cucumber Cocktail
    Given I have the ingredients
    When I combine the club soda, gin and lemon juice
    And I place a lemon slice and a cucumber slice in each of 12 glasses
    And I add 1 cup crushed ice to each glass
    And I pour the gin mixture into the glasses and garnish each with a mint sprig
    Then I should get 12 refreshing cocktails
References
References

 Cucumber:
 http://rubygems.org/gems/cucumber
References

 Cucumber:
 http://rubygems.org/gems/cucumber

 Capybara:
 https://github.com/jnicklas/capybara
References

 Cucumber:
 http://rubygems.org/gems/cucumber

 Capybara:
 https://github.com/jnicklas/capybara

 REACT:
 http://reactapp.com/
References

 Cucumber:
 http://rubygems.org/gems/cucumber

 Capybara:
 https://github.com/jnicklas/capybara

 REACT:
 http://reactapp.com/

 Jenkins:
 http://jenkins-ci.org/
Image Reference 1

 Cucumbers: Stephen Ausmus
 http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm
Image Reference 1

 Cucumbers: Stephen Ausmus
 http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm

 Cucumber Sandwich: BitBoy
 http://flickr.com/photos/44124323641@N01/204619671
Image Reference 1

 Cucumbers: Stephen Ausmus
 http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm

 Cucumber Sandwich: BitBoy
 http://flickr.com/photos/44124323641@N01/204619671

 Cucumber Castle: Bee Gees Album Cover
Image Reference 1

 Cucumbers: Stephen Ausmus
 http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm

 Cucumber Sandwich: BitBoy
 http://flickr.com/photos/44124323641@N01/204619671

 Cucumber Castle: Bee Gees Album Cover
 Cucumber Beetle: Scott Bauer
 http://www.ars.usda.gov/is/graphics/photos/index.html
Image Reference 1

 Cucumbers: Stephen Ausmus
 http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm

 Cucumber Sandwich: BitBoy
 http://flickr.com/photos/44124323641@N01/204619671

 Cucumber Castle: Bee Gees Album Cover
 Cucumber Beetle: Scott Bauer
 http://www.ars.usda.gov/is/graphics/photos/index.html

 Cucumber Cocktail: Andrew Mccaul
 http://www.foodnetwork.com/recipes/sandra-lee/lemon-cucumber-
 cocktail-recipe2/index.html
Image Reference 2

 Worker Woman
 http://www.istockphoto.com/stock-photo-14311527-constructor-woman-
 with-level-isolated-on-white.php
Image Reference 2

 Worker Woman
 http://www.istockphoto.com/stock-photo-14311527-constructor-woman-
 with-level-isolated-on-white.php

 Worker Man
 http://www.istockphoto.com/stock-photo-15392840-construction-
 contractor-carpenter-on-white.php
Image Reference 2

 Worker Woman
 http://www.istockphoto.com/stock-photo-14311527-constructor-woman-
 with-level-isolated-on-white.php

 Worker Man
 http://www.istockphoto.com/stock-photo-15392840-construction-
 contractor-carpenter-on-white.php

 Concert
 http://www.istockphoto.com/stock-photo-15502100-concert-
 performance.php
Image Reference 2

 Worker Woman
 http://www.istockphoto.com/stock-photo-14311527-constructor-woman-
 with-level-isolated-on-white.php

 Worker Man
 http://www.istockphoto.com/stock-photo-15392840-construction-
 contractor-carpenter-on-white.php

 Concert
 http://www.istockphoto.com/stock-photo-15502100-concert-
 performance.php

 Questions
 http://www.istockphoto.com/stock-photo-17686236-decision-making.php
Image Reference 3

 Boring
 http://www.istockphoto.com/stock-photo-9660261-depressed-business-
 man.php
Image Reference 3

 Boring
 http://www.istockphoto.com/stock-photo-9660261-depressed-business-
 man.php

 Various Cucumbers
 http://www.istockphoto.com/stock-photo-11184335-hanging-by-a-
 string.php
 http://www.istockphoto.com/stock-photo-2203742-cucumber-on-
 white.php
 http://www.istockphoto.com/stock-photo-11586913-sliced-cucumber-in-
 stack.php
 http://www.istockphoto.com/stock-photo-12083382-pickle-jar.php

Mais conteúdo relacionado

Destaque

Becas Predoctorales Ibercaja de Investigación 2011-2012
Becas Predoctorales Ibercaja de Investigación 2011-2012Becas Predoctorales Ibercaja de Investigación 2011-2012
Becas Predoctorales Ibercaja de Investigación 2011-2012Cext
 
RESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUAS
RESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUASRESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUAS
RESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUASSandra Carolina
 
Fotos Eroticas Religiosas
Fotos Eroticas ReligiosasFotos Eroticas Religiosas
Fotos Eroticas Religiosasprofesorbr
 
Virus informaticos y antivirus
Virus informaticos y antivirusVirus informaticos y antivirus
Virus informaticos y antivirusAlej94
 
TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011
TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011
TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011Erol Dizdar
 
Presentacion proyecto
Presentacion proyectoPresentacion proyecto
Presentacion proyectojeanny.perozo
 
Recomendado salud mental 29 págs. ok
Recomendado salud mental 29 págs. okRecomendado salud mental 29 págs. ok
Recomendado salud mental 29 págs. okvitriolum
 
Paginas de internet
Paginas de internetPaginas de internet
Paginas de internetblckice
 

Destaque (16)

Bdc portfolio
Bdc portfolioBdc portfolio
Bdc portfolio
 
Red Life Marketing
Red Life MarketingRed Life Marketing
Red Life Marketing
 
Becas Predoctorales Ibercaja de Investigación 2011-2012
Becas Predoctorales Ibercaja de Investigación 2011-2012Becas Predoctorales Ibercaja de Investigación 2011-2012
Becas Predoctorales Ibercaja de Investigación 2011-2012
 
RESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUAS
RESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUASRESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUAS
RESPETEMOS EL LEGADO DE LAS CULTURAS ANTICGUAS
 
Fotos Eroticas Religiosas
Fotos Eroticas ReligiosasFotos Eroticas Religiosas
Fotos Eroticas Religiosas
 
Virus informaticos y antivirus
Virus informaticos y antivirusVirus informaticos y antivirus
Virus informaticos y antivirus
 
TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011
TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011
TÜRKİYE ELEKTRONİK HABERLEŞME SEKTÖRÜ VERİLERİ KASIM 2011
 
Presentacion proyecto
Presentacion proyectoPresentacion proyecto
Presentacion proyecto
 
Recomendado salud mental 29 págs. ok
Recomendado salud mental 29 págs. okRecomendado salud mental 29 págs. ok
Recomendado salud mental 29 págs. ok
 
Camino hacia el exito ximena
Camino hacia el exito ximenaCamino hacia el exito ximena
Camino hacia el exito ximena
 
Padrisimo
PadrisimoPadrisimo
Padrisimo
 
La milana
La milanaLa milana
La milana
 
KNX For Home Builders
KNX For Home BuildersKNX For Home Builders
KNX For Home Builders
 
Propuesta Web NTIC Master
Propuesta Web NTIC MasterPropuesta Web NTIC Master
Propuesta Web NTIC Master
 
Bo 06 09-2013-46
Bo 06 09-2013-46Bo 06 09-2013-46
Bo 06 09-2013-46
 
Paginas de internet
Paginas de internetPaginas de internet
Paginas de internet
 

Mais de Søren Schaffstein

Data Alchemy: Turn your Data into Gold
Data Alchemy: Turn your Data into GoldData Alchemy: Turn your Data into Gold
Data Alchemy: Turn your Data into GoldSøren Schaffstein
 
Indoctrinatr – Open Source PDF generation service
Indoctrinatr – Open Source PDF generation serviceIndoctrinatr – Open Source PDF generation service
Indoctrinatr – Open Source PDF generation serviceSøren Schaffstein
 
ForgetIT – Some store to remember, some store to forget
ForgetIT – Some store to remember, some store to forgetForgetIT – Some store to remember, some store to forget
ForgetIT – Some store to remember, some store to forgetSøren Schaffstein
 
Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...
Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...
Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...Søren Schaffstein
 

Mais de Søren Schaffstein (7)

Data Alchemy: Turn your Data into Gold
Data Alchemy: Turn your Data into GoldData Alchemy: Turn your Data into Gold
Data Alchemy: Turn your Data into Gold
 
Indoctrinatr – Open Source PDF generation service
Indoctrinatr – Open Source PDF generation serviceIndoctrinatr – Open Source PDF generation service
Indoctrinatr – Open Source PDF generation service
 
ForgetIT – Some store to remember, some store to forget
ForgetIT – Some store to remember, some store to forgetForgetIT – Some store to remember, some store to forget
ForgetIT – Some store to remember, some store to forget
 
Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...
Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...
Let's play Work – wie Sie mit Gamification Ihre Nutzer involvieren und so Ihr...
 
Lets play TYPO3
Lets play TYPO3Lets play TYPO3
Lets play TYPO3
 
About the TYPO3 Association
About the TYPO3 AssociationAbout the TYPO3 Association
About the TYPO3 Association
 
Scheduling tasks in TYPO3
Scheduling tasks in TYPO3Scheduling tasks in TYPO3
Scheduling tasks in TYPO3
 

Último

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Último (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Why Cucumber(s) make your TYPO3 website better

  • 1.
  • 2. Why Cucumber(s) make your TYPO3 project better Søren Schaffstein, CEO @ dkd Internet Service GmbH Frankfurt Germany r fo s ble rian uita ta s s ege ki v tal and his ns T a v eg
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 16.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 31.
  • 32. What is BDD? Behaviour Driven Development (BDD) Test Driven Development (TDD)
  • 33.
  • 34. TDD vs. BDD Test Driven Behaviour Driven
  • 35. TDD vs. BDD Test Driven Behaviour Driven Technical perspective Business perspective
  • 36. TDD vs. BDD Test Driven Behaviour Driven Technical perspective Business perspective Verification focus Specification focus
  • 37. TDD vs. BDD Test Driven Behaviour Driven Technical perspective Business perspective Verification focus Specification focus Unit tests Acceptance tests
  • 38. TDD vs. BDD Test Driven Behaviour Driven Technical perspective Business perspective Verification focus Specification focus Unit tests Acceptance tests “build the thing right” “build the right thing”
  • 39. TDD vs. BDD Test Driven Behaviour Driven Technical perspective Business perspective Verification focus Specification focus Unit tests Acceptance tests “build the thing right” “build the right thing” Documentation
  • 40.
  • 41. When should we test? Before development starts
  • 42. When should we test? Before development starts During development
  • 43. When should we test? Before development starts During development After development has finished
  • 44.
  • 46.
  • 47. What is an UAT? The client or user specifies a feature and its behaviour
  • 48. What is an UAT? The client or user specifies a feature and its behaviour One or more tests are written to verify the intended behaviour
  • 49. What is an UAT? The client or user specifies a feature and its behaviour One or more tests are written to verify the intended behaviour If all tests pass, then the client will accept the feature as functional
  • 50.
  • 51. Who should write the tests?
  • 52. Who should write the tests? Information Architect
  • 53. Who should write the tests? Developer Information Architect
  • 54. Who should write the tests? Developer Information Architect Tester
  • 55. Who should write the tests? Developer Information Architect Project Tester Manager
  • 56. Who should write the tests? Developer Information Client Architect Project Tester Manager
  • 57.
  • 58. Why automated testing is great It’s easy
  • 59. Why automated testing is great It’s easy It’s fast
  • 60. Why automated testing is great It’s easy It’s fast It’s cheap
  • 61. Why automated testing is great It’s easy It’s fast It’s cheap Complex scenarios can be tested regularly
  • 62. Why automated testing is great It’s easy It’s fast It’s cheap Complex scenarios can be tested regularly External components can be tested regularly
  • 63. Why automated testing is great It’s easy It’s fast It’s cheap Complex scenarios can be tested regularly External components can be tested regularly It increases the overall quality and robustness
  • 64. Why automated testing is great It’s easy It’s fast It’s cheap Complex scenarios can be tested regularly External components can be tested regularly It increases the overall quality and robustness Gives a good feeling of control
  • 65.
  • 66. dkd contact Default contact form Form validation Addressed contact form
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74. Form aftermath Send a confirmation mail to the sender
  • 75. Form aftermath Send a confirmation mail to the sender Create a record in the CRM system
  • 76. Form aftermath Send a confirmation mail to the sender Create a record in the CRM system Temporarily save form data to database
  • 77. Form aftermath Send a confirmation mail to the sender Create a record in the CRM system Temporarily save form data to database For data protection reasons clear form database entries after a week
  • 78.
  • 79. Recurring tests Does the website work without “www.”?
  • 80. Recurring tests Does the website work without “www.”? Are .htaccess protections switched on/off?
  • 81. Recurring tests Does the website work without “www.”? Are .htaccess protections switched on/off? Does the website contain a legal notice page?
  • 82. Recurring tests Does the website work without “www.”? Are .htaccess protections switched on/off? Does the website contain a legal notice page? Does the legal notice page contain a VAT-number?
  • 83. Recurring tests Does the website work without “www.”? Are .htaccess protections switched on/off? Does the website contain a legal notice page? Does the legal notice page contain a VAT-number? Does the search work?
  • 84. Recurring tests Does the website work without “www.”? Are .htaccess protections switched on/off? Does the website contain a legal notice page? Does the legal notice page contain a VAT-number? Does the search work? Is the standard-functionality of a certain TYPO3 extension provided?
  • 85.
  • 87.
  • 88. First, let’s say what we want!
  • 89. First, let’s say what we want!
  • 90. First, let’s say what we want! Given I am on the homepage
  • 91. First, let’s say what we want! Given I am on the homepage When I click on the contact link
  • 92. First, let’s say what we want! Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 93. Smashing. That was already nearly perfect Cucumber.
  • 94. Smashing. That was already nearly perfect Cucumber. Ghe rkin
  • 95.
  • 96. Cucumber test structure Given I am on the homepage
  • 97. Cucumber test structure Given I am on the homepage Define the initial situation
  • 98. Cucumber test structure Given I am on the homepage When I click on the contact link Define the initial situation Do something
  • 99. Cucumber test structure Given I am on the homepage When I click on the contact link Then I should see the contact form Define the initial situation Do something Examine the outcome
  • 100. Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 101. A dash more Gherkin Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 102. Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 103. Let’s write some tests for our form Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 104. Let’s write some tests for our form Scenario: Show default contact form Given I am on the homepage When I click on the contact link And I wait for 2 seconds Then I should see the contact form
  • 105. Scenario: Submit the form Given I am on the homepage When I click on the contact link And I wait for 2 seconds And I submit the contact form Then I should see "Thank you!"
  • 106. Submit the form Scenario: Submit the form Given I am on the homepage When I click on the contact link And I wait for 2 seconds And I submit the contact form Then I should see "Thank you!"
  • 107. Submit the form Scenario: Submit the form Given I am on the contact form And I submit the contact form Then I should see "Thank you!"
  • 108. Scenario: Submit the form without any data Given I am on the contact form And I submit the contact form Then I should see "enter a name" And I should see "enter an email" And I should see "enter a phone number" And I should see "enter a message"
  • 109. How about form validation? Scenario: Submit the form without any data Given I am on the contact form And I submit the contact form Then I should see "enter a name" And I should see "enter an email" And I should see "enter a phone number" And I should see "enter a message"
  • 110. Scenario: Submit the form with invalid data Given I am on the contact form When I fill in "email" with "test" And I submit the contact form Then I should see "enter an email"
  • 111. Email validation Scenario: Submit the form with invalid data Given I am on the contact form When I fill in "email" with "test" And I submit the contact form Then I should see "enter an email"
  • 112. Email validation Scenario: Submit the form with invalid data Given I am on the contact form When I fill in "email" with "test" And I submit the contact form Then I should see "enter an email"
  • 113. Email validation Scenario Outline: Submit the form with typical invalid entries for email Given I am on the contact form When I fill in "email" with "<test>" And I submit the contact form Then I should see "enter an email" Examples: List of invalid entries | test | | not_an_email | | address@no_tld | | no_at_symbol.tld |
  • 114.
  • 115. A feature has multiple Scenarios Feature: Contact form
  • 116. A feature has multiple Scenarios Feature: Contact form As a website owner I want to have a contact form so that website visitors can easily contact us
  • 117. A feature has multiple Scenarios Feature: Contact form As a website owner I want to have a contact form so that website visitors can easily contact us Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 118. A feature has multiple Scenarios Feature: Contact form As a website owner I want to have a contact form so that website visitors can easily contact us Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form Scenario: Submit the form Given I am on the contact form And I submit the contact form Then I should see "Thank you!"
  • 119.
  • 120. Testing pitfalls Testing the “wrong” state Then I should not see "fatal error"
  • 121. Testing pitfalls Testing the “wrong” state Then I should not see "fatal error" Testing for content on a page that might change Then I should see "John Doe"
  • 122.
  • 123. My client doesn’t speak english :(
  • 124. My client doesn’t speak english :( Gherkin is available in over 40 languages
  • 125. My client doesn’t speak english :( Gherkin is available in over 40 languages Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form
  • 126. My client doesn’t speak english :( Gherkin is available in over 40 languages Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form Scenario: Visa standard kontaktformuläret Givet jag är på hemsidan När jag klickar på kontaktlänken Så jag ska se kontaktformuläret
  • 127.
  • 129. How does Cucumber work? Write a Scenario in Gherkin
  • 130. How does Cucumber work? Write a Scenario in Gherkin Cucumber reads each step
  • 131. How does Cucumber work? Write a Scenario in Gherkin Cucumber reads each step For each step you can execute Code: Cucumber = Ruby / Behat = PHP ara yb s ap ck C ro or ting f s we bte
  • 132. How does Cucumber work? Write a Scenario in Gherkin Cucumber reads each step For each step you can execute Code: Cucumber = Ruby / Behat = PHP ara yb s ap ck C ro or ting f s Cucumber reports about the we bte test results
  • 133.
  • 134. What Output do I get? Cucumber supports different Output formats
  • 135. What Output do I get? Cucumber supports different Output formats Feature: Check if the default contact form opens when clicking on the link Kontakt Scenario: Show default contact form # features/testfeature.feature:3 Given I am on the homepage # features/steps/simple_steps.rb:1 When I click on the contact link # features/steps/simple_steps.rb:5 TODO (Cucumber::Pending) ./features/steps/simple_steps.rb:6:in `/^I click on the contact link$/' features/testfeature.feature:5:in `When I click on the contact link' Then I should see the contact form # features/steps/simple_steps.rb:9 1 scenario (1 pending) 3 steps (1 skipped, 1 pending, 1 passed) 0m14.604s
  • 136. What Output do I get? Cucumber supports different Output formats
  • 137.
  • 139. How fast can I Get Cucumber running in under 90 seconds
  • 140. $ sudo gem install cucumber capybara --no-ri --no-rdoc (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) Thank you for installing cucumber-1.1.0. Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading for important information about this release. Happy cuking! (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) Successfully installed cucumber-1.1.0 Successfully installed capybara-1.1.1 2 gems installed 35s 55s
  • 141. Install Cucumber $ sudo gem install cucumber capybara --no-ri --no-rdoc (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) Thank you for installing cucumber-1.1.0. Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading for important information about this release. Happy cuking! (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) Successfully installed cucumber-1.1.0 Successfully installed capybara-1.1.1 2 gems installed 35s 55s
  • 142. $ mkdir -p features/{support,steps} 50s 40s
  • 143. Create directories $ mkdir -p features/{support,steps} 50s 40s
  • 144. $ cat > features/contact_form.feature Feature: Check if the default contact form opens when clicking on the link Kontakt Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form <Press ctrl+d> 40s 50s
  • 145. Create Feature file $ cat > features/contact_form.feature Feature: Check if the default contact form opens when clicking on the link Kontakt Scenario: Show default contact form Given I am on the homepage When I click on the contact link Then I should see the contact form <Press ctrl+d> 40s 50s
  • 146. $ cat > features/steps/steps.rb Given /^I am on the homepage$/ do visit('http://www.dkd.de') end When /^I click on the contact link$/ do click_link('Kontakt') end Then /^I should see the contact form$/ do text = 'Call Back' if page.respond_to? :should page.should have_content(text) else assert page.has_content?(text) end end 30s <Press ctrl+d> 60s
  • 147. Create step definitions file $ cat > features/steps/steps.rb Given /^I am on the homepage$/ do visit('http://www.dkd.de') end When /^I click on the contact link$/ do click_link('Kontakt') end Then /^I should see the contact form$/ do text = 'Call Back' if page.respond_to? :should page.should have_content(text) else assert page.has_content?(text) end end 30s <Press ctrl+d> 60s
  • 148. $ cat > features/support/env.rb # Capybara configuration require 'capybara' require 'capybara/cucumber' Capybara.default_driver = :selenium Capybara.run_server = false # set the host of the website you want to test Capybara.app_host = 'http://www.dkd.de' <Press ctrl+d> 20s 70s
  • 149. Create settings file $ cat > features/support/env.rb # Capybara configuration require 'capybara' require 'capybara/cucumber' Capybara.default_driver = :selenium Capybara.run_server = false # set the host of the website you want to test Capybara.app_host = 'http://www.dkd.de' <Press ctrl+d> 20s 70s
  • 150. $ cucumber Feature: Check if the default contact form opens when clicking on the link Kontakt Scenario: Show default contact form # features/contact_form.feature:3 Given I am on the homepage # features/steps/steps.rb:1 When I click on the contact link # features/steps/steps.rb:5 Then I should see the contact form # features/steps/steps.rb:9 1 scenario (1 passed) 3 steps (3 passed) 0m18.874s 1s 89s
  • 151. Run Cucumber $ cucumber Feature: Check if the default contact form opens when clicking on the link Kontakt Scenario: Show default contact form # features/contact_form.feature:3 Given I am on the homepage # features/steps/steps.rb:1 When I click on the contact link # features/steps/steps.rb:5 Then I should see the contact form # features/steps/steps.rb:9 1 scenario (1 passed) 3 steps (3 passed) 0m18.874s 1s 89s
  • 152.
  • 153. Aren’t there already helpful tests? Have a look at https://www.relishapp.com/
  • 154.
  • 155. Using the right tool for the job
  • 156.
  • 157. Useful tools we use at dkd Plaintext Editor
  • 158. Useful tools we use at dkd Plaintext Editor TextMate with Cucumber Bundle
  • 159. Useful tools we use at dkd Plaintext Editor TextMate with Cucumber Bundle Redmine
  • 160. Useful tools we use at dkd Plaintext Editor TextMate with Cucumber Bundle Redmine REACTApp
  • 161. Useful tools we use at dkd Plaintext Editor TextMate with Cucumber Bundle Redmine REACTApp Jenkins
  • 162.
  • 164.
  • 165.
  • 167.
  • 168.
  • 169.
  • 171.
  • 172. What to take home Automate your testing
  • 173. What to take home Automate your testing Give Cucumber a try
  • 174. What to take home Automate your testing Give Cucumber a try If you already do these two, connect Cucumber to Jenkins
  • 175.
  • 177.
  • 178. dkd development kommunikation design thank you!
  • 179. Cocktail ingredients | Quantity | Ingredient | | 1 l | club soda | | 250 ml | gin | | 60 ml | lemon juice | | 12 slices | lemon | | 12 slices | cucumber | | 12 slices | sprigs fresh mint | Scenario: Refreshing Cucumber Cocktail Given I have the ingredients When I combine the club soda, gin and lemon juice And I place a lemon slice and a cucumber slice in each of 12 glasses And I add 1 cup crushed ice to each glass And I pour the gin mixture into the glasses and garnish each with a mint sprig Then I should get 12 refreshing cocktails
  • 180.
  • 182.
  • 184. References Cucumber: http://rubygems.org/gems/cucumber Capybara: https://github.com/jnicklas/capybara
  • 185. References Cucumber: http://rubygems.org/gems/cucumber Capybara: https://github.com/jnicklas/capybara REACT: http://reactapp.com/
  • 186. References Cucumber: http://rubygems.org/gems/cucumber Capybara: https://github.com/jnicklas/capybara REACT: http://reactapp.com/ Jenkins: http://jenkins-ci.org/
  • 187.
  • 188. Image Reference 1 Cucumbers: Stephen Ausmus http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm
  • 189. Image Reference 1 Cucumbers: Stephen Ausmus http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm Cucumber Sandwich: BitBoy http://flickr.com/photos/44124323641@N01/204619671
  • 190. Image Reference 1 Cucumbers: Stephen Ausmus http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm Cucumber Sandwich: BitBoy http://flickr.com/photos/44124323641@N01/204619671 Cucumber Castle: Bee Gees Album Cover
  • 191. Image Reference 1 Cucumbers: Stephen Ausmus http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm Cucumber Sandwich: BitBoy http://flickr.com/photos/44124323641@N01/204619671 Cucumber Castle: Bee Gees Album Cover Cucumber Beetle: Scott Bauer http://www.ars.usda.gov/is/graphics/photos/index.html
  • 192. Image Reference 1 Cucumbers: Stephen Ausmus http://www.ars.usda.gov/is/graphics/photos/mar07/d730-30.htm Cucumber Sandwich: BitBoy http://flickr.com/photos/44124323641@N01/204619671 Cucumber Castle: Bee Gees Album Cover Cucumber Beetle: Scott Bauer http://www.ars.usda.gov/is/graphics/photos/index.html Cucumber Cocktail: Andrew Mccaul http://www.foodnetwork.com/recipes/sandra-lee/lemon-cucumber- cocktail-recipe2/index.html
  • 193.
  • 194. Image Reference 2 Worker Woman http://www.istockphoto.com/stock-photo-14311527-constructor-woman- with-level-isolated-on-white.php
  • 195. Image Reference 2 Worker Woman http://www.istockphoto.com/stock-photo-14311527-constructor-woman- with-level-isolated-on-white.php Worker Man http://www.istockphoto.com/stock-photo-15392840-construction- contractor-carpenter-on-white.php
  • 196. Image Reference 2 Worker Woman http://www.istockphoto.com/stock-photo-14311527-constructor-woman- with-level-isolated-on-white.php Worker Man http://www.istockphoto.com/stock-photo-15392840-construction- contractor-carpenter-on-white.php Concert http://www.istockphoto.com/stock-photo-15502100-concert- performance.php
  • 197. Image Reference 2 Worker Woman http://www.istockphoto.com/stock-photo-14311527-constructor-woman- with-level-isolated-on-white.php Worker Man http://www.istockphoto.com/stock-photo-15392840-construction- contractor-carpenter-on-white.php Concert http://www.istockphoto.com/stock-photo-15502100-concert- performance.php Questions http://www.istockphoto.com/stock-photo-17686236-decision-making.php
  • 198.
  • 199. Image Reference 3 Boring http://www.istockphoto.com/stock-photo-9660261-depressed-business- man.php
  • 200. Image Reference 3 Boring http://www.istockphoto.com/stock-photo-9660261-depressed-business- man.php Various Cucumbers http://www.istockphoto.com/stock-photo-11184335-hanging-by-a- string.php http://www.istockphoto.com/stock-photo-2203742-cucumber-on- white.php http://www.istockphoto.com/stock-photo-11586913-sliced-cucumber-in- stack.php http://www.istockphoto.com/stock-photo-12083382-pickle-jar.php

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. * married to Simone* traveling - photography - scuba diving - LEGOs\n* photography, LEGO, scuba diving, traveling\n
  7. * married to Simone* traveling - photography - scuba diving - LEGOs\n* photography, LEGO, scuba diving, traveling\n
  8. * married to Simone* traveling - photography - scuba diving - LEGOs\n* photography, LEGO, scuba diving, traveling\n
  9. * married to Simone* traveling - photography - scuba diving - LEGOs\n* photography, LEGO, scuba diving, traveling\n
  10. * married to Simone* traveling - photography - scuba diving - LEGOs\n* photography, LEGO, scuba diving, traveling\n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. Cucumber Sandwich, a type of sandwich\n
  19. Cucumber, a community in West Virginia, USA\n
  20. Cucumber (TV series), a Canadian children&apos;s television series originally broadcast in the 1970s\n
  21. Cucumber Castle, a 1970 album released by the Bee Gees\n
  22. Cucumber beetle, a type of beetle.\n
  23. Sea cucumber, a type of animal\n
  24. Cucumber (software), a Behavior Driven Development tool.\n\n
  25. \n
  26. \n
  27. \n
  28. write tests first then develop\n
  29. write tests first then develop\n
  30. write tests first then develop\n
  31. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  32. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  33. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  34. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  35. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  36. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  37. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  38. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  39. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  40. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  41. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  42. TDD example: add-function 2+3=5\nBDD example: I&amp;#x2019;d like to add 2+3 and get 5\nIn this talk we will explore BDD a bit further\n
  43. 1: definition is clear between you and the client. Calculation can be done\n2: developers know what to develop and see if they break something\n3: make sure everything stays functional (externals can change: flickr example)\n
  44. 1: definition is clear between you and the client. Calculation can be done\n2: developers know what to develop and see if they break something\n3: make sure everything stays functional (externals can change: flickr example)\n
  45. 1: definition is clear between you and the client. Calculation can be done\n2: developers know what to develop and see if they break something\n3: make sure everything stays functional (externals can change: flickr example)\n
  46. 1: definition is clear between you and the client. Calculation can be done\n2: developers know what to develop and see if they break something\n3: make sure everything stays functional (externals can change: flickr example)\n
  47. 1: definition is clear between you and the client. Calculation can be done\n2: developers know what to develop and see if they break something\n3: make sure everything stays functional (externals can change: flickr example)\n
  48. 1: definition is clear between you and the client. Calculation can be done\n2: developers know what to develop and see if they break something\n3: make sure everything stays functional (externals can change: flickr example)\n
  49. \n
  50. \n
  51. Feature: contact form Behaviour: \n* Name, email, message field\n* email may not be blank\n* form must be saved to database\n
  52. Feature: contact form Behaviour: \n* Name, email, message field\n* email may not be blank\n* form must be saved to database\n
  53. Feature: contact form Behaviour: \n* Name, email, message field\n* email may not be blank\n* form must be saved to database\n
  54. Feature: contact form Behaviour: \n* Name, email, message field\n* email may not be blank\n* form must be saved to database\n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. Video: Contact form: Happy Path\n
  79. Video: contact form validation\n
  80. Video: addressed contact form\n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. 1 &amp; 2: tend to get forgotten\n
  87. 1 &amp; 2: tend to get forgotten\n
  88. 1 &amp; 2: tend to get forgotten\n
  89. 1 &amp; 2: tend to get forgotten\n
  90. 1 &amp; 2: tend to get forgotten\n
  91. 1 &amp; 2: tend to get forgotten\n
  92. 1 &amp; 2: tend to get forgotten\n
  93. \n
  94. \n
  95. \n
  96. Explain what we want in plain english\n
  97. Explain what we want in plain english\n
  98. Explain what we want in plain english\n
  99. Explain what we want in plain english\n
  100. Explain what we want in plain english\n
  101. Explain what we want in plain english\n
  102. Explain what we want in plain english\n
  103. \n
  104. \n
  105. Each Cucumber test starts without knowing about other tests\n
  106. Each Cucumber test starts without knowing about other tests\n
  107. Each Cucumber test starts without knowing about other tests\n
  108. Each Cucumber test starts without knowing about other tests\n
  109. Each Cucumber test starts without knowing about other tests\n
  110. Each Cucumber test starts without knowing about other tests\n
  111. Each Cucumber test starts without knowing about other tests\n
  112. Introducing the &amp;#x201C;Scenario&amp;#x201D; keyword\n
  113. Ok this was a simple example. But what when it get&amp;#x2019;s more complicated. Is it still easy?\n
  114. Ok this was a simple example. But what when it get&amp;#x2019;s more complicated. Is it still easy?\n
  115. Ok this was a simple example. But what when it get&amp;#x2019;s more complicated. Is it still easy?\n
  116. Just write the important stuff in the tests\n
  117. Just write the important stuff in the tests\n
  118. Just write the important stuff in the tests\n
  119. \n
  120. I don&amp;#x2019;t test the other validation options for two reasons:\n* keep the test short and simple\n* test only one thing at a time (to keep things atomic)\n
  121. I don&amp;#x2019;t test the other validation options for two reasons:\n* keep the test short and simple\n* test only one thing at a time (to keep things atomic)\n
  122. I don&amp;#x2019;t test the other validation options for two reasons:\n* keep the test short and simple\n* test only one thing at a time (to keep things atomic)\n
  123. I don&amp;#x2019;t test the other validation options for two reasons:\n* keep the test short and simple\n* test only one thing at a time (to keep things atomic)\n
  124. I don&amp;#x2019;t test the other validation options for two reasons:\n* keep the test short and simple\n* test only one thing at a time (to keep things atomic)\n
  125. feature\n
  126. feature\n
  127. feature\n
  128. feature\n
  129. feature\n
  130. \n
  131. \n
  132. \n
  133. And yes, it&amp;#x2019;s available in &amp;#x201C;pirate english&amp;#x201D;\n
  134. And yes, it&amp;#x2019;s available in &amp;#x201C;pirate english&amp;#x201D;\n
  135. And yes, it&amp;#x2019;s available in &amp;#x201C;pirate english&amp;#x201D;\n
  136. And yes, it&amp;#x2019;s available in &amp;#x201C;pirate english&amp;#x201D;\n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. PDF, JSON\n
  144. PDF, JSON\n
  145. PDF, JSON\n
  146. PDF, JSON\n
  147. PDF, JSON\n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. Redmine = Backlog\nReactualize = User Stories\nJenkins = Worker\n
  163. Redmine = Backlog\nReactualize = User Stories\nJenkins = Worker\n
  164. Redmine = Backlog\nReactualize = User Stories\nJenkins = Worker\n
  165. Redmine = Backlog\nReactualize = User Stories\nJenkins = Worker\n
  166. Redmine = Backlog\nReactualize = User Stories\nJenkins = Worker\n
  167. Redmine = Backlog\nReactualize = User Stories\nJenkins = Worker\n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. Now&amp;#x2019;s the time to ask your questions\nIf you&amp;#x2019;d like to have a more detailed discussion with me, feel free to visit me at the dkd booth today at XXX or send an email\n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n
  200. \n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n
  210. \n
  211. \n
  212. \n