forked from pantheon-systems/drops-7
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pantheon-systems#13 from lsolesen/checkout-feature
Added Behat feature for the checkout flow
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
| 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> | ||
| 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" |