Skip to content

Commit bb21bec

Browse files
committed
ACQE-6901: Create Text Swatch from Stores ->Attributes section: Product
Added an element and updated test file
1 parent 53939b6 commit bb21bec

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/AttributeManageSwatchSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="textSwatchDefaultStoreSwatchValue" type="input" selector="[data-role='swatch-text-options-container'] input[name='swatchtext[value][option_{{row}}][1]']" parameterized="true"/>
2020
<element name="textSwatchDefaultStoreDescriptionValue" type="input" selector="[data-role='swatch-text-options-container'] input[name='optiontext[value][option_{{row}}][1]']" parameterized="true"/>
2121
<element name="textSwatchStoreViewValue" type="input" selector="//*[@data-role='swatch-text-options-container']//td[starts-with(@class,'col-swatch col-swatch')]//input[@value='{{storeViewValue}}']" parameterized="true"/>
22+
<element name="isDefaultTextSwatch" type="radio" selector="[data-role='swatch-text-options-container'] tr:nth-of-type({{row}}) input[name='defaulttext[]']" parameterized="true"/>
2223
</section>
2324
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StoreFrontAdminCreateTextSwatchAttributeAndAssertInStoreFrontTest.xml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="StoreFrontAdminCreateTextSwatchAttributeAndAssertInStoreFrontTest">
1111
<annotations>
12-
<features value="Product"/>
12+
<features value="ConfigurableProduct"/>
1313
<stories value="Create Text Swatch from Stores ->Attributes section: Product"/>
1414
<title value="Create Text Swatch from Stores ->Attributes section: Product"/>
1515
<description value="Admin create product attribute with text swatch and assert them in storefront"/>
1616
<severity value="MAJOR"/>
17+
<testCaseId value="AC-3921"/>
1718
</annotations>
1819
<before>
1920
<!--Login to admin-->
@@ -39,25 +40,44 @@
3940
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>
4041
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
4142

43+
<waitForElementClickable selector="{{AttributeManageSwatchSection.isDefaultTextSwatch('1')}}" stepKey="waitForDefaultOptionToBecomeClickable"/>
44+
<click selector="{{AttributeManageSwatchSection.isDefaultTextSwatch('1')}}" stepKey="setFirstSizeAsDefault"/>
45+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('0')}}" stepKey="waitForTextBoxForSSizeBecomeVisible"/>
4246
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('0')}}" userInput="S" stepKey="fillSwatchForAdmin"/>
47+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('0')}}" stepKey="waitForTextBoxForDescriptionForSSizeBecomeVisibleForAdmin"/>
4348
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('0')}}" userInput="Small" stepKey="fillDescriptionForAdmin"/>
49+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreSwatchValue('0')}}" stepKey="waitForTextBoxForSSizeBecomeVisibleForStoreView"/>
4450
<fillField selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreSwatchValue('0')}}" userInput="S1" stepKey="fillSwatchForStoreView"/>
51+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreDescriptionValue('0')}}" stepKey="waitForTextBoxForDescriptionForSSizeBecomeVisibleForStoreView"/>
4552
<fillField selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreDescriptionValue('0')}}" userInput="Small_1" stepKey="fillDescriptionForStoreView"/>
4653
<!--Add swatch for Medium-->
54+
<waitForElementClickable selector="{{AttributePropertiesSection.addSwatch}}" stepKey="waitForAddSwatchButtonToBeClickable"/>
4755
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatchForMedium"/>
56+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('1')}}" stepKey="waitForTextBoxForMSizeBecomeVisible"/>
4857
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('1')}}" userInput="M" stepKey="fillMediumSwatchForAdmin"/>
58+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('1')}}" stepKey="waitForTextBoxForDescriptionForMSizeBecomeVisibleForAdmin"/>
4959
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('1')}}" userInput="Medium" stepKey="fillDescriptionForMediumForAdmin"/>
60+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreSwatchValue('1')}}" stepKey="waitForTextBoxForMSizeBecomeVisibleForStoreView"/>
5061
<fillField selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreSwatchValue('1')}}" userInput="M2" stepKey="fillMediumSwatchForStoreView"/>
62+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreDescriptionValue('1')}}" stepKey="waitForTextBoxForDescriptionForMSizeBecomeVisibleForStoreView"/>
5163
<fillField selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreDescriptionValue('1')}}" userInput="Medium_2" stepKey="fillDescriptionForMediumForStoreView"/>
5264
<!--Add swatch for Large-->
65+
<waitForElementClickable selector="{{AttributePropertiesSection.addSwatch}}" stepKey="waitForAddSwatchButtonForLargeToBeClickable"/>
5366
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatchForLarge"/>
67+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('2')}}" stepKey="waitForTextBoxForLargeSizeBecomeVisible"/>
5468
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('2')}}" userInput="L" stepKey="fillLargeSwatchForAdmin"/>
69+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('2')}}" stepKey="waitForTextBoxForDescriptionForLargeSizeBecomeVisibleForAdmin"/>
5570
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('2')}}" userInput="Large" stepKey="fillDescriptionForLargeForAdmin"/>
71+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreSwatchValue('2')}}" stepKey="waitForTextBoxForLargeSizeBecomeVisibleForStoreView"/>
5672
<fillField selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreSwatchValue('2')}}" userInput="L3" stepKey="fillLargeSwatchForStoreView"/>
73+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreDescriptionValue('2')}}" stepKey="waitForTextBoxForDescriptionForLargeSizeBecomeVisibleForStoreView"/>
5774
<fillField selector="{{AttributeManageSwatchSection.textSwatchDefaultStoreDescriptionValue('2')}}" userInput="Large_3" stepKey="fillDescriptionForLargeForStoreView"/>
5875
<!--Add swatch for Extra Large-->
76+
<waitForElementClickable selector="{{AttributePropertiesSection.addSwatch}}" stepKey="waitForAddSwatchButtonForExtarLargeToBeClickable"/>
5977
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatchForExtraLarge"/>
78+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('3')}}" stepKey="waitForTextBoxForExtraLargeSizeBecomeVisible"/>
6079
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminSwatchValue('3')}}" userInput="XL" stepKey="fillExtraLargeSwatchForAdmin"/>
80+
<waitForElementVisible selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('3')}}" stepKey="waitForTextBoxForDescriptionForExtraLargeSizeBecomeVisibleForAdmin"/>
6181
<fillField selector="{{AttributeManageSwatchSection.textSwatchAdminDescriptionValue('3')}}" userInput="Extra Large" stepKey="fillDescriptionForExtraLargeForAdmin"/>
6282
<!--Select Scope-->
6383
<waitForElementClickable selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="waitForAdvancedPropertiesFieldIsVisible"/>
@@ -68,8 +88,11 @@
6888
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickSaveAttribute"/>
6989
<waitForPageLoad stepKey="waitForSavingAttribute"/>
7090
<!-- Open created attribute-->
71-
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{sizeAttribute.attribute_code}}" stepKey="setAttributeCode"/>
91+
<waitForElementClickable selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" stepKey="waitToFillAttributeCodeInTextBox"/>
92+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{sizeAttribute.attribute_code}}" stepKey="fillAttributeCode"/>
93+
<waitForElementClickable selector="{{AdminProductAttributeGridSection.Search}}" stepKey="waitForSearchForAttributeFromTheGridButtonToBeClicked"/>
7294
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
95+
<waitForElementClickable selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="waitToClickOnAttributeRow"/>
7396
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
7497
<waitForPageLoad stepKey="waitForPageLoad2"/>
7598
<!--Assert textual swatch value configured for each store view-->
@@ -81,6 +104,7 @@
81104
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
82105
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
83106
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('size')}}" selector2="{{AdminProductAttributeSetSection.attribute('Product Details')}}" stepKey="assignTestAttributes"/>
107+
<waitForElementClickable selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="waitToClickOnAttributeSetSaveButton"/>
84108
<click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickAttributeSetSave"/>
85109
<!-- Navigate to Catalog-> Products and click On Configurable product dropdown -->
86110
<actionGroup ref="GotoCatalogProductsPageActionGroup" stepKey="goToCatalogProductsPage"/>

0 commit comments

Comments
 (0)