Skip to content

Commit d3e2abe

Browse files
tomreeceimeron2433
authored andcommitted
MAGETWO-89940: Admin create configurable product test
1 parent c7fd2f3 commit d3e2abe

File tree

1 file changed

+27
-36
lines changed
  • dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Test

1 file changed

+27
-36
lines changed
Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,31 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11-
<test name="AdminCreateConfigurableProductTest">
11+
12+
13+
<test name="AdminCreateTest">
1214
<annotations>
13-
<features value="Product Creation"/>
14-
<stories value="Create a Configurable Product via the Admin"/>
15-
<title value="Create a Configurable Product via the Admin."/>
16-
<description value="You should be able to create a Configurable Product via the Admin."/>
15+
<features value="ConfigurableProduct"/>
16+
<stories value="Create, Read, Update, Delete"/>
17+
<title value="admin should be able to create a configurable product with attributes"/>
18+
<description value="admin should be able to create a configurable product with attributes"/>
1719
<severity value="CRITICAL"/>
18-
<testCaseId value="MAGETWO-26041"/>
20+
<testCaseId value="MAGETWO-89941"/>
1921
<group value="configurable"/>
2022
<group value="product"/>
21-
<!-- Skipped, see https://jira.corp.magento.com/browse/MQE-889 -->
22-
<group value="skip"/>
2323
</annotations>
24+
2425
<before>
26+
<createData entity="ApiCategory" stepKey="createCategory"/>
2527
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
2628
</before>
29+
2730
<after>
31+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
2832
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
2933
</after>
3034

31-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnCategoryGridPage"/>
32-
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
33-
34-
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
35-
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="enterCategoryName"/>
36-
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSeoSection"/>
37-
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{_defaultCategory.name_lwr}}" stepKey="enterUrlKey"/>
38-
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickOnSaveCategory"/>
39-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/>
40-
35+
<!-- fill in basic configurable product values -->
4136
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
4237
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
4338
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/>
@@ -46,55 +41,50 @@
4641
<fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
4742
<fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
4843
<fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
49-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{_defaultCategory.name}}]" stepKey="searchAndSelectCategory"/>
44+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="searchAndSelectCategory"/>
5045
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
5146
<fillField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
5247

48+
<!-- create color configurations -->
5349
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
5450
<click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/>
51+
<waitForPageLoad stepKey="waitForIFrame"/>
5552
<switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/>
5653
<fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/>
5754
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/>
58-
5955
<switchToIFrame stepKey="switchOutOfIFrame"/>
56+
<waitForPageLoad stepKey="waitForFilters"/>
6057
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/>
6158
<fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/>
6259
<click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/>
6360
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/>
6461
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/>
65-
6662
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/>
6763
<fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/>
6864
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/>
69-
7065
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/>
7166
<fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/>
7267
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/>
73-
7468
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/>
7569
<fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/>
7670
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/>
77-
7871
<click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/>
7972
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/>
80-
8173
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/>
8274
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/>
8375
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/>
8476
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/>
8577
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/>
86-
8778
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
8879
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/>
8980
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
9081
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
91-
9282
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
9383
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
94-
9584
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
9685
<seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitle"/>
9786

87+
<!-- assert color configurations on the admin create product page -->
9888
<seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="3" stepKey="seeNumberOfRows"/>
9989
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeName1InField"/>
10090
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeName2InField"/>
@@ -107,25 +97,26 @@
10797
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{colorProductAttribute3.price}}" stepKey="seeUniquePrice3InField"/>
10898
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsQuantityCells}}" userInput="{{colorProductAttribute.attribute_quantity}}" stepKey="seeQuantityInField"/>
10999

100+
<!-- assert storefront category list page -->
110101
<amOnPage url="/" stepKey="amOnStorefront"/>
111-
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
112-
113-
<click userInput="{{_defaultCategory.name}}" stepKey="clickOnCategoryName"/>
114-
<waitForPageLoad time="30" stepKey="waitForPageLoad4"/>
115-
102+
<waitForPageLoad stepKey="waitForPageLoad3"/>
103+
<click userInput="$$createCategory.name$$" stepKey="clickOnCategoryName"/>
104+
<waitForPageLoad stepKey="waitForPageLoad4"/>
116105
<see userInput="{{_defaultProduct.name}}" stepKey="assertProductPresent"/>
117106
<see userInput="{{colorProductAttribute1.price}}" stepKey="assertProductPricePresent"/>
118-
<click userInput="{{_defaultProduct.name}}" stepKey="clickOnProductName"/>
119-
<waitForPageLoad time="30" stepKey="waitForPageLoad5"/>
120107

108+
<!-- assert storefront product details page -->
109+
<click userInput="{{_defaultProduct.name}}" stepKey="clickOnProductName"/>
110+
<waitForPageLoad stepKey="waitForPageLoad5"/>
121111
<seeInTitle userInput="{{_defaultProduct.name}}" stepKey="assertProductNameTitle"/>
122112
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
123113
<see userInput="{{colorProductAttribute1.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
124114
<see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
125-
126115
<see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="{{colorProductAttribute.default_label}}" stepKey="seeColorAttributeName1"/>
127116
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/>
128117
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/>
129118
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/>
130119
</test>
120+
121+
131122
</tests>

0 commit comments

Comments
 (0)