<commit_before>@promotions
Feature: Checkout coupon promotions
    In order to handle product promotions
    As a store owner
    I want to apply promotion discounts during checkout

    Background:
        Given the following promotions exist:
          | name                      | description            |
          | Press campaign            | Coupon based promotion |
          | New Year campaign         | Coupon based promotion |
        And promotion "Press campaign" has following rules defined:
          | type       | configuration |
          | Item total | Amount: 100   |
        And promotion "Press campaign" has following coupons:
          | code   | usage limit | used |
          | XD0001 | 1           | 0    |
        And promotion "New Year campaign" has following rules defined:
          | type       | configuration |
          | Item count | Count: 2      |
        And promotion "New Year campaign" has following actions defined:
          | type           | configuration |
          | Fixed discount | Amount: 10     |
        And promotion "New Year campaign" has following coupons:
          | code   | usage limit | used |
          | XD0002 | 1           | 1    |
        And there are following taxonomies defined:
          | name     |
          | Category |
        And taxonomy "Category" has following taxons:
          | Clothing > Debian T-Shirts |
        And the following products exist:
          | name    | price | taxons          |
          | Buzz    | 500   | Debian T-Shirts |
          | Potato  | 200   | Debian T-Shirts |
          | Woody   | 125   | Debian T-Shirts |
          | Sarge   | 25    | Debian T-Shirts |
          | Etch    | 20    | Debian T-Shirts |
          | Lenny   | 1     | Debian T-Shirts |
        And there is default currency configured

    Scenario: Promotion with coupons is applied when the customer
              has added a valid coupon
        Given I am on the store homepage
          And I added product "Etch" to cart, with quantity "6"
         When I fill in "Code" with "XD0001"
          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 "Grand total: €115.00" should appear on the page

    Scenario: An invalid coupon can not be added to the cart
        Given I am on the store homepage
          And I added product "Etch" to cart, with quantity "5"
         When I fill in "Code" with "an invalid coupon"
          And I press "Save"
         Then I should be on the cart summary page
          And I should see "Your promotion coupon is not valid"
          And "Promotion total" should not appear on the page
          And "Grand total: €100.00" should appear on the page

    Scenario: A valid coupon can not be added to the cart if the cart does<commit_msg>Fix coupon scenario<commit_after>@promotions
Feature: Checkout coupon promotions
    In order to handle product promotions
    As a store owner
    I want to apply promotion discounts during checkout

    Background:
        Given the following promotions exist:
          | name                      | description            |
          | Press campaign            | Coupon based promotion |
          | New Year campaign         | Coupon based promotion |
        And promotion "Press campaign" has following rules defined:
          | type       | configuration |
          | Item total | Amount: 100   |
        And promotion "Press campaign" has following coupons:
          | code   | usage limit | used |
          | XD0001 | 1           | 0    |
        And promotion "Press campaign" has following actions defined:
          | type           | configuration |
          | Fixed discount | Amount: 5     |
        And promotion "New Year campaign" has following rules defined:
          | type       | configuration |
          | Item count | Count: 2      |
        And promotion "New Year campaign" has following actions defined:
          | type           | configuration |
          | Fixed discount | Amount: 10    |
        And promotion "New Year campaign" has following coupons:
          | code   | usage limit | used |
          | XD0002 | 1           | 1    |
        And there are following taxonomies defined:
          | name     |
          | Category |
        And taxonomy "Category" has following taxons:
          | Clothing > Debian T-Shirts |
        And the following products exist:
          | name    | price | taxons          |
          | Buzz    | 500   | Debian T-Shirts |
          | Potato  | 200   | Debian T-Shirts |
          | Woody   | 125   | Debian T-Shirts |
          | Sarge   | 25    | Debian T-Shirts |
          | Etch    | 20    | Debian T-Shirts |
          | Lenny   | 1     | Debian T-Shirts |
        And there is default currency configured

    Scenario: Promotion with coupons is applied when the customer
              has added a valid coupon
        Given I am on the store homepage
          And I added product "Etch" to cart, with quantity "6"
         When I fill in "Code" with "XD0001"
          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 "Grand total: €115.00" should appear on the page

    Scenario: An invalid coupon can not be added to the cart
        Given I am on the store homepage
          And I added product "Etch" to cart, with quantity "5"
         When I fill in "Code" with "an invalid coupon"
          And I press "Save"
         Then I should be on the cart summary page
          And I should see "Your promotion coupon is not valid"
          And "Promotion total" should not appear on the page
          And "Grand total: €100.00" should appear on the page

    Scenario: A valid coupon can not be added to the cart if the cart does
{'fraction_non_alphanumeric': 0.055335315493888336, 'fraction_numerical': 0.017013544763792535, 'mean_word_length': 1.6756517896597436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4223159', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1451, 'n_words': 705}