Feature:Now User has given all his basic info and decided which products he will buy, then heforward into the last process - pay the money. /registration/business_pay will summarize theprice(including tax and discount) he will pay and let user fill in his credit card info, when hepresses "Confirm", it will charge his credit card.Scenario: Now user input credit card info and press "Confirm", the page will submit his infoto AriaSystem, AriaSystem will validate his credit card info, charge his credit card and returnsome data to our database. Then our database will save his personal info and partner info. Ifall these work well, user will be redirected to /registration/business_finish. Given I reach /registration/business_pay When I fill in basic info into /registration/business_pay And I press "Confirm" Then I should see "Please wait..." And I waiting for being redirected to "/registration/business_finish" And all MozyPro data in Database is correct
Step DefinitionsGiven /^I am in "([^"]*)"$/ do |url| visit mozy_url(url, :https => true)endThen /^I would be redirected to "([^"]*)"$/ do |url| page.current_url.shouldbe_include?mozy_url(url, :https => true)end
Have a try ?Let’s write a simple Cucumber test case
features/sign_up.featureFeature: Sign up Scenario: I will register a user with email "firstname.lastname@example.org" andpassword "vmware” Given I fill in email "email@example.com" and password "vmware" in signup page When I press "Sign up" Then I should see "Page#index"