|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminVerifyCustomerGroupNotLoggedInForGuestOrderTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Order view shows customer group for guest orders"/> |
| 15 | + <title value="Admin sees 'NOT LOGGED IN' customer group on guest order view"/> |
| 16 | + <description value="Place a guest order on storefront via Check/Money Order, open the order in Admin, and verify the customer group is 'NOT LOGGED IN'."/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="sales"/> |
| 19 | + <group value="admin"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <!-- Enable required configurations --> |
| 24 | + <magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} {{enabledCheckMoneyOrder.value}}" stepKey="enableCheckMoneyOrder"/> |
| 25 | + <magentoCLI command="config:set carriers/flatrate/active 1" stepKey="enableFlatRateShipping"/> |
| 26 | + <magentoCLI command="config:set checkout/options/guest_checkout 1" stepKey="enableGuestCheckout"/> |
| 27 | + |
| 28 | + <!-- Create a simple product for checkout --> |
| 29 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> |
| 30 | + |
| 31 | + <!-- Ensure indexes are up to date --> |
| 32 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> |
| 33 | + <argument name="indices" value=""/> |
| 34 | + </actionGroup> |
| 35 | + </before> |
| 36 | + |
| 37 | + <after> |
| 38 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 39 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 40 | + </after> |
| 41 | + |
| 42 | + <!-- Storefront: navigate to product and add to cart --> |
| 43 | + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> |
| 44 | + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> |
| 45 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 46 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 47 | + <argument name="productCount" value="1"/> |
| 48 | + </actionGroup> |
| 49 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 50 | + |
| 51 | + <!-- Storefront: guest checkout shipping and payment (Check/Money Order) --> |
| 52 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillShipping"> |
| 53 | + <argument name="customerVar" value="CustomerEntityOne"/> |
| 54 | + <argument name="customerAddressVar" value="CustomerAddressSimple"/> |
| 55 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> |
| 58 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 59 | + |
| 60 | + <!-- Capture order number from success page --> |
| 61 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> |
| 62 | + |
| 63 | + <!-- Admin: login and open the order by ID --> |
| 64 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 65 | + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> |
| 66 | + <argument name="orderId" value="$grabOrderNumber"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrderFromGrid"/> |
| 69 | + |
| 70 | + <!-- Assert customer group shows 'NOT LOGGED IN' --> |
| 71 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.customerGroup}}" stepKey="waitForCustomerGroupFieldOnOrderView"/> |
| 72 | + <waitForText selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="NOT LOGGED IN" stepKey="assertCustomerGroupIsNotLoggedIn"/> |
| 73 | + </test> |
| 74 | +</tests> |
| 75 | + |
| 76 | + |
| 77 | + |
0 commit comments