Skip to content

Commit 9f090db

Browse files
committed
ACQE-8963: To verify customer group for guest users
- New automation test file has been added
1 parent 9a62604 commit 9f090db

File tree

2 files changed

+162
-0
lines changed

2 files changed

+162
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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="SATest">
12+
<annotations>
13+
<features value="OnePageCheckout"/>
14+
<stories value="OnePageCheckout within Offline Payment Methods"/>
15+
<title value="OnePageCheckout as a customer with non-existent customer group assigned to the quote"/>
16+
<description value="Checkout as a customer with non-existent customer group assigned to the quote"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-36385"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Simple Product -->
23+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
24+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
25+
26+
27+
28+
</before>
29+
<after>
30+
<!-- Admin log out -->
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
32+
33+
<!-- Customer log out -->
34+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
35+
36+
<!-- Delete created product -->
37+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
38+
39+
<!-- Delete customer -->
40+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
41+
</after>
42+
43+
<!-- Login as customer -->
44+
45+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
46+
<argument name="indices" value=""/>
47+
</actionGroup>
48+
<!-- Add Simple Product to cart -->
49+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
50+
<waitForPageLoad stepKey="waitForSimpleProductPageLoad"/>
51+
52+
53+
<!-- Delete customer group -->
54+
55+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
56+
<argument name="product" value="$$createSimpleProduct$$"/>
57+
<argument name="productCount" value="1"/>
58+
</actionGroup>
59+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
60+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
61+
<argument name="customerVar" value="CustomerEntityOne"/>
62+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
63+
</actionGroup>
64+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="guestSelectCheckMoneyOrderPayment"/>
65+
66+
67+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
68+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
69+
70+
<!--Check subtotal in created order-->
71+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
72+
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById">
73+
<argument name="orderId" value="$grabOrderNumber"/>
74+
</actionGroup>
75+
76+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
77+
<!-- <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>-->
78+
79+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.customerGroup}}" stepKey="waitForCustomerGroupFieldOnOrderView"/>
80+
<waitForText selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="NOT LOGGED IN" stepKey="assertCustomerGroupIsNotLoggedIn"/>
81+
82+
83+
84+
</test>
85+
</tests>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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

Comments
 (0)