Skip to content

Commit 2fada20

Browse files
committed
MC-3080: Admin can create product attribute with picked color swatch
- Add a conditionalClick after creating the configurable product
1 parent 5416edf commit 2fada20

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<group value="Swatches"/>
2020
</annotations>
2121
<before>
22+
<createData entity="ApiCategory" stepKey="createCategory"/>
2223
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2324
</before>
2425
<after>
@@ -102,15 +103,17 @@
102103

103104
<!-- Create a configurable product to verify the storefront with -->
104105
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
105-
<waitForPageLoad time="30" stepKey="waitForProductGrid"/>
106-
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct">
107-
<argument name="product" value="BaseConfigurableProduct"/>
108-
</actionGroup>
109-
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm">
110-
<argument name="product" value="BaseConfigurableProduct"/>
111-
</actionGroup>
106+
<waitForPageLoad stepKey="waitForProductGridPage"/>
107+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/>
108+
<click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/>
109+
<fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
110+
<fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
111+
<fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
112+
<fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
113+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>
112114
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
113115
<fillField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
116+
114117
<!-- Create configurations based off the Text Swatch we created earlier -->
115118
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/>
116119
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/>
@@ -120,11 +123,20 @@
120123
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/>
121124
<click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/>
122125
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/>
126+
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/>
127+
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="Color" stepKey="selectAttributes"/>
128+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="10" stepKey="fillAttributePrice1"/>
129+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="20" stepKey="fillAttributePrice2"/>
130+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="30" stepKey="fillAttributePrice3"/>
123131
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
124-
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/>
132+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/>
125133
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
126134
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
127135
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
136+
<!-- conditionalClick is necessary because this popup appears in Jenkins but not locally. I cannot figure out why. -->
137+
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="clickOnConfirmInPopup"/>
138+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
139+
<seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitle"/>
128140

129141
<!-- Go to the product page and see text swatch options -->
130142
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnProductPage"/>

0 commit comments

Comments
 (0)