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

    Background:
        Given the following products exist:
          | name   | price |
          | Lenny  | 15    |
          | Buzz   | 500   |
          | Potato | 200   |
          | Etch   | 20    |
          | Woody  | 125   |
          | Sarge  | 25    |
          | Ubu    | 200   |
        And the following promotions exist:
          | name                | description                      |
          | Free product        | Almost free product over 100 eur |
        And promotion "Free product" has following rules defined:
          | type       | configuration |
          | Item total | Amount: 100   |
        And promotion "Free product" has following actions defined:
          | type        | configuration                     |
          | Add product | variant:Ubu,quantity:1,price:10 |
        And there is default currency configured

    Scenario: Free product is not applied when the cart
              has not the required amount
        Given I am on the store homepage
         When I add product "Etch" to cart, with quantity "1"
         Then I should be on the cart summary page
          And "Ubu" should not appear on the page
          And "Grand total: €20.00" should appear on the page

    Scenario: Free product is applied when the cart has the
              required amount
        Given I am on the store homepage
         When I add product "Potato" to cart, with quantity "3"
         Then I should be on the cart summary page
          And "Ubu" should appear on the page
          And "Grand total: €610.00" should appear on the page
<commit_msg>Fix promotion scenario<commit_after>@promotions
Feature: Checkout product promotion
    In order to handle product promotions
    As a store owner
    I want to apply promotion discounts during checkout

    Background:
        Given the following products exist:
          | name   | price |
          | Ubu    | 200   |
          | Lenny  | 15    |
          | Buzz   | 500   |
          | Potato | 200   |
          | Etch   | 20    |
          | Woody  | 125   |
          | Sarge  | 25    |
        And the following promotions exist:
          | name                | description                      |
          | Free product        | Almost free product over 100 eur |
        And promotion "Free product" has following rules defined:
          | type       | configuration |
          | Item total | Amount: 100   |
        And promotion "Free product" has following actions defined:
          | type        | configuration                     |
          | Add product | variant:Ubu,quantity:1,price:10 |
        And there is default currency configured

    Scenario: Free product is not applied when the cart
              has not the required amount
        Given I am on the store homepage
         When I add product "Etch" to cart, with quantity "1"
         Then I should be on the cart summary page
          And "Ubu" should not appear on the page
          And "Grand total: €20.00" should appear on the page

    Scenario: Free product is applied when the cart has the
              required amount
        Given I am on the store homepage
         When I add product "Potato" to cart, with quantity "3"
         Then I should be on the cart summary page
          And "Ubu" should appear on the page
          And "Grand total: €610.00" should appear on the page

{'fraction_non_alphanumeric': 0.04939657591916924, 'fraction_numerical': 0.021330339601459445, 'mean_word_length': 1.6071689831748355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6074146', 'n_tokens_mistral': 935, 'n_tokens_neox': 838, 'n_words': 410}