The default currency have to be loaded before user authentication.

This commit is contained in:
Arnaud Langlade 2014-08-17 19:27:40 +02:00
parent a5175eee6c
commit 6ef50b0584
45 changed files with 85 additions and 80 deletions

View file

@ -115,6 +115,7 @@ default:
contexts:
- Behat\MinkExtension\Context\MinkContext
- Sylius\Bundle\CoreBundle\Behat\OAuthContext
- Sylius\Bundle\MoneyBundle\Behat\MoneyContext
- Sylius\Bundle\WebBundle\Behat\WebContext
filters:
tags: @oauth

View file

@ -5,8 +5,8 @@ Feature: Countries and provinces
I want to be able to manage countries and their provinces
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following countries:
| name | provinces |
| France | Lyon, Toulouse, Rennes, Nancy |

View file

@ -5,8 +5,8 @@ Feature: Store dashboard
I need to be able to see sales info in backend dashboard
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| German lands | country | Germany, Austria, Switzerland |

View file

@ -5,8 +5,8 @@ Feature: General settings
I want to be able to edit general configuration
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
Scenario: Accessing the settings form
Given I am on the dashboard page

View file

@ -5,8 +5,8 @@ Feature: User groups management
I want to be able to group them
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| German lands | country | Germany, Austria, Switzerland |

View file

@ -5,8 +5,8 @@ Feature: Inventory tracking
I want to be able to manage stock levels and availability
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following options:
| name | presentation | values |
| T-Shirt color | Color | Red, Blue, Green |

View file

@ -5,8 +5,8 @@ Feature: Orders management
I want to be able to list, view, edit and create orders
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| German lands | country | Germany, Austria, Switzerland |

View file

@ -5,8 +5,8 @@ Feature: Payment methods
I want to be able to manage payment methods
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following payment methods exist:
| name | gateway |
| Credit Card | stripe |

View file

@ -5,8 +5,8 @@ Feature: Product attributes
I want to be able to configure product attributes
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following attributes:
| name | presentation |
| T-Shirt collection | Collection |

View file

@ -5,8 +5,8 @@ Feature: Product options
I want to be able to manage options
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following options:
| name | presentation | values |
| T-Shirt color | Color | Red, Blue, Green |

View file

@ -5,8 +5,8 @@ Feature: Product prototypes
I want to be able to create prototypes
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following options:
| name | presentation | values |
| T-Shirt color | Color | Red, Blue, Green |

View file

@ -5,8 +5,8 @@ Feature: Browsing products by taxonomies
I want to be able to view them by category
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following taxonomies defined:
| name |
| Category |

View file

@ -5,8 +5,8 @@ Feature: Product variants
I want to be able to manage product variants
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following options:
| name | presentation | values |
| T-Shirt color | Color | Red, Blue, Green |

View file

@ -5,8 +5,8 @@ Feature: Products
I want to be able to manage products
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following options:
| name | presentation | values |
| T-Shirt color | Color | Red, Blue, Green |

View file

@ -5,8 +5,8 @@ Feature: Products filter
I want to be able to filter list by name
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following products exist:
| name | price | sku |
| Super T-Shirt | 19.99 | 123 |

View file

@ -5,8 +5,8 @@ Feature: Promotions
I want to be able to manage promotions
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following promotions exist:
| name | description | usage limit | used | starts | ends |
| New Year | New Year Sale for more than 3 items | | | 2013-12-31 | 2014-01-03 |

View file

@ -5,8 +5,8 @@ Feature: Shipments
I want to be able to list and view shipments
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| German lands | country | Germany, Austria, Switzerland |

View file

@ -5,8 +5,8 @@ Feature: Shipping categories
I want to be able to manage shipping categories
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following shipping categories:
| name |
| Regular |

View file

@ -5,8 +5,8 @@ Feature: Shipping methods
I want to be able to configure shipping methods
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| UK + Germany | country | United Kingdom, Germany |

View file

@ -5,8 +5,8 @@ Feature: Tax categories
I want to be able to manage tax categories
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following tax categories:
| name |
| Clothing |

View file

@ -5,8 +5,8 @@ Feature: Tax rates
I want to be able to configure tax rates
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| UK + Germany | country | United Kingdom, Germany |

View file

@ -5,8 +5,8 @@ Feature: Taxation settings
I want to be able to edit taxation configuration
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And the following zones are defined:
| name | type | members |
| German lands | country | Germany, Austria, Switzerland |

View file

@ -5,8 +5,8 @@ Feature: taxonomies
I want to be able to manage taxonomies
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following taxonomies defined:
| name |
| Category |

View file

@ -5,8 +5,8 @@ Feature: Users management
I want to be able to list registered users
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are products:
| name | price |
| Mug | 5.99 |

View file

@ -5,8 +5,8 @@ Feature: Zones
In order to apply taxes and allow shipping to geographical areas
Background:
Given I am logged in as administrator
And there is default currency configured
Given there is default currency configured
And I am logged in as administrator
And there are following zones:
| name | type | members | scope |
| Baltic states | country | Lithuania, Latvia, Estonia | content |

View file

@ -5,13 +5,13 @@ Feature: Currency management
I want to configure currencies and exchange rates
Background:
Given I am logged in as administrator
And there are following currencies configured:
Given there are following currencies configured:
| code | exchange rate | enabled |
| USD | 0.76496 | yes |
| GBP | 1.16998 | no |
| EUR | 1.00000 | yes |
| AUD | 0.73986 | yes |
And I am logged in as administrator
Scenario: Browsing all configured currencies
Given I am on the dashboard page

View file

@ -5,8 +5,8 @@ Feature: User account addresses page
I want to be able to add, edit or delete my shipping and billing addresses
Background:
Given I am logged in user
And there is default currency configured
Given there is default currency configured
And I am logged in user
And the following countries exist:
| name |
| Germany |

View file

@ -10,6 +10,7 @@ Feature: User account homepage
Scenario: Viewing the homepage of my account
Given I am on the store homepage
And there is default currency configured
And I am logged in user
When I follow "My account"
Then I should be on my account homepage

View file

@ -5,9 +5,9 @@ Feature: User account orders page
I want to be able to track and get an invoice of my sent orders
Background:
Given I am logged in user
Given there is default currency configured
And I am logged in user
And I am on my account homepage
And there is default currency configured
And the following zones are defined:
| name | type | members |
| Scandinavia | country | Norway, Sweden, Finland |

View file

@ -5,9 +5,9 @@ Feature: User account password change
I want to be able to change password
Background:
Given I am logged in user
Given there is default currency configured
And I am logged in user
And I am on my account homepage
And there is default currency configured
Scenario: Viewing my password change page
Given I follow "My password"

View file

@ -5,9 +5,9 @@ Feature: User account profile edition
I want to be able to edit my name and my email
Background:
Given I am logged in user
Given there is default currency configured
And I am logged in user
And I am on my account homepage
And there is default currency configured
Scenario: Viewing my personal information page
Given I follow "My personal information"

View file

@ -37,7 +37,7 @@ Feature: Checkout promotions with multiple rules and actions
And I added product "Sarge" to cart, with quantity "5"
When I add product "Lenny" to cart, with quantity "2"
Then I should be on the cart summary page
And "Promotion total: -27.75" should appear on the page
And "Promotion total: (27.75)" should appear on the page
And "Grand total: 127.25" should appear on the page
Scenario: Promotion is not applied when one of the cart does not

View file

@ -50,7 +50,7 @@ Feature: Checkout coupon promotions
And I press "Save"
Then I should be on the cart summary page
And I should see "Your promotion coupon has been added to the cart"
And "Promotion total: -5.00" should appear on the page
And "Promotion total: (5.00)" should appear on the page
And "Grand total: 115.00" should appear on the page
Scenario: An invalid coupon can not be added to the cart

View file

@ -39,5 +39,5 @@ Feature: Checkout limited time promotions
Given I am on the store homepage
When I added product "Sarge" to cart, with quantity "8"
Then I should be on the cart summary page
And "Promotion total: -20.00" should appear on the page
And "Promotion total: (20.00)" should appear on the page
And "Grand total: 160.00" should appear on the page

View file

@ -5,7 +5,8 @@ Feature: Checkout fixed discount promotions
I want to apply promotion discounts during checkout
Background:
Given I am logged in as user "klaus@example.com"
Given there is default currency configured
And I am logged in as user "klaus@example.com"
And the following countries exist:
| name |
| Germany |
@ -62,14 +63,13 @@ Feature: Checkout fixed discount promotions
And promotion "3rd order" has following actions defined:
| type | configuration |
| Fixed discount | Amount: 10 |
And there is default currency configured
Scenario: Fixed discount promotion is applied when the cart
has the required amount
Given I am on the store homepage
When I add product "Woody" to cart, with quantity "3"
Then I should be on the cart summary page
And "Promotion total: -40.00" should appear on the page
And "Promotion total: (40.00)" should appear on the page
And "Grand total: 295.00" should appear on the page
Scenario: Fixed discount promotion is not applied when the cart
@ -87,7 +87,7 @@ Feature: Checkout fixed discount promotions
And I added product "Etch" to cart, with quantity "1"
When I add product "Lenny" to cart, with quantity "2"
Then I should be on the cart summary page
And "Promotion total: -15.00" should appear on the page
And "Promotion total: (15.00)" should appear on the page
And "Grand total: 110.00" should appear on the page
Scenario: Item count promotion is not applied when the cart has
@ -105,7 +105,7 @@ Feature: Checkout fixed discount promotions
And I fill in the shipping address to Germany
And I press "Continue"
And I go to the cart summary page
Then "Promotion total: -40.00" should appear on the page
Then "Promotion total: (40.00)" should appear on the page
And "Grand total: 35.00" should appear on the page
Scenario: Shipping country promotion is not applied when shipping country does not match
@ -122,7 +122,7 @@ Feature: Checkout fixed discount promotions
Given I am on the store homepage
When I add product "Ubu" to cart, with quantity "1"
Then I should be on the cart summary page
And "Promotion total: -40.00" should appear on the page
And "Promotion total: (40.00)" should appear on the page
And "Grand total: 160.00" should appear on the page
Scenario: Ubuntu T-Shirts promotion is not applied when the cart does not contain Ubuntu T-Shirts
@ -163,7 +163,7 @@ Feature: Checkout fixed discount promotions
And I fill in the shipping address to Poland
And I press "Continue"
And I go to the cart summary page
And "Promotion total: -10.00" should appear on the page
And "Promotion total: (10.00)" should appear on the page
And "Grand total: 5.00" should appear on the page
Scenario: Nth order promotion is not applied when user have no orders before
@ -180,5 +180,5 @@ Feature: Checkout fixed discount promotions
And I added product "Buzz" to cart, with quantity "1"
When I add product "Woody" to cart, with quantity "3"
Then I should still be on the cart summary page
And "Promotion total: -55.00" should appear on the page
And "Promotion total: (55.00)" should appear on the page
And "Grand total: 1,500.00" should appear on the page

View file

@ -41,7 +41,7 @@ Feature: Checkout percentage discount promotions
Given I am on the store homepage
When I add product "Woody" to cart, with quantity "3"
Then I should be on the cart summary page
And "Promotion total: -30.00" should appear on the page
And "Promotion total: (30.00)" should appear on the page
And "Grand total: 315.00" should appear on the page
Scenario: Fixed discount promotion is not applied when the cart
@ -59,7 +59,7 @@ Feature: Checkout percentage discount promotions
And I added product "Etch" to cart, with quantity "1"
When I add product "Lenny" to cart, with quantity "2"
Then I should be on the cart summary page
And "Promotion total: -18.75" should appear on the page
And "Promotion total: (18.75)" should appear on the page
And "Grand total: 106.25" should appear on the page
Scenario: Item count promotion is not applied when the cart has
@ -77,5 +77,5 @@ Feature: Checkout percentage discount promotions
And I added product "Buzz" to cart, with quantity "1"
When I add product "Woody" to cart, with quantity "3"
Then I should still be on the cart summary page
And "Promotion total: -362.51" should appear on the page
And "Promotion total: (362.51)" should appear on the page
And "Grand total: 1,186.40" should appear on the page

View file

@ -41,7 +41,7 @@ Feature: Checkout usage limited promotions
Given I am on the store homepage
When I add product "Buzz" to cart, with quantity "2"
Then I should be on the cart summary page
And "Promotion total: -500.00" should appear on the page
And "Promotion total: (500.00)" should appear on the page
And "Grand total: 0.00" should appear on the page
Scenario: Promotion with usage limit is not applied when the

View file

@ -31,8 +31,8 @@ Feature: Checkout addressing
| zone | name | calculator | configuration |
| UK + Germany | DHL Express | Flat rate | Amount: 5000 |
| USA | FedEx | Flat rate | Amount: 6500 |
And I am logged in user
And there is default currency configured
And I am logged in user
Scenario: Filling the shipping address
Given I added product "PHP Top" to cart

View file

@ -23,8 +23,8 @@ Feature: Checkout inventory
And the following payment methods exist:
| name | gateway | enabled |
| Credit Card | dummy | yes |
And I am logged in as administrator
And there is default currency configured
And I am logged in as administrator
Scenario: Inventory is updated after buying products
Given I added product "PHP Top" to cart, with quantity "4"

View file

@ -8,6 +8,7 @@ Feature: Sign in to the store
Given there are following users:
| email | password | enabled |
| bar@foo.com | foo | yes |
And there is default currency configured
Scenario: Log in with username and password
Given I am on the store homepage

View file

@ -5,7 +5,8 @@ Feature: Sign in to the store via OAuth
I need to be able to log in to the store
Background:
Given I am not logged in
Given there is default currency configured
And I am not logged in
And I am on the store homepage
Scenario Outline: Get to the OAuth login page

View file

@ -8,6 +8,7 @@ Feature: User registration
Given there are following users:
| email | password |
| bar@bar.com | foo |
And there is default currency configured
Scenario: Successfully creating account in store
Given I am on the store homepage

View file

@ -5,8 +5,7 @@ Feature: Managing locales
I want to be able to configure locales
Background:
Given I am logged in as administrator
And there are following currencies configured:
Given there are following currencies configured:
| code | exchange rate | enabled |
| EUR | 1.00000 | yes |
And there are following locales configured:
@ -14,7 +13,7 @@ Feature: Managing locales
| de_DE | yes |
| en_US | no |
| fr_FR | yes |
And I am logged in as administrator
Scenario: Seeing index of all locales
Given I am on the dashboard page
When I follow "Locales"

View file

@ -11,6 +11,7 @@ Feature: Locale selection
| en_US | yes |
| fr_FR | no |
| pl_PL | yes |
And there is default currency configured
Scenario: Only enabled locales are visible to the user
Given I am on the store homepage

View file

@ -60,7 +60,7 @@ class MoneyContext extends DefaultContext
}
/**
* @Given there is default currency configured
* @Given /^there is default currency configured$/
*/
public function setupDefaultCurrency()
{