|
| 1 | +# ./vendor/bin/behat -c tests/Integration/Behaviour/behat.yml -s discount --tags update-discount-delivery-conditions |
| 2 | +@restore-all-tables-before-feature |
| 3 | +@restore-languages-after-feature |
| 4 | +@update-discount-delivery-conditions |
| 5 | +Feature: Update discount delivery conditions |
| 6 | + PrestaShop allows BO users to update delivery conditions on discounts |
| 7 | + As a BO user |
| 8 | + I must be able to remove or switch delivery conditions after they have been set |
| 9 | + |
| 10 | + Background: |
| 11 | + Given shop "shop1" with name "test_shop" exists |
| 12 | + Given there is a currency named "usd" with iso code "USD" and exchange rate of 0.92 |
| 13 | + Given language with iso code "en" is the default one |
| 14 | + And country "france" with iso code "FR" exists |
| 15 | + And country "spain" with iso code "ES" exists |
| 16 | + Given group "visitor" named "Visitor" exists |
| 17 | + Given group "guest" named "Guest" exists |
| 18 | + |
| 19 | + Scenario: Remove country delivery condition by switching to none |
| 20 | + When I create a "free_shipping" discount "discount_countries_to_none" with following properties: |
| 21 | + | name[en-US] | Free shipping FR+ES | |
| 22 | + | countries | france,spain | |
| 23 | + Then discount "discount_countries_to_none" should have the following properties: |
| 24 | + | countries | spain,france | |
| 25 | + When I update discount "discount_countries_to_none" with the following properties: |
| 26 | + | countries | | |
| 27 | + Then discount "discount_countries_to_none" should have the following properties: |
| 28 | + | countries | | |
| 29 | + |
| 30 | + Scenario: Remove carrier delivery condition by switching to none |
| 31 | + Given I add new zone "zone1" with following properties: |
| 32 | + | name | zone1 | |
| 33 | + | enabled | true | |
| 34 | + Given I create carrier "carrier1" with specified properties: |
| 35 | + | name | Carrier 1 | |
| 36 | + | grade | 1 | |
| 37 | + | trackingUrl | http://example.com/track.php?num=@ | |
| 38 | + | active | true | |
| 39 | + | max_width | 1454 | |
| 40 | + | max_height | 1234 | |
| 41 | + | max_depth | 1111 | |
| 42 | + | max_weight | 3864 | |
| 43 | + | group_access | visitor, guest | |
| 44 | + | delay[en-US] | Shipping delay | |
| 45 | + | shippingHandling | false | |
| 46 | + | isFree | true | |
| 47 | + | shippingMethod | weight | |
| 48 | + | zones | zone1 | |
| 49 | + | rangeBehavior | disabled | |
| 50 | + When I create a "free_shipping" discount "discount_carriers_to_none" with following properties: |
| 51 | + | name[en-US] | Free shipping carrier1 | |
| 52 | + | carriers | carrier1 | |
| 53 | + Then discount "discount_carriers_to_none" should have the following properties: |
| 54 | + | carriers | carrier1 | |
| 55 | + When I update discount "discount_carriers_to_none" with the following properties: |
| 56 | + | carriers | | |
| 57 | + Then discount "discount_carriers_to_none" should have the following properties: |
| 58 | + | carriers | | |
| 59 | + |
| 60 | + Scenario: Switch from country condition to carrier condition clears countries |
| 61 | + Given I add new zone "zone2" with following properties: |
| 62 | + | name | zone2 | |
| 63 | + | enabled | true | |
| 64 | + Given I create carrier "carrier2" with specified properties: |
| 65 | + | name | Carrier 2 | |
| 66 | + | grade | 1 | |
| 67 | + | trackingUrl | http://example.com/track.php?num=@ | |
| 68 | + | active | true | |
| 69 | + | max_width | 1454 | |
| 70 | + | max_height | 1234 | |
| 71 | + | max_depth | 1111 | |
| 72 | + | max_weight | 3864 | |
| 73 | + | group_access | visitor, guest | |
| 74 | + | delay[en-US] | Shipping delay | |
| 75 | + | shippingHandling | false | |
| 76 | + | isFree | true | |
| 77 | + | shippingMethod | weight | |
| 78 | + | zones | zone2 | |
| 79 | + | rangeBehavior | disabled | |
| 80 | + When I create a "free_shipping" discount "discount_countries_to_carriers" with following properties: |
| 81 | + | name[en-US] | Free shipping countries | |
| 82 | + | countries | france | |
| 83 | + Then discount "discount_countries_to_carriers" should have the following properties: |
| 84 | + | countries | france | |
| 85 | + When I update discount "discount_countries_to_carriers" with the following properties: |
| 86 | + | carriers | carrier2 | |
| 87 | + | countries | | |
| 88 | + Then discount "discount_countries_to_carriers" should have the following properties: |
| 89 | + | carriers | carrier2 | |
| 90 | + | countries | | |
| 91 | + |
| 92 | + Scenario: Switch from carrier condition to country condition clears carriers |
| 93 | + Given I add new zone "zone3" with following properties: |
| 94 | + | name | zone3 | |
| 95 | + | enabled | true | |
| 96 | + Given I create carrier "carrier3" with specified properties: |
| 97 | + | name | Carrier 3 | |
| 98 | + | grade | 1 | |
| 99 | + | trackingUrl | http://example.com/track.php?num=@ | |
| 100 | + | active | true | |
| 101 | + | max_width | 1454 | |
| 102 | + | max_height | 1234 | |
| 103 | + | max_depth | 1111 | |
| 104 | + | max_weight | 3864 | |
| 105 | + | group_access | visitor, guest | |
| 106 | + | delay[en-US] | Shipping delay | |
| 107 | + | shippingHandling | false | |
| 108 | + | isFree | true | |
| 109 | + | shippingMethod | weight | |
| 110 | + | zones | zone3 | |
| 111 | + | rangeBehavior | disabled | |
| 112 | + When I create a "free_shipping" discount "discount_carriers_to_countries" with following properties: |
| 113 | + | name[en-US] | Free shipping carrier3 | |
| 114 | + | carriers | carrier3 | |
| 115 | + Then discount "discount_carriers_to_countries" should have the following properties: |
| 116 | + | carriers | carrier3 | |
| 117 | + When I update discount "discount_carriers_to_countries" with the following properties: |
| 118 | + | countries | spain | |
| 119 | + | carriers | | |
| 120 | + Then discount "discount_carriers_to_countries" should have the following properties: |
| 121 | + | countries | spain | |
| 122 | + | carriers | | |
0 commit comments