Skip to content

Commit cf0bfb3

Browse files
authored
Merge pull request #4568 from magento-tsg/2.3-develop-mftf-pr21
[TSG] MFTF for 2.3 (pr21) (2.3-develop)
2 parents 70466fa + 1050297 commit cf0bfb3

22 files changed

+365
-3
lines changed
Lines changed: 20 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!--Click save button and see message-->
12+
<actionGroup name="ClickSaveButtonActionGroup">
13+
<arguments>
14+
<argument name="message" type="string"/>
15+
</arguments>
16+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
17+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitMessage" />
18+
<see userInput="{{message}}" selector="{{AdminMessagesSection.success}}" stepKey="verifyMessage" />
19+
</actionGroup>
20+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertProductsGridIsEmptyActionGroup">
12+
<see selector="{{AdminCategoryProductsGridSection.productsGridEmpty}}" userInput="We couldn't find any records" stepKey="assertGridEmpty"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 24 additions & 0 deletions
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="AdminCheckProductIsMissingInCategoryProductsGrid">
12+
<arguments>
13+
<argument name="productName" type="string"/>
14+
</arguments>
15+
<dontSee selector="{{AdminCategoryProductsGridSection.nameColumn}}" userInput="{{productName}}" stepKey="dontSeeProduct"/>
16+
</actionGroup>
17+
<actionGroup name="AdminCheckProductPositionInCategoryProductsGrid">
18+
<arguments>
19+
<argument name="position" type="string"/>
20+
<argument name="productName" type="string"/>
21+
</arguments>
22+
<see selector="{{AdminCategoryProductsGridSection.rowProductName(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/>
23+
</actionGroup>
24+
</actionGroups>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,16 @@
1515
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
1616
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{attributeType}}" stepKey="selectInputType"/>
1717
</actionGroup>
18+
19+
<!--You are on AdminProductEditPage-->
20+
<!-- Switch scope for product attribute-->
21+
<!-- !Note! Scope : 0 - Store View; 1 - Global; 2 - Website; -->
22+
<actionGroup name="AdminSwitchScopeForProductAttributeActionGroup">
23+
<arguments>
24+
<argument name="scope" type="string" defaultValue="1"/>
25+
</arguments>
26+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/>
27+
<waitForElementVisible selector="{{AttributePropertiesSection.Scope}}" stepKey="waitOpenAdvancedProperties"/>
28+
<selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectNecessaryScope"/>
29+
</actionGroup>
1830
</actionGroups>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,4 +576,13 @@
576576
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/>
577577
<seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/>
578578
</actionGroup>
579+
580+
<!-- You are on StorefrontProductPage -->
581+
<!-- Check active product image -->
582+
<actionGroup name="StorefrontAssertActiveProductImage">
583+
<arguments>
584+
<argument name="fileName" defaultValue="magento-logo" type="string"/>
585+
</arguments>
586+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/>
587+
</actionGroup>
579588
</actionGroups>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,12 @@
1919
<click selector="{{StorefrontProductMediaSection.closeFullscreenImage}}" stepKey="closeFullScreenImage" />
2020
<waitForPageLoad stepKey="waitForGalleryDisappear" />
2121
</actionGroup>
22+
23+
<!--Check availability image in fotorama-->
24+
<actionGroup name="StorefrontAssertFotoramaImageAvailablity">
25+
<arguments>
26+
<argument name="fileName" type="string" defaultValue="magento-logo"/>
27+
</arguments>
28+
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeActiveImageDefault"/>
29+
</actionGroup>
2230
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<!-- Assert product is missing in category products page -->
12+
<actionGroup name="StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup">
13+
<arguments>
14+
<argument name="productName" type="string"/>
15+
</arguments>
16+
<dontSee selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="dontSeeCorrectProductsOnStorefront"/>
17+
</actionGroup>
18+
<actionGroup name="StorefrontCheckProductPositionActionGroup">
19+
<arguments>
20+
<argument name="position" type="string"/>
21+
<argument name="productName" type="string"/>
22+
</arguments>
23+
<see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<!-- Navigates storefront category page -->
10+
<actionGroup name="StorefrontNavigateCategoryPageActionGroup">
11+
<arguments>
12+
<argument name="category"/>
13+
</arguments>
14+
<!-- Open category page on storefront -->
15+
<amOnPage url="{{StorefrontCategoryPage.url(category.custom_attributes[url_key])}}" stepKey="navigateStorefrontCategoryPage"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,8 @@
343343
<data key="used_for_sort_by">true</data>
344344
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
345345
</entity>
346+
<entity name="VisualSwatchProductAttribute" type="ProductAttribute">
347+
<data key="frontend_input">swatch_visual</data>
348+
<data key="attribute_code" unique="suffix">visual_swatch</data>
349+
</entity>
346350
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<element name="productGridNameProduct" type="text" selector="//table[@id='catalog_category_products_table']//td[contains(., '{{productName}}')]" parameterized="true"/>
1818
<element name="productVisibility" type="select" selector="//*[@name='product[visibility]']"/>
1919
<element name="productSelectAll" type="checkbox" selector="input.admin__control-checkbox"/>
20+
<element name="productsGridEmpty" type="text" selector="#catalog_category_products_table .data-grid-tr-no-data .empty-text"/>
2021
</section>
2122
</sections>

0 commit comments

Comments
 (0)