Skip to content

Commit ba0a8fc

Browse files
committed
MAGETWO-92957: Automate with MFTF Add and Edit one Bundle product with different set of sub-items to the Shopping Cart
1 parent 5d9657e commit ba0a8fc

9 files changed

+49
-67
lines changed

app/code/Magento/Bundle/Test/Mftf/Page/AdminProductCreatePage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11-
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true">
11+
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Bundle" parameterized="true">
1212
<section name="AdminProductFormBundleSection"/>
1313
</page>
1414
</pages>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Bundle" parameterized="true">
12+
<section name="StorefrontBundledSection"/>
13+
</page>
14+
</pages>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
<!-- Create a bundle product -->
3333
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
3434
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
35-
<actionGroup ref="AdminCreateProductActionGroup" stepKey="goToCreateBundleProduct">
35+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct">
3636
<argument name="product" value="BundleProduct"/>
3737
</actionGroup>
3838

39-
<actionGroup ref="AdminFillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku">
39+
<actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku">
4040
<argument name="product" value="BundleProduct"/>
4141
</actionGroup>
4242

@@ -117,7 +117,7 @@
117117
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
118118

119119
<!-- Delete the bundled product -->
120-
<actionGroup ref="AdminDeleteProductUsingProductGridActionGroup" stepKey="deleteBundle">
120+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundle">
121121
<argument name="product" value="BundleProduct"/>
122122
</actionGroup>
123123
</test>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductUsingProductGridActionGroup.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductNameAndSkuInProductFormActionGroup.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateProductActionGroup.xml renamed to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
1111
<!--Navigate to create product page from product grid page-->
12-
<actionGroup name="AdminCreateProductActionGroup">
12+
<actionGroup name="goToCreateProductPage">
1313
<arguments>
1414
<argument name="product" defaultValue="_defaultProduct"/>
1515
</arguments>
@@ -20,4 +20,13 @@
2020
<seeInCurrentUrl url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, product.type_id)}}" stepKey="seeNewProductUrl"/>
2121
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductTitle"/>
2222
</actionGroup>
23+
24+
<!--Fill main fields in create product form with name and sku -->
25+
<actionGroup name="fillProductNameAndSkuInProductForm">
26+
<arguments>
27+
<argument name="product"/>
28+
</arguments>
29+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
30+
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
31+
</actionGroup>
2332
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,25 @@
2828
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
2929
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
3030
</actionGroup>
31+
32+
<!--Delete a product by filtering grid and using delete action-->
33+
<actionGroup name="deleteProductUsingProductGrid">
34+
<arguments>
35+
<argument name="product"/>
36+
</arguments>
37+
<!--TODO use other action group for filtering grid when MQE-539 is implemented -->
38+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
39+
<waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/>
40+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
41+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
42+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
43+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
44+
<see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
45+
<click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/>
46+
<click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/>
47+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
48+
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/>
49+
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
50+
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
51+
</actionGroup>
3152
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,6 @@
134134
<data key="status">1</data>
135135
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
136136
</entity>
137-
<entity name="VirtualProduct" type="product">
138-
<data key="sku" unique="suffix">virtualproduct</data>
139-
<data key="type_id">virtual</data>
140-
<data key="attribute_set_id">4</data>
141-
<data key="name" unique="suffix">VirtualProduct</data>
142-
<data key="price">99.99</data>
143-
<data key="quantity">250</data>
144-
<data key="weight">0</data>
145-
<data key="status">1</data>
146-
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
147-
</entity>
148137
<entity name="SimpleProductWithNewFromDate" type="product">
149138
<data key="sku" unique="suffix">SimpleProduct</data>
150139
<data key="type_id">simple</data>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontProductPage.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
1111
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Category" parameterized="true">
1212
<section name="StorefrontProductPageSection"/>
13-
<section name="StorefrontBundledSection"/>
1413
</page>
1514
</pages>

0 commit comments

Comments
 (0)