Skip to content

Commit 97eed8c

Browse files
author
Bohdan Shevchenko
committed
Merge remote-tracking branch 'origin/MC-3086' into 2.3-develop-mftf-pr21
2 parents c47f281 + 2ac711b commit 97eed8c

11 files changed

+248
-0
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>

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>

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/StorefrontProductMediaSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="closeFullscreenImage" type="button" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//*[@data-gallery-role='fotorama__fullscreen-icon']" />
1717
<element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/>
1818
<element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/>
19+
<element name="productImageInFotorama" type="file" selector=".fotorama__nav__shaft img[src*='{{imageName}}']" parameterized="true"/>
1920
</section>
2021
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@
194194
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
195195
</actionGroup>
196196

197+
<!--Generate and save configurable product after setting options-->
198+
<actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct">
199+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/>
200+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/>
201+
</actionGroup>
202+
197203
<actionGroup name="addNewProductConfigurationAttribute">
198204
<arguments>
199205
<argument name="attribute" type="entity"/>
@@ -358,4 +364,11 @@
358364
<click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/>
359365
<see selector="{{AdminProductFormConfigurationsSection.confProductOptionStatusCell(productName)}}" userInput="Disabled" stepKey="seeConfigDisabled"/>
360366
</actionGroup>
367+
368+
<!--You are on AdminProductEditPage-->
369+
<!--Start create configurations for attribute and fill quantity-->
370+
<actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode">
371+
<remove keyForRemoval="clickOnNextButton3"/>
372+
<remove keyForRemoval="clickOnNextButton4"/>
373+
</actionGroup>
361374
</actionGroups>
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+
12+
<!--You are on ProductAttributePage-->
13+
<!--Add new swatch options and fill fields for product attribute -->
14+
<actionGroup name="AdminAddSwatchOptionAndFillFieldsActionGroup">
15+
<arguments>
16+
<argument name="swatchOption" defaultValue="visualSwatchOption1"/>
17+
</arguments>
18+
<click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch"/>
19+
<waitForElementVisible selector="{{AdminNewAttributePanel.lastVisualSwatchOptionAdminValue}}" stepKey="waitForOption1Row"/>
20+
<fillField selector="{{AdminNewAttributePanel.lastVisualSwatchOptionAdminValue}}" userInput="{{swatchOption.admin_label}}" stepKey="fillAdminLabel"/>
21+
<fillField selector="{{AdminNewAttributePanel.lastVisualSwatchOptionDefaultStoreValue}}" userInput="{{swatchOption.default_label}}" stepKey="fillDefaultStoreLabel"/>
22+
</actionGroup>
23+
24+
<!--You are on ProductAttributePage-->
25+
<!--Select value for option "Update Product Preview Image"-->
26+
<actionGroup name="AdminUpdateProductPreviewImageActionGroup">
27+
<arguments>
28+
<argument name="value" type="string" defaultValue="Yes"/>
29+
</arguments>
30+
<selectOption selector="{{AttributePropertiesSection.UpdateProductPreviewImage}}" userInput="{{value}}" stepKey="setUpdateProductPreviewImage"/>
31+
</actionGroup>
32+
</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+
<!--Click a swatch option on product page-->
12+
<actionGroup name="StorefrontSelectSwatchOptionOnProductPage">
13+
<arguments>
14+
<argument name="optionName" type="string"/>
15+
</arguments>
16+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/>
17+
</actionGroup>
18+
19+
<!--Click a swatch option on product page and check active image-->
20+
<actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage">
21+
<arguments>
22+
<argument name="fileName" type="string" defaultValue="magento-logo"/>
23+
</arguments>
24+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/Swatches/Test/Mftf/Section/AdminNewAttributePanelSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<element name="addVisualSwatchOption" type="button" selector="button#add_new_swatch_visual_option_button"/>
1313
<element name="addTextSwatchOption" type="button" selector="button#add_new_swatch_text_option_button"/>
1414
<element name="visualSwatchOptionAdminValue" type="input" selector="[data-role='swatch-visual-options-container'] input[name='optionvisual[value][option_{{row}}][0]']" parameterized="true"/>
15+
<element name="lastVisualSwatchOptionAdminValue" type="input" selector="[data-role='swatch-visual-options-container'] tr:last-child [name*='][0]']"/>
1516
<element name="visualSwatchOptionDefaultStoreValue" type="input" selector="[data-role='swatch-visual-options-container'] input[name='optionvisual[value][option_{{row}}][1]']" parameterized="true"/>
17+
<element name="lastVisualSwatchOptionDefaultStoreValue" type="input" selector="[data-role='swatch-visual-options-container'] tr:last-child [name*='][1]']"/>
1618
</section>
1719
</sections>

0 commit comments

Comments
 (0)