From 33e5e0191223561d7978259a1a78123f2f5b5713 Mon Sep 17 00:00:00 2001 From: Lars Olesen Date: Sun, 30 Mar 2014 20:52:50 +0000 Subject: [PATCH] Added Behat feature for the checkout flow --- tests/behat/features/checkout.feature | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/behat/features/checkout.feature diff --git a/tests/behat/features/checkout.feature b/tests/behat/features/checkout.feature new file mode 100644 index 00000000000..0ffe9d484ee --- /dev/null +++ b/tests/behat/features/checkout.feature @@ -0,0 +1,54 @@ +Feature: Checkout and pay + In order to buy a product and pay for it + As any user + I should be able to checkout my cart and pay online + + Background: + When I go to "/drinks/drupal-commerce-wake-you" + And I press "Add to cart" + Then I should see "ITEM SUCCESSFULLY ADDED TO YOUR CART" + When I click "Go to checkout" + + Scenario: Add coffee mug to cart and update quantity + Then I should see "Shopping cart" + Then I should see the following + | texts | + | $8.00 | + | SKU: MG1-BLU-OS | + And the "edit_quantity[0]" field should contain "1" + When I fill in "2" for "edit_quantity[0]" + And I press "Update cart" + Then I should see "Your shopping cart has been updated." + And I should see "$16.00" + When I press "Checkout" + Then I should see "I don't have an account" + When I fill in "admin" for "Username" + And I fill in "admin" for "Password" + And I press "Log in" + Then I should see "Checkout" + Then I should see the following + | texts | + | $8.00 | + | $16.00 | + | Coffee Mug 1 | + | Billing informatio | + When I fill in the following: + | Full name | My full name | + | Address 1 | My address | + | City | My city | + And I press "Continue to next step" + # Just choose the default shipping method + And I press "Continue to next step" + Then I should see "Review order" + # The default shipping method + And I should see "Express shipping: 1 business day" + # Order total + And I should see "$31.00" + When I fill in "4111111111111111" for "Card number" + And I select "03" from "commerce_payment[payment_details][credit_card][exp_month]" + And I select "24" from "commerce_payment[payment_details][credit_card][exp_year]" + And I press "Continue to next step" + Then I should see "Checkout complete" + And I should see "Your order number is" + And I should see "You can view your order on your account page when logged in" + And I should see "Return to the front page"