Skip to content

Commit 0d5d09b

Browse files
authored
Merge ENGCOM-7154-magento-magento2-27270 into 2.4.1-develop-prs
2 parents 4db9f5f + c471500 commit 0d5d09b

File tree

3 files changed

+161
-0
lines changed

3 files changed

+161
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="AdminCreateSimpleProductActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="category"/>
17+
<argument name="simpleProduct"/>
18+
</arguments>
19+
20+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
21+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
22+
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
23+
<fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
24+
<fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
25+
<fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
26+
<fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
27+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/>
28+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
29+
<fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
30+
31+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
32+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
33+
<seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/>
34+
<seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/>
35+
<seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/>
36+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/>
37+
<seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/>
38+
</actionGroup>
39+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="StorefrontDisableMoveJsCodeBottom">
12+
<!-- Magento default value -->
13+
<data key="path">dev/js/move_script_to_bottom</data>
14+
<data key="label">No</data>
15+
<data key="value">0</data>
16+
</entity>
17+
<entity name="StorefrontEnableMoveJsCodeBottom">
18+
<data key="path">dev/js/move_script_to_bottom</data>
19+
<data key="label">Yes</data>
20+
<data key="value">1</data>
21+
</entity>
22+
</entities>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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="StorefrontCreateOrdersWithMoveJSCodeBottomTest">
12+
<annotations>
13+
<title value="Create a product and orders with set 'Move Js code to the bottom' to 'Yes'."/>
14+
<description value="Create a product and orders with a set 'Move JS code to the bottom of the page' to 'Yes' for registered customers and guests."/>
15+
</annotations>
16+
<before>
17+
<magentoCLI command="config:set {{StorefrontEnableMoveJsCodeBottom.path}} {{StorefrontEnableMoveJsCodeBottom.value}}" stepKey="moveJsCodeBottomEnable"/>
18+
<magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/>
19+
<actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/>
20+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage"/>
21+
<actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory">
22+
<argument name="categoryEntity" value="_defaultCategory"/>
23+
</actionGroup>
24+
<actionGroup ref="AdminCreateSimpleProductActionGroup" stepKey="createSimpleProduct">
25+
<argument name="category" value="_defaultCategory"/>
26+
<argument name="simpleProduct" value="_defaultProduct"/>
27+
</actionGroup>
28+
</before>
29+
<after>
30+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage"/>
31+
<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory">
32+
<argument name="categoryEntity" value="_defaultCategory"/>
33+
</actionGroup>
34+
<actionGroup ref="DeleteProductActionGroup" stepKey="deleteSimpleProduct">
35+
<argument name="productName" value="_defaultProduct.name"/>
36+
</actionGroup>
37+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
38+
<argument name="customerEmail" value="Simple_US_Customer.email"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
41+
42+
<magentoCLI command="config:set {{StorefrontDisableMoveJsCodeBottom.path}} {{StorefrontDisableMoveJsCodeBottom.value}}" stepKey="moveJsCodeBottomDisable"/>
43+
<magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/>
44+
</after>
45+
46+
<!-- Go to Storefront and place order for guest -->
47+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
48+
<argument name="productUrl" value="{{_defaultProduct.urlKey}}"/>
49+
</actionGroup>
50+
51+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
52+
<argument name="product" value="_defaultProduct"/>
53+
<argument name="productCount" value="1"/>
54+
</actionGroup>
55+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromCart"/>
56+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress">
57+
<argument name="customer" value="Simple_Customer_Without_Address" />
58+
<argument name="address" value="US_Address_TX"/>
59+
</actionGroup>
60+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping">
61+
<argument name="shippingMethodName" value="Flat Rate"/>
62+
</actionGroup>
63+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutReview"/>
64+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
65+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="guestPlaceOrder" />
66+
67+
<!-- Go to frontend and make a user account and login with it -->
68+
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>
69+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
70+
<argument name="customer" value="Simple_US_Customer"/>
71+
</actionGroup>
72+
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/>
73+
<actionGroup ref="AssertMessageCustomerCreateAccountActionGroup" stepKey="seeSuccessMessage">
74+
<argument name="messageType" value="success"/>
75+
<argument name="message" value="Thank you for registering with Main Website Store."/>
76+
</actionGroup>
77+
<actionGroup ref="StorefrontAddNewCustomerAddressActionGroup" stepKey="AddNewAddress">
78+
<argument name="Address" value="US_Address_TX"/>
79+
</actionGroup>
80+
81+
<!-- Go to Storefront and place order for customer -->
82+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage2">
83+
<argument name="productUrl" value="{{_defaultProduct.urlKey}}"/>
84+
</actionGroup>
85+
86+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart2">
87+
<argument name="product" value="_defaultProduct"/>
88+
<argument name="productCount" value="1"/>
89+
</actionGroup>
90+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="customerGoToCheckoutFromCart"/>
91+
92+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping2">
93+
<argument name="shippingMethodName" value="Flat Rate"/>
94+
</actionGroup>
95+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutReview2"/>
96+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment2"/>
97+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="customerPlaceOrder" />
98+
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="singOutCustomer" />
99+
</test>
100+
</tests>

0 commit comments

Comments
 (0)