<commit_before>@frontend @checkout
Feature: Checkout process
    In order to buy products
    As a visitor
    I want to be able to use checkout process

    @200
    Scenario: No checkout for empty basket
        Given I am on "shop/catalog"
        When I go to "shop/basket"
        Then I should see "Your basket is empty"
        But I should not see "Next step"

    Scenario: Checkout with one product in the basket when not logged in
        Given I am on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "3"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Username"

    Scenario: Checkout with one product in the basket when logging in
        Given I am connected with "behat_user" and "behat_user" on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "3"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Update the delivery step"
        When I fill in "sonata_basket_address_name" with "Behat #1 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        And I press "Update the delivery step"
        Then I should see "Free delivery"
        And I press "Update the delivery step"
        Then I should see "Update the payment step"
        When I fill in "sonata_basket_address_name" with "Behat #2 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        When I press "Update the payment step"
        Then I should see "Pass"
        And I press "Update the payment step"
        And I check "basket_tac"
        And I press "Process to payment"
        Then the response should contain "Confirmation payment valid"

    Scenario: Ensure to see order
        Given I am connected with "behat_user" and "behat_user" on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "10"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Update the delivery step"
        When I fill in "sonata_basket_address_name" with "Behat #1 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        And I press "Update the delivery step"
        Then I should see "Free delivery"
        And I press "Update the delivery step"
        Then I should see "Update the payment step"
        When I fill in "sonata_basket_address_name" with "Behat #2 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        When I press "Update the payment step"
        Then I should see "Pass"
        And I press "Update the payment step"
        And I check "basket_tac"
        And I press "Process to payment"
        Then the response should contain "Confirmation payment valid"
        And the response should contain "Check your order"

    Scenario: Ensure to see an invoice
        Given I am connected with "behat_user" and "behat_user" on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "10"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Update the delivery step"
        When I fill in "sonata_basket_address_name" with "Behat #1 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        And I press "Update the delivery step"
        Then I should see "Free delivery"
        And I press "Update the delivery step"
        Then I should see "Update the payment step"
        When I fill in "sonata_basket_address_name" with "Behat #2 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        When I press "Update the payment step"
        Then I should see "Pass"
        And I press "Update the payment step"
        And I check "basket_tac"
        And I press "Process to payment"
        And I follow "Check your order"
        Then I should see "Your invoice"
        And I follow "Your invoice"
        Then the response status code should be 200<commit_msg>Updated behat test to avoid regression from https://github.com/sonata-project/ecommerce/pull/191<commit_after>@frontend @checkout
Feature: Checkout process
    In order to buy products
    As a visitor
    I want to be able to use checkout process

    @200
    Scenario: No checkout for empty basket
        Given I am on "shop/catalog"
        When I go to "shop/basket"
        Then I should see "Your basket is empty"
        But I should not see "Next step"

    Scenario: Checkout with one product in the basket when not logged in
        Given I am on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "3"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Username"

    Scenario: Checkout with one product in the basket when logging in
        Given I am connected with "behat_user" and "behat_user" on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "3"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Update the delivery step"
        When I fill in "sonata_basket_address_name" with "Behat #1 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        And I press "Update the delivery step"
        Then I should see "Free delivery"
        And I press "Update the delivery step"
        Then I should see "Update the payment step"
        When I fill in "sonata_basket_address_name" with "Behat #2 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        When I press "Update the payment step"
        Then I should see "Pass"
        And I press "Update the payment step"
        And I check "basket_tac"
        And I press "Process to payment"
        Then the response should contain "Confirmation payment valid"

    Scenario: Ensure to see order
        Given I am connected with "behat_user" and "behat_user" on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "10"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Update the delivery step"
        When I fill in "sonata_basket_address_name" with "Behat #1 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        And I press "Update the delivery step"
        Then I should see "Free delivery"
        And I press "Update the delivery step"
        Then I should see "Update the payment step"
        When I fill in "sonata_basket_address_name" with "Behat #2 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        When I press "Update the payment step"
        Then I should see "Pass"
        And I press "Update the payment step"
        And I check "basket_tac"
        And I press "Process to payment"
        Then the response should contain "Confirmation payment valid"
        And the response should contain "Check your order"

    Scenario: Ensure to see an invoice
        Given I am connected with "behat_user" and "behat_user" on "shop/basket"
        And I should see "Your basket is empty"
        And I go to "shop/catalog"
        And I follow "Goodies"
        And I follow "Plushes"
        And I follow "PHP plush"
        And I fill in "add_basket_quantity" with "10"
        And I press "Add to basket"
        And I follow "Next step"
        Then I should see "Update the delivery step"
        When I fill in "sonata_basket_address_name" with "Behat #1 address name"
        And I fill in "sonata_basket_address_firstname" with "firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        And I press "Update the delivery step"
        Then I should see "Free delivery"
        And I press "Update the delivery step"
        Then I should see "Update the payment step"
        When I fill in "sonata_basket_address_name" with "Behat #2 address name"
        And I fill in "sonata_basket_address_firstname" with "billing firstname"
        And I fill in "sonata_basket_address_lastname" with "lastname"
        And I fill in "sonata_basket_address_address1" with "Address 1"
        And I fill in "sonata_basket_address_address2" with "Address 2"
        And I fill in "sonata_basket_address_address3" with "Address 3"
        And I fill in "sonata_basket_address_postcode" with "ABC123"
        And I fill in "sonata_basket_address_city" with "New York"
        And I fill in "sonata_basket_address_countryCode" with "FR"
        And I fill in "sonata_basket_address_phone" with "55512345"
        When I press "Update the payment step"
        Then I should see "Pass"
        And I press "Update the payment step"
        And I check "basket_tac"
        And I press "Process to payment"
        And I follow "Check your order"
        Then I should see "Your invoice"
        And I follow "Your invoice"
        Then I should see "billing firstname lastname"
        Then the response status code should be 200
{'fraction_non_alphanumeric': 0.054847407770560117, 'fraction_numerical': 0.014891530824855987, 'mean_word_length': 2.7428899082568807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '4878047', 'n_tokens_mistral': 5014, 'n_tokens_neox': 4842, 'n_words': 2034}