Skip to content

Commit 98de601

Browse files
committed
MC-6353: Product in the shopping cart could be reached by admin during order creation with multi website config
1 parent 70d2287 commit 98de601

4 files changed

+164
-0
lines changed

app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerAccountCreatePageActionGroup.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@
1616
<amOnPage url="{{StorefrontCustomerCreatePage.url}}" stepKey="goToCustomerAccountCreatePage"/>
1717
<waitForPageLoad stepKey="waitForPageLoaded"/>
1818
</actionGroup>
19+
20+
<actionGroup name="StorefrontOpenCustomerAccountCreatePageUsingStoreCodeInUrlActionGroup">
21+
<annotations>
22+
<description>Goes to the Storefront Customer Create page using Store code in URL option.</description>
23+
</annotations>
24+
<arguments>
25+
<argument name="storeView" type="string" defaultValue="{{customStore.code}}"/>
26+
</arguments>
27+
28+
<amOnPage url="{{StorefrontStoreHomePage.url(storeView)}}{{StorefrontCustomerCreatePage.url}}" stepKey="goToCustomerAccountCreatePage"/>
29+
<waitForPageLoad stepKey="waitForPageLoaded"/>
30+
</actionGroup>
1931
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertProductInShoppingCartSectionActionGroup">
12+
<annotations>
13+
<description>Assert product in Shopping cart section in Customer's Activities block on Create Order Page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="string"/>
17+
</arguments>
18+
19+
<see selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="{{product}}" stepKey="seeProductInShoppingCart"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminMoveProductToItemsOrderedFromShoppingCartActionGroup">
12+
<annotations>
13+
<description>Move product to the "Items Ordered" section from shopping cart.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="string"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox(product)}}" stepKey="waitForAddToOrderCheckBox"/>
20+
<click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox(product)}}" stepKey="selectProduct"/>
21+
<click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/>
22+
<waitForPageLoad stepKey="waitForAdminCreateOrderShoppingCartSectionPageLoad"/>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
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="AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest">
12+
<annotations>
13+
<stories value="Admin create order"/>
14+
<title value="Product in the shopping cart could be reached by admin during order creation with multi website config"/>
15+
<description value="Product in the shopping cart could be reached by admin during order creation with multi website config"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-6353"/>
18+
<group value="sales"/>
19+
<skip>
20+
<issueId value="MC-20129"/>
21+
</skip>
22+
</annotations>
23+
<before>
24+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/>
25+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite">
28+
<argument name="newWebsiteName" value="{{customWebsite.name}}"/>
29+
<argument name="websiteCode" value="{{customWebsite.code}}"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore">
32+
<argument name="website" value="{{customWebsite.name}}"/>
33+
<argument name="storeGroupName" value="{{customStoreGroup.name}}"/>
34+
<argument name="storeGroupCode" value="{{customStoreGroup.code}}"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
37+
<argument name="StoreGroup" value="customStoreGroup"/>
38+
<argument name="customStore" value="customStore"/>
39+
</actionGroup>
40+
<actionGroup ref="goToProductPageViaID" stepKey="goToProductEditPage">
41+
<argument name="productId" value="$$createProduct.id$$"/>
42+
</actionGroup>
43+
<actionGroup ref="ProductSetWebsite" stepKey="assignProductToSecondWebsite">
44+
<argument name="website" value="{{customWebsite.name}}"/>
45+
</actionGroup>
46+
</before>
47+
<after>
48+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlDisable"/>
49+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
50+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
51+
<argument name="customerEmail" value="Simple_US_Customer.email"/>
52+
</actionGroup>
53+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
54+
<argument name="websiteName" value="{{customWebsite.name}}"/>
55+
</actionGroup>
56+
<actionGroup ref="logout" stepKey="logout"/>
57+
</after>
58+
59+
<!--Create customer account for Second Website-->
60+
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageUsingStoreCodeInUrlActionGroup" stepKey="goToCreateCustomerPage"/>
61+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
62+
<argument name="customer" value="Simple_US_Customer"/>
63+
</actionGroup>
64+
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/>
65+
<actionGroup ref="AssertMessageCustomerCreateAccountActionGroup" stepKey="assertSuccessMessage">
66+
<argument name="message" value="Thank you for registering with {{customStoreGroup.name}}." />
67+
</actionGroup>
68+
69+
<!--Open product page and add to cart-->
70+
<actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl">
71+
<argument name="product" value="$$createProduct$$"/>
72+
<argument name="storeView" value="customStore"/>
73+
</actionGroup>
74+
<actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/>
75+
76+
<!--Create new order for existing Customer And Store-->
77+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder">
78+
<argument name="customer" value="Simple_US_Customer"/>
79+
<argument name="storeView" value="customStore"/>
80+
</actionGroup>
81+
82+
<!--Assert product in Shopping cart section-->
83+
<actionGroup ref="AdminAssertProductInShoppingCartSectionActionGroup" stepKey="seeProductInShoppingCart">
84+
<argument name="product" value="$$createProduct.name$$"/>
85+
</actionGroup>
86+
87+
<!--Move product to the order from shopping cart-->
88+
<actionGroup ref="AdminMoveProductToItemsOrderedFromShoppingCartActionGroup" stepKey="addProductToItemsOrderedFromShoppingCart">
89+
<argument name="product" value="$$createProduct.name$$"/>
90+
</actionGroup>
91+
92+
<!--Fill customer address information-->
93+
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress">
94+
<argument name="customer" value="Simple_US_Customer"/>
95+
<argument name="address" value="US_Address_TX"/>
96+
</actionGroup>
97+
98+
<!--Select shipping method-->
99+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/>
100+
101+
<!--Checkout select Check/Money Order payment-->
102+
<actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/>
103+
104+
<!--Submit Order and verify information-->
105+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
106+
</test>
107+
</tests>

0 commit comments

Comments
 (0)