Behat
C'est plus que ça !
Samuel Roze
@samuelroze
Software Engineer at Inviqa
SensioLabs UK
ehat@everzet
BDD framework for PHP
Defines a feature with Gherkin
Creates your context file
behat.yml
Something's wrong here...
Something's wrong here...
Something's wrong here...
Technical language
Something's wrong here...
Technical language
Implementation details
Describe your business behaviour, not the
implementation
Using examples?
I can still use Mink!
I can still use Mink!
I can still use Mink!
I can still use Mink!
But we can use our objects
But we can use our objects
But we can use our objects
We can also uses the both!
$	
  bin/behat	
  -­‐-­‐suite=smoke
order.feature behat.yml
We can also uses the both!
$	
  bin/behat	
  -­‐-­‐suite=smoke
order.feature behat.yml
We can also uses the both!
$	
  bin/behat	
  -­‐-­‐suite=smoke
order.feature behat.yml
Test this same behaviour on different layers
Inject Symfony2 services in context classes
behat.yml OrderContext.php
Inject Symfony2 services in context classes
behat.yml OrderContext.php
Inject Symfony2 services in context classes
behat.yml OrderContext.php
Inject Symfony2 services in context classes
And the dependencies?
Application
Persistence Third Party APIs
Interfaces
Instead of directly using these external dependencies, we
can wrap them behind our interfaces
Using another implementation for your test suites
Using another implementation for your test suites
Using another implementation for your test suites
Using another implementation for your test suites
Using another implementation for your test suites
Using another implementation for your test suites
Using another implementation for your test suites
Use different Symfony environments
Use different Symfony environments
Use different Symfony environments
Use different Symfony environments
Use different Symfony environments
$	
  bin/behat	
  -­‐-­‐profile=smoke
Decouple the application from its dependencies
Describe your business behaviour, not the
implementation
Takeaways
Describe your business behaviour, not the
implementation
Test this same behaviour on different layers
Takeaways
Decouple the application from its dependencies
Describe your business behaviour, not the
implementation
Test this same beh...
Thank you!
https://joind.in/15260
@samuelroze
Behat c'est plus que ça | Behat is more than that
Prochain SlideShare
Chargement dans…5
×

Behat c'est plus que ça | Behat is more than that

3 223 vues

Publié le

Behat is not just a tool that helps to achieve browser automation. It can be used to test the different layers of applications and to have a better understanding of the domain.

Publié dans : Technologie
0 commentaire
13 j’aime
Statistiques
Remarques
  • Soyez le premier à commenter

Aucun téléchargement
Vues
Nombre de vues
3 223
Sur SlideShare
0
Issues des intégrations
0
Intégrations
223
Actions
Partages
0
Téléchargements
15
Commentaires
0
J’aime
13
Intégrations 0
Aucune incorporation

Aucune remarque pour cette diapositive

Behat c'est plus que ça | Behat is more than that

  1. 1. Behat C'est plus que ça !
  2. 2. Samuel Roze @samuelroze Software Engineer at Inviqa SensioLabs UK
  3. 3. ehat@everzet BDD framework for PHP
  4. 4. Defines a feature with Gherkin
  5. 5. Creates your context file
  6. 6. behat.yml
  7. 7. Something's wrong here...
  8. 8. Something's wrong here...
  9. 9. Something's wrong here... Technical language
  10. 10. Something's wrong here... Technical language Implementation details
  11. 11. Describe your business behaviour, not the implementation
  12. 12. Using examples?
  13. 13. I can still use Mink!
  14. 14. I can still use Mink!
  15. 15. I can still use Mink!
  16. 16. I can still use Mink!
  17. 17. But we can use our objects
  18. 18. But we can use our objects
  19. 19. But we can use our objects
  20. 20. We can also uses the both! $  bin/behat  -­‐-­‐suite=smoke order.feature behat.yml
  21. 21. We can also uses the both! $  bin/behat  -­‐-­‐suite=smoke order.feature behat.yml
  22. 22. We can also uses the both! $  bin/behat  -­‐-­‐suite=smoke order.feature behat.yml
  23. 23. Test this same behaviour on different layers
  24. 24. Inject Symfony2 services in context classes behat.yml OrderContext.php
  25. 25. Inject Symfony2 services in context classes behat.yml OrderContext.php
  26. 26. Inject Symfony2 services in context classes behat.yml OrderContext.php
  27. 27. Inject Symfony2 services in context classes
  28. 28. And the dependencies? Application Persistence Third Party APIs
  29. 29. Interfaces Instead of directly using these external dependencies, we can wrap them behind our interfaces
  30. 30. Using another implementation for your test suites
  31. 31. Using another implementation for your test suites
  32. 32. Using another implementation for your test suites
  33. 33. Using another implementation for your test suites
  34. 34. Using another implementation for your test suites
  35. 35. Using another implementation for your test suites
  36. 36. Using another implementation for your test suites
  37. 37. Use different Symfony environments
  38. 38. Use different Symfony environments
  39. 39. Use different Symfony environments
  40. 40. Use different Symfony environments
  41. 41. Use different Symfony environments $  bin/behat  -­‐-­‐profile=smoke
  42. 42. Decouple the application from its dependencies
  43. 43. Describe your business behaviour, not the implementation Takeaways
  44. 44. Describe your business behaviour, not the implementation Test this same behaviour on different layers Takeaways
  45. 45. Decouple the application from its dependencies Describe your business behaviour, not the implementation Test this same behaviour on different layers Takeaways
  46. 46. Thank you! https://joind.in/15260 @samuelroze

×