Skip to content

Commit 7b47695

Browse files
committed
Merge pull request pantheon-systems#13 from lsolesen/checkout-feature
Added Behat feature for the checkout flow
2 parents 701956a + 33e5e01 commit 7b47695

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tests/behat/features/checkout.feature

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Feature: Checkout and pay
2+
In order to buy a product and pay for it
3+
As any user
4+
I should be able to checkout my cart and pay online
5+
6+
Background:
7+
When I go to "/drinks/drupal-commerce-wake-you"
8+
And I press "Add to cart"
9+
Then I should see "ITEM SUCCESSFULLY ADDED TO YOUR CART"
10+
When I click "Go to checkout"
11+
12+
Scenario: Add coffee mug to cart and update quantity
13+
Then I should see "Shopping cart"
14+
Then I should see the following <texts>
15+
| texts |
16+
| $8.00 |
17+
| SKU: MG1-BLU-OS |
18+
And the "edit_quantity[0]" field should contain "1"
19+
When I fill in "2" for "edit_quantity[0]"
20+
And I press "Update cart"
21+
Then I should see "Your shopping cart has been updated."
22+
And I should see "$16.00"
23+
When I press "Checkout"
24+
Then I should see "I don't have an account"
25+
When I fill in "admin" for "Username"
26+
And I fill in "admin" for "Password"
27+
And I press "Log in"
28+
Then I should see "Checkout"
29+
Then I should see the following <texts>
30+
| texts |
31+
| $8.00 |
32+
| $16.00 |
33+
| Coffee Mug 1 |
34+
| Billing informatio |
35+
When I fill in the following:
36+
| Full name | My full name |
37+
| Address 1 | My address |
38+
| City | My city |
39+
And I press "Continue to next step"
40+
# Just choose the default shipping method
41+
And I press "Continue to next step"
42+
Then I should see "Review order"
43+
# The default shipping method
44+
And I should see "Express shipping: 1 business day"
45+
# Order total
46+
And I should see "$31.00"
47+
When I fill in "4111111111111111" for "Card number"
48+
And I select "03" from "commerce_payment[payment_details][credit_card][exp_month]"
49+
And I select "24" from "commerce_payment[payment_details][credit_card][exp_year]"
50+
And I press "Continue to next step"
51+
Then I should see "Checkout complete"
52+
And I should see "Your order number is"
53+
And I should see "You can view your order on your account page when logged in"
54+
And I should see "Return to the front page"

0 commit comments

Comments
 (0)