SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
Fernando Sandes




How to
improve our
acceptance tests !
What is
     better?




Pyccuracy
         vs
It`s not (only)
   about
the technology
It`s an
ideologica
  difference
@gabrielfalcao
           Lettuce`s creator




The problem is that differently of
cucumber and lettuce, pyccuracy is
aimed to web testing, with pre-defined
"step definitions" (pyccuracy uses a
different nomenclature), and when I was
using it I found extremely hard to
maintain the tests as the test suite
grows, it's a hell!




                               lettuce
@gabrielfalcao
            Lettuce`s creator




“So I wrote lettuce to make it super flexible
so that I could write my own definitions in a super
easy way, and never couple my tests to robotic
step definitions.”



                                lettuce
Pyccuracy


    ROBOTIC
    STEP
  DEFINITIONS
ROBOTIC                              STEP        DEFINITIONS

Given I fill the field "#username" with "test"

And I fill the field "#password" with "1234"

When I click on the button 'input[type="submit"]'

Then I see the page contains the text "Hello Test User!"




                                                 Given I am at the login page

                                                 And I fill in the login information with "test" and password "1234"

                                                 When I click on the login button

                                                 Then I see I'm logged in as a normal user
ROBOTIC                              STEP        DEFINITIONS

Given I fill the field "#username" with "test"

And I fill the field "#password" with "1234"

When I click on the button 'input[type="submit"]'

Then I see the page contains the text "Hello Test User!"

                                                                        “You can see how your
                                                                        business it better defined here”



                                                 Given I am at the login page

                                                 And I fill in the login information with "test" and password "1234"

                                                 When I click on the login button

                                                 Then I see I'm logged in as a normal user
DONT`T BE
                           THE
                                           BOILING
                                           FROG               !
The presence of step definitions leads people down a very
bad path.
While it gives people a head start in writing scenarios it
also tricks people into writing scenarios are extremely
verbose and fragile.
People don't always realize this, so they continue cranking
out lots of crap scenarios based on pre-steps. This is like
the boiling frog story
IT`S ABOUT                      THE      DOMAIN !


 The “domain” is defined by the value
                             the stakeholders
 and users hope to achieve with the software.
 This can be booking a ticket or sharing pictures with friends or
 an infinite number of activities.


 Clicking links and buttons or filling in text fields has nothing
 (directly) to do with the domain.
Pyccuracy
IS BUROCRATIC !
a little more…
Imperative
         VS
           Declarative

            Scenarios in User Stories
The imperative style uses highly reusable

Imperative                                 granular steps which outlines
                                           user interface.
                                                                           much of the


                                           This binds the scenario to that interface.




Scenario: Successful login

Given a user "Aslak" with password "xyz"
And I am on the login page
And I fill in "User name" with "Aslak"
And I fill in "Password" with "xyz"
When I press "Log in"
Then I should see "Welcome, Aslak“
The imperative style uses highly reusable

Imperative                                 granular steps which outlines
                                           user interface.
                                                                            much of the


                                           This binds the scenario to that interface.




Scenario: Successful login                  Scenario: User is greeted upon login

Given a user "Aslak" with password "xyz"    Given the user "Aslak" has an account
And I am on the login page                  When he logs in
And I fill in "User name" with "Aslak"      Then he should see "Welcome, Aslak"
And I fill in "Password" with "xyz"
When I press "Log in"
Then I should see "Welcome, Aslak“




                                           Declarative
The imperative style uses highly reusable

Imperative                                 granular steps which outlines
                                           user interface.
                                                                            much of the


                                           This binds the scenario to that interface.




Scenario: Successful login                  Scenario: User is greeted upon login

Given a user "Aslak" with password "xyz"    Given the user "Aslak" has an account
And I am on the login page                  When he logs in
And I fill in "User name" with "Aslak"      Then he should see "Welcome, Aslak"
And I fill in "Password" with "xyz"
When I press "Log in"
Then I should see "Welcome, Aslak“




                                           Declarative
Imperative Declarative


When we’re describing other parts of the system that
require login, the login details like user name, password
and how to log in are only distracting. That is why
we make it a one-liner.
Imperative Declarative
Imperative Declarative
COMMUNICATION
                      IS THE
                                 GOAL!

  To use a BDD tool "right", one has to understand
  that the main goal is primarily about
  communication and secondarily
  about testing.
COMING BACK…


         And   about
         technology
SPLINTER
Splinter was not created to be another acceptance
tool, but an abstract   layer over other
tools,  its goal is provide a unique API that make
acceptance testing easier and funnier :)
SPLINTER

A LOT OF OPTIONS !
HEADLESS   OR NOT HEADLESS ?
HEADLESS



FAST

CHEAP

HARD TO DEBUG

IT`S NOT A BROWSER!
NOT HEADLESS



SLOW

EASY TO DEBUG

USE THE BROWSER
HEADLESS

NOT HEADLESS
 SPLINTER
SERVER




LOCAL
SERVER




        HEADLESS
LOCAL
NOT HEADLESS
                   SERVER




               HEADLESS
    LOCAL
SPLINTER
 and more…

http status code
multi webdrivers
css ,xpath, tag, name selectors
support to iframe and alert
execute javascript
work's with ajax and async javascript
SPLINTER
Browser

• visit(‘url’)
• reload()
• quit()
• html
• url
• title
SPLINTER
Searching elements


• find_by_css(‘.classe’)
• find_by_id(‘meuid’)
• find_by_xpath(‘//body’)
• find_by_tag(‘a’)
• find_by_name(‘search’)
SPLINTER
 Forms


• fill(‘name’, ‘value’)
• attach_file(‘name’, ‘/path/to/file.txt’)
• check(‘name’) #checkbox
• choose(‘name’, ‘value’) #radio button
• select(‘name’, ‘option’)
MORE


TESTS
SIKULI
         http://sikuli.org/index.shtml
NEEDLE
                   http://needle.readthedocs.org


                #AUTOMATED TESTS FOR CSS


  from needle.cases import NeedleTestCase


  class GoogleTest(NeedleTestCase):
    def test_footer(self):
      self.driver.get('http://www.google.com')
      e = self.driver.find_element_by_id('fctr')
      self.assertScreenshot(e, 'google-footer')
      self.assertEqual(e.get_computed_property('font-size'), '13px')

Mais conteúdo relacionado

Destaque

End to End Testing: Bug Squashing for API Developers
End to End Testing: Bug Squashing for API Developers End to End Testing: Bug Squashing for API Developers
End to End Testing: Bug Squashing for API Developers Apigee | Google Cloud
 
Rails testing: factories or fixtures?
Rails testing: factories or fixtures?Rails testing: factories or fixtures?
Rails testing: factories or fixtures?mtoppa
 
Automated testing with RSpec
Automated testing with RSpecAutomated testing with RSpec
Automated testing with RSpecNascenia IT
 
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...Apigee | Google Cloud
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationJohn Ferguson Smart Limited
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 

Destaque (10)

[RuPy 2011] Automatic Acceptance Tests in Ruby
[RuPy 2011] Automatic Acceptance Tests in Ruby[RuPy 2011] Automatic Acceptance Tests in Ruby
[RuPy 2011] Automatic Acceptance Tests in Ruby
 
End to End Testing: Bug Squashing for API Developers
End to End Testing: Bug Squashing for API Developers End to End Testing: Bug Squashing for API Developers
End to End Testing: Bug Squashing for API Developers
 
Rails testing: factories or fixtures?
Rails testing: factories or fixtures?Rails testing: factories or fixtures?
Rails testing: factories or fixtures?
 
Automated testing with RSpec
Automated testing with RSpecAutomated testing with RSpec
Automated testing with RSpec
 
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
Real-time hypermedia APIs: Exploring the fundamentals of how we build network...
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 

Semelhante a How to improve our acceptance tests - Pyccuracy VS Splinter

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 projectsKonstantin Kudryashov
 
Write Tests in End Users’ Lingo
Write Tests in End Users’ LingoWrite Tests in End Users’ Lingo
Write Tests in End Users’ LingoIndicThreads
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven TestingBrian Hogan
 
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsSteve Malsam
 
I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)xsist10
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoRodrigo Urubatan
 
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 behatxsist10
 
Quick ref capybara
Quick ref capybaraQuick ref capybara
Quick ref capybarafatec
 
Quick ref capybara
Quick ref capybaraQuick ref capybara
Quick ref capybarafatec
 
Android testing calabash
Android testing calabashAndroid testing calabash
Android testing calabashkellinreaver
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)Jean-Michel Garnier
 
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 2014Jean-Loup Yu
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
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 Canadaxsist10
 
ITB2017 - Intro to Behavior Driven Development
ITB2017 - Intro to Behavior Driven DevelopmentITB2017 - Intro to Behavior Driven Development
ITB2017 - Intro to Behavior Driven DevelopmentOrtus Solutions, Corp
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shineWim Selles
 
Embracing Capybara
Embracing CapybaraEmbracing Capybara
Embracing CapybaraTim Moore
 
Largamos o Cucumber!
Largamos o Cucumber!Largamos o Cucumber!
Largamos o Cucumber!iMasters
 

Semelhante a How to improve our acceptance tests - Pyccuracy VS Splinter (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
 
Write Tests in End Users’ Lingo
Write Tests in End Users’ LingoWrite Tests in End Users’ Lingo
Write Tests in End Users’ Lingo
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven Testing
 
I, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot OverlordsI, For One, Welcome Our New Robot Overlords
I, For One, Welcome Our New Robot Overlords
 
I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicação
 
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
 
Quick ref capybara
Quick ref capybaraQuick ref capybara
Quick ref capybara
 
Quick ref capybara
Quick ref capybaraQuick ref capybara
Quick ref capybara
 
Android testing calabash
Android testing calabashAndroid testing calabash
Android testing calabash
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
 
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
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
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
 
ITB2017 - Intro to Behavior Driven Development
ITB2017 - Intro to Behavior Driven DevelopmentITB2017 - Intro to Behavior Driven Development
ITB2017 - Intro to Behavior Driven Development
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shine
 
BDD - Collaborate like you mean it!
BDD - Collaborate like you mean it!BDD - Collaborate like you mean it!
BDD - Collaborate like you mean it!
 
Embracing Capybara
Embracing CapybaraEmbracing Capybara
Embracing Capybara
 
Largamos o Cucumber!
Largamos o Cucumber!Largamos o Cucumber!
Largamos o Cucumber!
 
Largamos o cucumber
Largamos o cucumberLargamos o cucumber
Largamos o cucumber
 

Último

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...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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 AmsterdamUiPathCommunity
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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 DevelopersWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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, Adobeapidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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...Orbitshub
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Último (20)

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...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

How to improve our acceptance tests - Pyccuracy VS Splinter

  • 1. Fernando Sandes How to improve our acceptance tests !
  • 2. What is better? Pyccuracy vs
  • 3.
  • 4. It`s not (only) about the technology
  • 5. It`s an ideologica difference
  • 6. @gabrielfalcao Lettuce`s creator The problem is that differently of cucumber and lettuce, pyccuracy is aimed to web testing, with pre-defined "step definitions" (pyccuracy uses a different nomenclature), and when I was using it I found extremely hard to maintain the tests as the test suite grows, it's a hell! lettuce
  • 7. @gabrielfalcao Lettuce`s creator “So I wrote lettuce to make it super flexible so that I could write my own definitions in a super easy way, and never couple my tests to robotic step definitions.” lettuce
  • 8. Pyccuracy ROBOTIC STEP DEFINITIONS
  • 9. ROBOTIC STEP DEFINITIONS Given I fill the field "#username" with "test" And I fill the field "#password" with "1234" When I click on the button 'input[type="submit"]' Then I see the page contains the text "Hello Test User!" Given I am at the login page And I fill in the login information with "test" and password "1234" When I click on the login button Then I see I'm logged in as a normal user
  • 10. ROBOTIC STEP DEFINITIONS Given I fill the field "#username" with "test" And I fill the field "#password" with "1234" When I click on the button 'input[type="submit"]' Then I see the page contains the text "Hello Test User!" “You can see how your business it better defined here” Given I am at the login page And I fill in the login information with "test" and password "1234" When I click on the login button Then I see I'm logged in as a normal user
  • 11. DONT`T BE THE BOILING FROG ! The presence of step definitions leads people down a very bad path. While it gives people a head start in writing scenarios it also tricks people into writing scenarios are extremely verbose and fragile. People don't always realize this, so they continue cranking out lots of crap scenarios based on pre-steps. This is like the boiling frog story
  • 12. IT`S ABOUT THE DOMAIN ! The “domain” is defined by the value the stakeholders and users hope to achieve with the software. This can be booking a ticket or sharing pictures with friends or an infinite number of activities. Clicking links and buttons or filling in text fields has nothing (directly) to do with the domain.
  • 15. Imperative VS Declarative Scenarios in User Stories
  • 16. The imperative style uses highly reusable Imperative granular steps which outlines user interface. much of the This binds the scenario to that interface. Scenario: Successful login Given a user "Aslak" with password "xyz" And I am on the login page And I fill in "User name" with "Aslak" And I fill in "Password" with "xyz" When I press "Log in" Then I should see "Welcome, Aslak“
  • 17. The imperative style uses highly reusable Imperative granular steps which outlines user interface. much of the This binds the scenario to that interface. Scenario: Successful login Scenario: User is greeted upon login Given a user "Aslak" with password "xyz" Given the user "Aslak" has an account And I am on the login page When he logs in And I fill in "User name" with "Aslak" Then he should see "Welcome, Aslak" And I fill in "Password" with "xyz" When I press "Log in" Then I should see "Welcome, Aslak“ Declarative
  • 18. The imperative style uses highly reusable Imperative granular steps which outlines user interface. much of the This binds the scenario to that interface. Scenario: Successful login Scenario: User is greeted upon login Given a user "Aslak" with password "xyz" Given the user "Aslak" has an account And I am on the login page When he logs in And I fill in "User name" with "Aslak" Then he should see "Welcome, Aslak" And I fill in "Password" with "xyz" When I press "Log in" Then I should see "Welcome, Aslak“ Declarative
  • 19. Imperative Declarative When we’re describing other parts of the system that require login, the login details like user name, password and how to log in are only distracting. That is why we make it a one-liner.
  • 22. COMMUNICATION IS THE GOAL! To use a BDD tool "right", one has to understand that the main goal is primarily about communication and secondarily about testing.
  • 23. COMING BACK… And about technology
  • 24. SPLINTER Splinter was not created to be another acceptance tool, but an abstract layer over other tools, its goal is provide a unique API that make acceptance testing easier and funnier :)
  • 25. SPLINTER A LOT OF OPTIONS !
  • 26. HEADLESS OR NOT HEADLESS ?
  • 28. NOT HEADLESS SLOW EASY TO DEBUG USE THE BROWSER
  • 31. SERVER HEADLESS LOCAL
  • 32. NOT HEADLESS SERVER HEADLESS LOCAL
  • 33. SPLINTER and more… http status code multi webdrivers css ,xpath, tag, name selectors support to iframe and alert execute javascript work's with ajax and async javascript
  • 34. SPLINTER Browser • visit(‘url’) • reload() • quit() • html • url • title
  • 35. SPLINTER Searching elements • find_by_css(‘.classe’) • find_by_id(‘meuid’) • find_by_xpath(‘//body’) • find_by_tag(‘a’) • find_by_name(‘search’)
  • 36. SPLINTER Forms • fill(‘name’, ‘value’) • attach_file(‘name’, ‘/path/to/file.txt’) • check(‘name’) #checkbox • choose(‘name’, ‘value’) #radio button • select(‘name’, ‘option’)
  • 38. SIKULI http://sikuli.org/index.shtml
  • 39. NEEDLE http://needle.readthedocs.org #AUTOMATED TESTS FOR CSS from needle.cases import NeedleTestCase class GoogleTest(NeedleTestCase): def test_footer(self): self.driver.get('http://www.google.com') e = self.driver.find_element_by_id('fctr') self.assertScreenshot(e, 'google-footer') self.assertEqual(e.get_computed_property('font-size'), '13px')