Skip to content

gary-liguoliang/bdd-python-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started with BDD in Python

This is an example project demonstrating BDD in Python using Lettuce, you may pull this project and have a try!

BDD can save Agile

  • You can’t stay agile without clean code
  • You can’t have clean code without refactoring
  • You can’t refactor without good automated tests

Matt Wynne, founder fo Cucumber Ltd

we're going to build a vending machine based on the features provided by customer/BA. we'll use Gherkin as the DSL.

With a business-readable DSL, programmers write the code but they show that code frequently to business people who can understand what it means. These customers can then make changes, maybe draft some code, but it's the programmers who make it solid and do the debugging and testing.

Project info

Tools

  • Python 2.7.11
  • Lettuce 0.2.21

BDD Feature files

vm/test/features

Q&A

How to run all BDD tests?

  1. step by step:

  2. navigate to the project-root and install dependencies by: pip install -r requirements.txt

  3. install the project locally in 'Development Mode' pip install -e . (it creates a special .egg-link file in the deployment directory, that links to your project’s source code)

  4. start testing by: lettuce vm/test

  5. or you may execute the bash script: bin/install_and_run_at.sh. it will create a new virtualenv and install the app and then start the lettuce test.

How to config CI job?

config your Jenkins job with:

chmod u+x bin/install_and_run_at.sh
bin/install_and_run_at.sh

Post-build action Publish JUnit test result report can be added to show the acceptance test result using lettucetests.xml.

About

BDD Python Example - Getting started with BDD in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published