Skip to content

Commit 7022260

Browse files
committed
ACQE-6841: Remove individual variations configurable product
Added files
1 parent b21e5d9 commit 7022260

File tree

5 files changed

+233
-0
lines changed

5 files changed

+233
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<actionGroup name="FilterProductGridByProductNameActionGroup">
12+
<annotations>
13+
<description>Filters the Admin Products grid by the provided Product (Name).</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="productName" type="string"/>
18+
</arguments>
19+
20+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
21+
<waitForElementClickable selector="{{AdminProductGridFilterSection.filters}}" stepKey="openForFilterField"/>
22+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
23+
<waitForElementVisible selector="{{AdminProductGridFilterSection.nameFilter}}" stepKey="waitForFilterFieldToBecomeActive"/>
24+
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{productName}}" stepKey="fillProductName"/>
25+
<waitForElementClickable selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="waitToClickApplyFilter"/>
26+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
27+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroup name="AdminAddOptionForAttributeActionGroup">
12+
<annotations>
13+
<description>Admin add default option for attribute.</description>
14+
</annotations>
15+
<!--Add option to attribute-->
16+
<waitForElementClickable selector="{{AdminNewAttributePanel.addOption}}" stepKey="waitForAddOption"/>
17+
<click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickOnAddOption"/>
18+
<waitForElementVisible selector="{{AdminNewAttributePanel.optionAdminValue('1')}}" stepKey="waitForAdminLabel"/>
19+
<fillField selector="{{AdminNewAttributePanel.optionAdminValue('1')}}" userInput="10" stepKey="fillAdminLabelForOption"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<actionGroup name="AdminCreateNewDefaultAttributeForAsWithOptionActionGroup">
12+
<annotations>
13+
<description>Admin add default option for attribute.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="defaultLabel" type="string"/>
17+
</arguments>
18+
<switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/>
19+
<waitForElementVisible selector="{{AdminNewAttributePanel.defaultLabel}}" stepKey="WaitForDefaultLabel"/>
20+
<fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{defaultLabel}}" stepKey="fillDefaultLabel"/>
21+
<!--Add option 1 to attribute-->
22+
<waitForElementClickable selector="{{AdminNewAttributePanel.addOption}}" stepKey="waitForAddOption"/>
23+
<click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickOnAddOption"/>
24+
<waitForElementClickable selector="{{AdminNewAttributePanel.isDefault('1')}}" time="30" stepKey="waitForOptionRow"/>
25+
<click selector="{{AdminNewAttributePanel.isDefault('1')}}" stepKey="clickOnDefault"/>
26+
<waitForElementVisible selector="{{AdminNewAttributePanel.optionAdminValue('0')}}" stepKey="waitForAdminLabelForOptionToBecomeVisible"/>
27+
<fillField selector="{{AdminNewAttributePanel.optionAdminValue('0')}}" userInput="8" stepKey="fillAdminLabelForOption1"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ProductConfigurableAttributeData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,9 @@
7575
<data key="quantity">6</data>
7676
<data key="weight">1</data>
7777
</entity>
78+
<entity name="sizeAttribute" type="attribute">
79+
<data key="default_label" unique="suffix">Size</data>
80+
<data key="input_type">Dropdown</data>
81+
<data key="attribute_code">size</data>
82+
</entity>
7883
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminRemoveIndividualVariationsConfigurableProductTest">
12+
<annotations>
13+
<features value="Configurable Product"/>
14+
<stories value="Create configurable product"/>
15+
<title value="Configure Price 'Apply unique prices by attribute to each SKU' and Inventory 'Apply single quantity to each SKUs' in 'Create Configurations' wizard"/>
16+
<description value="Admin create configurable product and select 'Apply unique prices by attribute to each SKU' and 'Apply single quantity to each SKUs' in 'Create Configurations' in configuration wizard during creation and assert child product's price after creation."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4420"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Log in to Dashboard page -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
24+
</before>
25+
26+
<after>
27+
<!--Delete configurable product-->
28+
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductsWithAllVariations">
29+
<argument name="product" value="ApiConfigurableProduct"/>
30+
</actionGroup>
31+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
32+
33+
<actionGroup ref="AdminDeleteCreatedColorSpecificAttributeActionGroup" stepKey="deleteBlackColorAttribute">
34+
<argument name="Color" value="Black"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminDeleteCreatedColorSpecificAttributeActionGroup" stepKey="deleteRedColorAttribute">
37+
<argument name="Color" value="{{colorProductAttribute2.name}}"/>
38+
</actionGroup>
39+
<!-- Delete Created Attribute -->
40+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute">
41+
<argument name="ProductAttribute" value="sizeAttribute"/>
42+
</actionGroup>
43+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterInProductAttributePage"/>
44+
<!--Logout from Admin-->
45+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminArea"/>
46+
</after>
47+
48+
<!-- Navigate to Catalog-> Products and click On Configurable product dropdown -->
49+
<actionGroup ref="GotoCatalogProductsPageActionGroup" stepKey="goToCatalogProductsPage"/>
50+
<actionGroup ref="GotoConfigurableProductPageActionGroup" stepKey="goToConfigurableProductPage"/>
51+
<!-- Assert Page title and Fill New product information-->
52+
<waitForText selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductPageTitle"/>
53+
<waitForElementVisible selector="{{NewProduct.productName}}" stepKey="waitForProductNameToBeDisplayed"/>
54+
<fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{ApiConfigurableProduct.name}}"/>
55+
<waitForElementVisible selector="{{NewProduct.productSku}}" stepKey="waitForProductSkuToBeDisplayed"/>
56+
<fillField stepKey="fillInProductSkuFields" selector="{{NewProduct.productSku}}" userInput="{{ApiConfigurableProduct.sku}}"/>
57+
<waitForElementVisible selector="{{NewProduct.price}}" stepKey="waitForPriceToBeDisplayed"/>
58+
<fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{ApiConfigurableProduct.price}}"/>
59+
<waitForElementVisible selector="{{NewProduct.weight}}" stepKey="waitForWeightToBeDisplayed"/>
60+
<fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{ApiConfigurableProduct.weight}}"/>
61+
<!--Click on create configuration button-->
62+
<scrollTo selector="{{NewProduct.title('Configurations')}}" stepKey="scrollToConfigurationsSection"/>
63+
<waitForText userInput="Configurations" selector="{{NewProduct.title('Configurations')}}" stepKey="seeConfigurationsSection"/>
64+
<waitForText userInput="Create Configurations" selector="{{NewProduct.title('Create Configurations')}}" stepKey="seeCreateConfigurationsButtonIsPresent"/>
65+
<waitForElementClickable selector="{{NewProduct.createConfigurationButton}}" stepKey="waitForCreateConfigurationButtonToBeClickable"/>
66+
<click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/>
67+
<waitForPageLoad stepKey="waitForCreateProductConfigurationPageToLoad"/>
68+
<!--Assert create product configuration title and Select Attribute step is active-->
69+
<waitForText userInput="Create Product Configurations" selector="{{NewProduct.titleContainsText('Create Product Configurations')}}" stepKey="seeCreateProductConfigurationsWizard"/>
70+
<waitForText userInput="Select Attributes" selector="{{NewProduct.selectAttribute}}" stepKey="seeSelectAttributeStepIsActive"/>
71+
<!-- Click on create Attribute buttons-->
72+
<click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/>
73+
<waitForPageLoad stepKey="waitForNewAttributePageLoad"/>
74+
<!--Fill option 1 -->
75+
<actionGroup ref="AdminCreateNewDefaultAttributeForAsWithOptionActionGroup" stepKey="fillOption1">
76+
<argument name="defaultLabel" value="{{sizeAttribute.default_label}}"/>
77+
</actionGroup>
78+
<!-- Fill option 2-->
79+
<actionGroup ref="AdminAddOptionForAttributeActionGroup" stepKey="fillOption2"/>
80+
<!--Click on save button-->
81+
<waitForElementClickable selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="waitForClickSaveAttributeButton"/>
82+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickSaveAttribute"/>
83+
<waitForPageLoad stepKey="waitForSavingAttribute"/>
84+
<!--Select color attribute and size attribute and click on Next-->
85+
<click selector="{{AdminGridRow.checkboxByValue('color')}}" stepKey="selectColorAttribute"/>
86+
<actionGroup ref="AdminSelectAttributeInConfigurableAttributesGrid" stepKey="checkFirstAttribute">
87+
<argument name="attributeCode" value="{{sizeAttribute.attribute_code}}"/>
88+
</actionGroup>
89+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitToClickOnNextButtonAfterSelectingAttribute"/>
90+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonAfterSelectingAttribute"/>
91+
<!--Fill Black and Red options for color-->
92+
<click selector="{{AdminCreateProductConfigurationsPanel.optionsWithTitle('Color')}}" stepKey="addNewColorBlack"/>
93+
<fillField userInput="{{colorDefaultProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="setNameBlack"/>
94+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="saveBlackColor"/>
95+
<click selector="{{AdminCreateProductConfigurationsPanel.optionsWithTitle('Color')}}" stepKey="addNewColorRed"/>
96+
<fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="setNameRed"/>
97+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="saveRedColor"/>
98+
<!--Select sizes for size attribute and click on Next-->
99+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(sizeAttribute.default_label)}}" stepKey="waitForSelectAllToBeClickableBySizeAttribute"/>
100+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(sizeAttribute.default_label)}}" stepKey="selectAllForSizeAttribute"/>
101+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitToClickOnNextButton"/>
102+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/>
103+
<waitForPageLoad stepKey="waitForStepLoad"/>
104+
<!-- Assigning quantities to each SKU's -->
105+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitToClickOnApplySingleQuantityToEachSku"/>
106+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
107+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.quantity}}" stepKey="waitForQuantityField"/>
108+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="10000" stepKey="enterAttributeQuantity"/>
109+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextButtonToBecomeClickable"/>
110+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToNavigateToSummaryTab"/>
111+
<!--Click On Next-->
112+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForGenerateProductButtonIsPresent"/>
113+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProductButtonIsPresent"/>
114+
<!--Choose affected attribute set and Save product and then see success message-->
115+
<waitForElementClickable selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveConfigurableProduct"/>
116+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProduct"/>
117+
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProduct"/>
118+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessage"/>
119+
<!--Grab configurable product name-->
120+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="seeNameOfVariationProduct1"/>
121+
<grabTextFrom selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="grabNameOfVariationProduct1"/>
122+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('2')}}" stepKey="seeNameOfVariationProduct2"/>
123+
<grabTextFrom selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('2')}}" stepKey="grabNameOfVariationProduct2"/>
124+
<!--Remove Configurable product black-8-->
125+
<scrollTo selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" x="0" y="-100" stepKey="scrollToFirstChildProduct"/>
126+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="waitForSelectionLinkToBeClickable"/>
127+
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActions"/>
128+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="waitToClickOnRemove"/>
129+
<click selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="clickRemove"/>
130+
<!--Remove Configurable product black-10-->
131+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="waitForSelectionLinkToBeClickableForProduct2"/>
132+
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActionsForProduct2"/>
133+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="waitToClickOnRemoveForProduct2"/>
134+
<click selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="clickRemoveForProduct2"/>
135+
<!--Save configurable product-->
136+
<waitForElementClickable selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveConfigurableProductAfterRemovingChildVariations"/>
137+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProductAfterRemovingChildVariations"/>
138+
<!--Go to product index and verify child product-->
139+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndexPage"/>
140+
<actionGroup ref="FilterProductGridByProductNameActionGroup" stepKey="filterChildProduct1">
141+
<argument name="productName" value="$grabNameOfVariationProduct1"/>
142+
</actionGroup>
143+
<waitForText selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$grabNameOfVariationProduct1" stepKey="seeProduct1NameInGrid"/>
144+
<actionGroup ref="FilterProductGridByProductNameActionGroup" stepKey="filterChildProduct2">
145+
<argument name="productName" value="$grabNameOfVariationProduct2"/>
146+
</actionGroup>
147+
<waitForText selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$grabNameOfVariationProduct2" stepKey="seeProduct2NameInGrid"/>
148+
</test>
149+
</tests>

0 commit comments

Comments
 (0)