tests written in a behavior- driven development style Describes the desired software behavior in business-readable English Encourages tests to be defined/written by…wait for it…the business (gasp!)
style become more than just tests; they are executable specifications.”* Provides the business and technical teams with a common language to build/test software Catch missed requirements, defects, and regressions as early as possible *Matt Wynne and Aslak Hellesøy, The Cucumber Book
by the business stakeholders “It’s sometimes said that unit tests ensure you build the thing right, while acceptance tests ensure you build the right thing.”* *Matt Wynne and Aslak Hellesøy, The Cucumber Book
want [feature] So that [benefit] Features Scenario [title] Given [context] When [event] Then [outcome]* (optional) And… But… *Important: Outcome(s) must be testable
Features composed of Scenarios (as chapters are composed of paragraphs) Scenarios composed of Steps (as paragraphs are composed of sentences) Steps matched with executable code
business (preferably by the business) Potential authors: Product Owner Business Analyst Quality Assurance Developer/SQE Written as early as possible
languages: Java: Cuke4Duke (JRuby), Cucumber-JVM .NET: SpecFlow Python, PHP: Cucumber-ish implementations Step Definitions contain the execution code and the assertions Assertions are usually written in RSpec, but many other methods are supported
and Capybara are also popular Supports Firefox, Chrome, IE, and Safari Able to spoof UA and screen resolution to emulate Android and iOS devices (via webdriver-user-agent gem) Use xvfb and headless gem to facilitate running on headless servers
UI acceptance tests A page object represents a screen or part of a screen in your web application In this way, UI behavior is kept DRY and easy to find
such as Jenkins, via Rake task Runs on whatever schedule makes sense After commits On set schedule After new deploys Can automatically generate/archive reports and notify team of failed tests