forked from spree/spree
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added several scenarios and other stuff:
* Started work on checkout.feature * Improved checkout.feature, added few new scenarios. * Added opportunity to describe product, which added to cart. * Improved checkout scenarios. * Improved user steps. * Added scenarios for work with cart and for search features. * Fixed typo in theme_default. * Added payment methods for cucumber env. [spree#1239 state:resolved]
- Loading branch information
Showing
10 changed files
with
269 additions
and
7 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,98 @@ | ||
Feature: Checkout | ||
In order to be able make checkout | ||
Should be able make checkout | ||
|
||
|
||
Scenario: Visitor make checkout as guest, without registration | ||
When I add a product with name: "RoR Mug" to cart | ||
Then I should see "Shopping Cart" within "h1" | ||
When I follow "Checkout" | ||
Then I should see "Registration" | ||
|
||
When I fill in "Email" with "spree@test.com" within "#guest_checkout" | ||
And press "Continue" | ||
Then I should see "Billing Address" within "legend" | ||
And I should see "Shipping Address" within "legend" | ||
|
||
When I fill billing address with correct data | ||
And check "checkout_use_billing" | ||
And press "Save and Continue" | ||
Then I should see "Shipping Method" within "legend" | ||
When I fill in "coupon-code" with "SPREE" | ||
And press "post-summary" | ||
Then I should see "Coupon (SPREE)" within "#summary-order-credits" | ||
And I should see "Shipping Method" within "legend" | ||
|
||
When I choose "UPS Ground" as shipping method and "Check" as payment method | ||
Then I should see "Your order has been processed successfully" | ||
And 1 coupon_credits should exist | ||
|
||
|
||
Scenario: User make checkout | ||
Given I am signed up as "email@person.com/password" | ||
When I add a product with name: "RoR Mug" to cart | ||
Then I should see "Shopping Cart" within "h1" | ||
When I follow "Checkout" | ||
Then I should see "Registration" | ||
|
||
When I follow "Log In as Existing Customer" | ||
Then I should see "Log In as Existing Customer" within "h2" | ||
When I sign in as "email@person.com/password" | ||
Then I should see "Billing Address" within "legend" | ||
And I should see "Shipping Address" within "legend" | ||
|
||
When I press "Save and Continue" | ||
Then I should see "Shipping Method" within "legend" | ||
When I fill in "coupon-code" with "SPREE" | ||
And press "post-summary" | ||
Then I should see "Coupon (SPREE)" within "#summary-order-credits" | ||
And I should see "Shipping Method" within "legend" | ||
|
||
When I choose "UPS Ground" as shipping method and "Check" as payment method | ||
Then I should see "Your order has been processed successfully" | ||
And 1 coupon_credits should exist | ||
|
||
|
||
Scenario: Uncompleted order associated with user | ||
Given I am signed up as "email@person.com/password" | ||
When I sign in as "email@person.com/password" | ||
Then I should be logged in | ||
|
||
When I add a product with price: "14.99" to cart | ||
Then 1 orders should exist with item_total: "14.99" | ||
And 0 orders should exist with user_id: nil | ||
|
||
When I follow "Logout" | ||
Then I should be logged out | ||
And cart should be empty | ||
When I add a product with price: "14.99" to cart | ||
Then 2 orders should exist with item_total: "14.99" | ||
And 1 orders should exist with user_id: nil | ||
|
||
When I sign in as "email@person.com/password" | ||
Then 1 orders should exist with item_total: "29.98" | ||
And 0 orders should exist with user_id: nil | ||
|
||
|
||
Scenario: Uncompleted guest order should be associated with user after log in | ||
Given I am signed up as "email@person.com/password" | ||
|
||
When I add a product with name: "RoR Mug" to cart | ||
Then 1 orders should exist with user_id: nil | ||
|
||
When I go to the sign in page | ||
And sign in as "email@person.com/password" | ||
Then I should be logged in | ||
|
||
When I follow "Cart" | ||
Then I should see "Shopping Cart" within "h1" | ||
When I follow "Checkout" | ||
Then I should see "Billing Address" | ||
And I should see "Shipping Address" within "legend" | ||
When I press "Save and Continue" | ||
Then I should see "Shipping Method" within "legend" | ||
When I choose "UPS Ground" as shipping method and "Check" as payment method | ||
Then I should see "Your order has been processed successfully" | ||
And 0 orders should exist with user_id: nil | ||
|
||
|
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,35 @@ | ||
Feature: Search products | ||
In order to be able to search products | ||
A visitor | ||
|
||
Scenario: Visitor can search products by keywords | ||
Given the following products exist: | ||
| name | price | available_on | taxon | | ||
| Ruby Mug | 15.99 | 2010-03-06 18:48:21 | Ruby | | ||
| Ruby Bag | 19.99 | 2010-03-06 18:48:21 | Bag | | ||
| Apache Bag | 17.99 | 2010-03-06 18:48:21 | Bag | | ||
| Ruby T-Shirt | 16.99 | 2020-03-06 18:48:21 | Ruby | | ||
When I go to the homepage | ||
And fill in "keywords" with "ruby" | ||
And press "Search" | ||
Then I should see "Search results for 'ruby'" | ||
And I should see "Ruby Mug" | ||
And I should see "Ruby Bag" | ||
And I should not see "Apache Bag" | ||
And I should not see "Ruby T-Shirt" | ||
|
||
When I go to the homepage | ||
And fill in "keywords" with "ruby" | ||
And select "Ruby" from "taxon" | ||
And press "Search" | ||
Then I should see "Ruby" within "h1" | ||
And I should see "Search results for 'ruby'" | ||
And I should see "Ruby Mug" | ||
And I should not see "Ruby Bag" | ||
And I should not see "Apache Bag" | ||
And I should not see "Ruby T-Shirt" | ||
|
||
When I go to the homepage | ||
And fill in "keywords" with "hsgfhagsfg" | ||
And press "Search" | ||
Then I should see "No products found" |
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
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
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
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
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,41 @@ | ||
Feature: Work with cart | ||
|
||
Scenario: Visitor can work with cart | ||
When I add a product with name: "RoR Mug", price: "15" to cart | ||
Then I should see "Shopping Cart" within "h1" | ||
And I should see "RoR Mug" within "#line_items h4 a" | ||
And I should see "$15" within "#line_items td" | ||
And I should see "$15" within "#subtotal" | ||
|
||
When I add a product with name: "RoR Mug", price: "15" to cart | ||
Then I should see "Shopping Cart" within "h1" | ||
And I should see "RoR Mug" within "#line_items h4 a" | ||
And I should see "$15" within "#line_items td" | ||
And I should see "$30" within "#line_items td" | ||
And I should see "$30" within "#subtotal" | ||
|
||
When I add a product with name: "RoR Bag", price: "17" to cart | ||
Then I should see "Shopping Cart" within "h1" | ||
And I should see "RoR Bag" within "#line_items h4 a" | ||
And I should see "$15" within "#line_items td" | ||
And I should see "$17" within "#line_items td" | ||
And I should see "$47" within "#subtotal" | ||
|
||
When I fill in "order_line_items_attributes_0_quantity" with "3" | ||
Then the "order_line_items_attributes_0_quantity" field should contain "3" | ||
# When I press "order_line_items_attributes_0_quantity" | ||
# Then I should see "Shopping Cart" within "h1" | ||
# And I should see "$45" within "#line_items td" | ||
# And I should see "$62" within "#subtotal" | ||
|
||
# When I fill in "order_line_items_attributes_0_quantity" with "0" | ||
# And follow "Update" | ||
# Then I should see "Shopping Cart" within "h1" | ||
# And I should see "$17" within "#subtotal" | ||
|
||
|
||
Scenario: Following by cart link should not create order | ||
When I go to the homepage | ||
And follow "Cart" | ||
When 0 orders should exist | ||
|
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
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
4 changes: 3 additions & 1 deletion
4
vendor/extensions/theme_default/app/views/shared/_products.html.erb
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