Skip to content

Commit fe6298b

Browse files
committed
refactored AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest
1 parent 479f304 commit fe6298b

8 files changed

+218
-92
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertManageStockOnEditPageActionGroup">
12+
<annotations>
13+
<description>Check if manageStock value is correct (the Product Edit page should be opened in Admin prior this check).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="manageStock" type="string"/>
17+
</arguments>
18+
19+
<see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="seeManageStock"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="AdminAssertProductInfoOnEditPageActionGroup">
12+
<annotations>
13+
<description>Validates next fields on the Edit Product Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
<waitForPageLoad stepKey="waitForProductToLoad"/>
19+
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="seeProductName"/>
20+
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSku"/>
21+
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="seeProductPrice"/>
22+
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="seeProductQuantity"/>
23+
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="seeProductStockStatus"/>
24+
<seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="seeProductTaxClass"/>
25+
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="seeSimpleProductWeight"/>
26+
<seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{product.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/>
27+
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="seeVisibility"/>
28+
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/>
29+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/>
30+
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="seeUrlKey"/>
31+
</actionGroup>
32+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertProductIsAssignedToCategoryActionGroup">
12+
<annotations>
13+
<description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryName" type="string"/>
17+
</arguments>
18+
19+
<seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="AdminAssignTwoCategoriesToProductActionGroup" extends="AdminAssignCategoryToProductAndSaveActionGroup">
12+
<annotations>
13+
<description>Extends AdminAssignCategoryToProductAndSaveActionGroup + assigns the second category and prevents product saving (the Product Edit page should be opened in Admin prior this check).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryTwoName" type="string"/>
17+
</arguments>
18+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown2" after="waitForApplyCategory"/>
19+
<checkOption selector="{{AdminProductFormSection.selectCategory(categoryTwoName)}}" stepKey="selectCategoryTwo"/>
20+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickDone2"/>
21+
<waitForPageLoad stepKey="waitForApplyCategoryTwo"/>
22+
<remove keyForRemoval="clickSave"/>
23+
<remove keyForRemoval="waitForSavingProduct"/>
24+
<remove keyForRemoval="seeSuccessMessage"/>
25+
</actionGroup>
26+
</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="AdminFillMainProductFormActionGroup" extends="FillMainProductFormActionGroup">
12+
<annotations>
13+
<description>Extends FillMainProductFormActionGroup with filling the next fields: Tax Class, Visibility, SEO->URL </description>
14+
</annotations>
15+
16+
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="selectProductTaxClass"/>
17+
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="selectVisibility"/>
18+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
19+
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="fillUrlKey"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontAssertProductStockStatusOnProductPageActionGroup">
11+
<annotations>
12+
<description>Validate that the provided Product Stock Status is present and correct (the Product Detail page should be opened on Storefront prior this check)</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productStockStatus" type="string"/>
16+
</arguments>
17+
18+
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@
7777
<element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/>
7878
<element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/>
7979
<element name="footerBlock" type="block" selector="//footer"/>
80+
<element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/>
8081
</section>
8182
</sections>

0 commit comments

Comments
 (0)