18. QA Can Write This
Scenario: Searching on Google
Given I am on the homepage
When I fill in “q” with “cukes”
And I press “Google Search”
Then I should see “cukes.info”
24. The Output
Scenario: Searching on Google # features/google_search.feature:6
Given I am on the homepage # features/step_definitions/webrat_steps.rb:6
When I fill in "q" with "cukes" # features/step_definitions/webrat_steps.rb:29
And I press "Google Search" # features/step_definitions/webrat_steps.rb:17
Then I should see "cukes.info" # features/step_definitions/webrat_steps.rb:121
1 scenario (1 passed)
4 steps (4 passed)
0m10.206s
It won’t because the test code was testing create_widget, not create
Offload the work to someone else. He behaves like a user and finds problems the user would find.
He certainly would
Probably not, the QA guy typically only checks new features and will do a regression test every month or so.
Came out of work at Thoughtworks. Works on all platforms with all browsers and a ton of languages have clients
Is your QA guy going to learn a full on programming language?
There’s a lot here and your QA guy isn’t going to learn it all
This doesn’t seem too good. We’d much rather have QA / business involved (and hopefully even doing the work).
Scenario tells what we’re testing
Given sets up assumptions about your Scenario
When performs actions
And duplicates whatever came before
Then is your assertion
And let’s see this run in cucumber
90% of what you do is click a link, fill in text, and assert that text is present. Webrat handles these for you.
Add your own step definitions in features/step_definitions/*.rb.
There are some step_definitions your QA guy can’t implement and you’ll have to help.
Features go at the top level.
Steps definitions go in step_definitions.
Support files go in support.
Cucumber will load everything.
Writing cucumber features can be time consuming. Cuke-talker is a command line IDE for writing them.
cuke-talker isn’t even close to done. We’re looking for help (yay open source!)
Given, When, Then, And behave just like they do in cucumber
! lets you execute arbitrary ruby
define step opens a subrepel for defining a step
feature will run a feature file from your features dir (will soon be run feature)
show history shows all your previous Given, When, Then, Ands
show step definitions shows all the steps you’ve defined