Skip to content

Commit fe62b6e

Browse files
committed
ACQE-8489: Verify values required setting for text and visual swatch.
- Removed fill field by sku and name actions, and updated product attribute save action group in test file.
1 parent 754d45c commit fe62b6e

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

app/code/Magento/Swatches/Test/Mftf/Test/AdminSwatchValuesRequiredBehaviorTest.xml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
<!-- Cleanup products -->
6666
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openCatalog"/>
6767
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSuccessProductBySku">
68-
<argument name="sku" value="SwatchSuccSKU"/>
68+
<argument name="sku" value="{{SimpleProduct.sku}}"/>
6969
</actionGroup>
7070
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteOptionalProductBySku">
71-
<argument name="sku" value="SwatchOptSKU"/>
71+
<argument name="sku" value="{{SimpleProduct3.sku}}"/>
7272
</actionGroup>
7373
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
7474
</after>
@@ -77,15 +77,13 @@
7777
<argument name="productAttributeCode" value="{{textSwatchAttribute.attribute_code}}"/>
7878
</actionGroup>
7979
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="Yes" stepKey="setTextSwatchRequiredYes"/>
80-
<waitForElementClickable selector="{{AttributePropertiesSection.Save}}" stepKey="waitToSaveTextSwatchAttributeYes"/>
81-
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveTextSwatchAttributeYes"/>
80+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveTextSwatchAttributeYes"/>
8281
<waitForPageLoad stepKey="waitAfterSaveTextSwatchYes"/>
8382
<actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openVisualSwatchForEdit">
8483
<argument name="productAttributeCode" value="{{ProductAttributeFrontendLabel.label}}"/>
8584
</actionGroup>
8685
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="Yes" stepKey="setVisualSwatchRequiredYes"/>
87-
<waitForElementClickable selector="{{AttributePropertiesSection.Save}}" stepKey="waitToSaveVisualSwatchAttributeYes"/>
88-
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveVisualSwatchAttributeYes"/>
86+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveVisualSwatchAttributeYes"/>
8987
<waitForPageLoad stepKey="waitAfterSaveVisualSwatchYes"/>
9088
<!-- Step 3: Make sure a user is obliged to enter values during creation of the Product based on the attributes. -->
9189
<!-- Save with neither swatch selected → expect required error -->
@@ -96,8 +94,6 @@
9694
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainFormRequired">
9795
<argument name="product" value="SimpleProduct"/>
9896
</actionGroup>
99-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="SwatchReqProd" stepKey="updateName"/>
100-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="SwatchReqSKU" stepKey="updateSku"/>
10197
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="saveWithoutAnySwatch"/>
10298
<waitForElementVisible selector="{{AdminProductFormSection.attributeFieldError}}" stepKey="seeRequiredErrorBothMissing"/>
10399
<!-- Select only visual swatch → expect required error (text missing) -->
@@ -132,8 +128,6 @@
132128
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainFormBeforeSuccess">
133129
<argument name="product" value="SimpleProduct"/>
134130
</actionGroup>
135-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="SwatchSuccProd" stepKey="updateNameValue"/>
136-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="SwatchSuccSKU" stepKey="updateSkuValue"/>
137131
<selectOption selector="{{AdminProductFormSection.attributeRequiredInputField(textSwatchAttribute.attribute_code)}}"
138132
userInput="textSwatchOption1" stepKey="selectTextSwatchForSuccess"/>
139133
<selectOption selector="{{AdminProductFormSection.attributeRequiredInputField(ProductAttributeFrontendLabel.label)}}"
@@ -145,26 +139,22 @@
145139
<argument name="productAttributeCode" value="{{textSwatchAttribute.attribute_code}}"/>
146140
</actionGroup>
147141
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="No" stepKey="setTextSwatchRequiredToNo"/>
148-
<waitForElementClickable selector="{{AttributePropertiesSection.Save}}" stepKey="waitToSaveTextSwatchAttributeToNo"/>
149-
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveTextSwatchAttributeToNo"/>
142+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveTextSwatchAttributeToNo"/>
150143
<waitForPageLoad stepKey="waitAfterSaveTextSwatchToNo"/>
151144
<actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openVisualSwatchToUnrequire">
152145
<argument name="productAttributeCode" value="{{ProductAttributeFrontendLabel.label}}"/>
153146
</actionGroup>
154147
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="No" stepKey="setVisualSwatchRequiredToNo"/>
155-
<waitForElementClickable selector="{{AttributePropertiesSection.Save}}" stepKey="waitToSaveVisualSwatchAttributeToNo"/>
156-
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveVisualSwatchAttributeToNo"/>
148+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveVisualSwatchAttributeToNo"/>
157149
<waitForPageLoad stepKey="waitAfterSaveVisualSwatchToNo"/>
158150
<!-- Step 5: Leave both swatches empty and save: expect success -->
159151
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goProductIndexOptional"/>
160152
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goCreateProductOptional">
161153
<argument name="product" value="SimpleProduct"/>
162154
</actionGroup>
163155
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainFormOptional">
164-
<argument name="product" value="SimpleProduct"/>
156+
<argument name="product" value="SimpleProduct3"/>
165157
</actionGroup>
166-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="SwatchOptProd" stepKey="updateTheName"/>
167-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="SwatchOptSKU" stepKey="updateTheSku"/>
168158
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="saveNoSwatchesOptional"/>
169159
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSavedProductBothOptional"/>
170160
</test>

0 commit comments

Comments
 (0)