@@ -8,8 +8,8 @@ Feature: Add discount to cart
88 | sku | name | price |
99 | 001 | potatoes | 2 .5 |
1010 | 002 | water | 0 .95 |
11- And there is a cart discount "free shipping" for 1 euros with code "FREE-SHIPPING"
12- And there is a cart discount "special offer" for 10 euros with code "SPECIAL-OFFER"
11+ And there is a cart discount "free shipping" for 10 % with code "FREE-SHIPPING"
12+ And there is a cart discount "special offer" for 95 % with code "SPECIAL-OFFER"
1313 And I have a cart
1414
1515 Scenario : No discounts
@@ -20,14 +20,14 @@ Feature: Add discount to cart
2020 Scenario : Add discount
2121 Given I add 2 units of product "001" to my cart
2222 When I apply "FREE-SHIPPING" discount to my cart
23- Then the cart's total cost should be 4.0 euros
23+ Then the cart's total cost should be 4.50 euros
2424 And there should be discount "free shipping" in my cart
2525
2626 Scenario : Add discount only apply once
2727 Given I add 2 units of product "001" to my cart
2828 And I apply "FREE-SHIPPING" discount to my cart
2929 When I apply "FREE-SHIPPING" discount to my cart
30- Then the cart's total cost should be 4.0 euros
30+ Then the cart's total cost should be 4.50 euros
3131 And there should be discount "free shipping" in my cart
3232
3333 Scenario : Cart total should be always positive
@@ -37,3 +37,19 @@ Feature: Add discount to cart
3737 Then the cart's total cost should be 0.0 euros
3838 And there should be discount "free shipping" in my cart
3939 And there should be discount "special offer" in my cart
40+
41+ Scenario Outline : Add discount examples
42+ Given the following products exist:
43+ | sku | name | price |
44+ | 003 | orange juice | <product_price > |
45+ And there is a cart discount "super discount" for <percentage> % with code "SUPER-DISCOUNT"
46+ Given I add <product_quantity> units of product "003" to my cart
47+ When I apply "SUPER-DISCOUNT" discount to my cart
48+ Then the cart's total cost should be <cart_total> euros
49+ And there should be discount "super discount" in my cart
50+ Examples :
51+ | product_price | product_quantity | percentage | cart_total |
52+ | 21 .0 | 1 | 10 | 18 .90 |
53+ | 20 .0 | 2 | 15 | 34 .0 |
54+ | 5 .0 | 3 | 3 | 14 .55 |
55+ | 5 .0 | 3 | 0 | 15 .00 |
0 commit comments