More Information about Behave¶
For new users, that want to read, understand and explore the concepts in Gherkin and behave (after reading the behave documentation):
- “Behave by Example” (on github)
The following small tutorials provide an introduction how you use behave in a specific testing domain:
- Phillip Johnson, Getting Started with Behavior Testing in Python with Behave, 2015-10-15.
- Nicole Harris, Beginning BDD with Django (part 1 and 2), 2015-03-16.
- TestingBot, Bdd with Python, Behave and WebDriver
- Wayne Witzel III, Using Behave with Pyramid, 2014-01-10.
A word of caution if you are new to “behaviour-driven development” (BDD). In general, you want to avoid “user interface” (UI) details in your scenarios, because they describe how something is implemented (in this case the UI itself), like:
press this button
enter this text into the text field
In BDD (or testing in general), you should describe what should be done (meaning the intention). This will make your scenarios much more robust and stable because you can change the underlying implementation of:
- the “system under test” (SUT) or
- the test automation layer, that interacts with the SUT.
without changing the scenarios.
Behave is covered in the following books:
[TDD-Python] Harry Percival, Test-Driven Web Development with Python, O’Reilly, June 2014, Appendix E: BDD (covers behave)
- Benno Rice: Making Your Application Behave (30min), 2012-08-12, PyCon Australia.
- Selenium: First behave python tutorial with selenium (8min), 2015-01-28, http://www.seleniumframework.com/python-basic/first-behave-gherkin/
- Jessica Ingrasselino: Automation with Python and Behave (67min), 2015-12-16
- Selenium Python Webdriver Tutorial - Behave (BDD) (14min), 2016-01-21
- Front-end integration testing with splinter (30min), 2017-08-05
- Blog: In-Depth Screencast on Testing (2016-04-11; video offset=2:10min)
- Docs: BDD Testing Framework Support in PyCharm 2016.1
Find more Information¶
- google:python-behave examples
- google:python-behave tutorials
- google:python-behave videos