Skip to content

Commit 825ca66

Browse files
committed
Merge branch 'ACQE-6841' into ACQE-6897-functional-mainline-deployment
2 parents 6f4805f + 8d7970a commit 825ca66

File tree

7 files changed

+236
-0
lines changed

7 files changed

+236
-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>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminCreateProductConfigurationsPanelSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@
6262
<element name="attributeRowByAttributeCode" type="block" selector="//td[count(../../..//th[./*[.='Attribute Code']]/preceding-sibling::th) + 1][./*[.='{{attribute_code}}']]/../td//input[@data-action='select-row']" parameterized="true"/>
6363
<element name="qtyForColorAttribute" type="text" selector="//span[text()='{{var1}}']/../..//input[@type='text']" parameterized="true"/>
6464
<element name="configProductName" type="text" selector="//table[@class='data-grid data-grid-configurable']//tbody//tr[{{row}}]//td[2]//span" parameterized="true"/>
65+
<element name="optionsWithTitle" type="text" selector="//*[@class='attribute-entity-title' and text()='{{attributeTitle}}']//ancestor::div[@class='attribute-entity-top']//following-sibling::button[@class='action-create-new action-tertiary']/span" parameterized="true"/>
6566
</section>
6667
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/ConfigurableProductAttributeNameDesignSection/NewProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
<element name="saveAttributeButton" type="button" selector="//*[@id='save']"/>
3030
<element name="advancedAttributeProperties" type="button" selector="//*[@id='advanced_fieldset-wrapper']//*[contains(text(),'Advanced Attribute Properties')]"/>
3131
<element name="attributeCodeField" type="input" selector="//*[@id='attribute_code']"/>
32+
<element name="productSku" type="input" selector="//input[@name='product[sku]']"/>
3233
</section>
3334
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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+
<waitForElementVisible selector="{{NewProduct.productName}}" stepKey="waitForProductNameToBeDisplayed"/>
53+
<fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{ApiConfigurableProduct.name}}"/>
54+
<waitForElementVisible selector="{{NewProduct.productSku}}" stepKey="waitForProductSkuToBeDisplayed"/>
55+
<fillField stepKey="fillInProductSkuFields" selector="{{NewProduct.productSku}}" userInput="{{ApiConfigurableProduct.sku}}"/>
56+
<waitForElementVisible selector="{{NewProduct.price}}" stepKey="waitForPriceToBeDisplayed"/>
57+
<fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{ApiConfigurableProduct.price}}"/>
58+
<waitForElementVisible selector="{{NewProduct.weight}}" stepKey="waitForWeightToBeDisplayed"/>
59+
<fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{ApiConfigurableProduct.weight}}"/>
60+
<!--Click on create configuration button-->
61+
<waitForElementClickable selector="{{NewProduct.createConfigurationButton}}" stepKey="waitForCreateConfigurationButtonToBeClickable"/>
62+
<click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/>
63+
<waitForPageLoad stepKey="waitForCreateProductConfigurationPageToLoad"/>
64+
<!-- Click on create Attribute buttons-->
65+
<waitForElementClickable selector="{{NewProduct.createNewAttributeButton}}" stepKey="waitForClickOnCreateNewAttributeButton"/>
66+
<click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/>
67+
<waitForPageLoad stepKey="waitForNewAttributePageLoad"/>
68+
<!--Fill option 1 -->
69+
<actionGroup ref="AdminCreateNewDefaultAttributeForAsWithOptionActionGroup" stepKey="fillOption1">
70+
<argument name="defaultLabel" value="{{sizeAttribute.default_label}}"/>
71+
</actionGroup>
72+
<!-- Fill option 2-->
73+
<actionGroup ref="AdminAddOptionForAttributeActionGroup" stepKey="fillOption2"/>
74+
<!--Click on save button-->
75+
<waitForElementClickable selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="waitForClickSaveAttributeButton"/>
76+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickSaveAttribute"/>
77+
<waitForPageLoad stepKey="waitForSavingAttribute"/>
78+
<!--Select color attribute and size attribute and click on Next-->
79+
<waitForElementClickable selector="{{AdminGridRow.checkboxByValue('color')}}" stepKey="waitToSelectColorAttribute"/>
80+
<click selector="{{AdminGridRow.checkboxByValue('color')}}" stepKey="selectColorAttribute"/>
81+
<actionGroup ref="AdminSelectAttributeInConfigurableAttributesGrid" stepKey="checkFirstAttribute">
82+
<argument name="attributeCode" value="{{sizeAttribute.attribute_code}}"/>
83+
</actionGroup>
84+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitToClickOnNextButtonAfterSelectingAttribute"/>
85+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonAfterSelectingAttribute"/>
86+
<!--Fill Black and Red options for color-->
87+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.optionsWithTitle('Color')}}" stepKey="waitToAddNewColorBlack"/>
88+
<click selector="{{AdminCreateProductConfigurationsPanel.optionsWithTitle('Color')}}" stepKey="addNewColorBlack"/>
89+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="waitToSetNameBlack"/>
90+
<fillField userInput="{{colorDefaultProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="setNameBlack"/>
91+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="waitToSaveBlackColor"/>
92+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="saveBlackColor"/>
93+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.optionsWithTitle('Color')}}" stepKey="waitToAddNewColorRed"/>
94+
<click selector="{{AdminCreateProductConfigurationsPanel.optionsWithTitle('Color')}}" stepKey="addNewColorRed"/>
95+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="waitToSetNameRed"/>
96+
<fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="setNameRed"/>
97+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="waitToSaveRedColor"/>
98+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="saveRedColor"/>
99+
<!--Select sizes for size attribute and click on Next-->
100+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(sizeAttribute.default_label)}}" stepKey="waitForSelectAllToBeClickableBySizeAttribute"/>
101+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(sizeAttribute.default_label)}}" stepKey="selectAllForSizeAttribute"/>
102+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitToClickOnNextButton"/>
103+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/>
104+
<waitForPageLoad stepKey="waitForStepLoad"/>
105+
<!-- Assigning quantities to each SKU's -->
106+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitToClickOnApplySingleQuantityToEachSku"/>
107+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
108+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.quantity}}" stepKey="waitForQuantityField"/>
109+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="10000" stepKey="enterAttributeQuantity"/>
110+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextButtonToBecomeClickable"/>
111+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToNavigateToSummaryTab"/>
112+
<!--Click On Next-->
113+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForGenerateProductButtonIsPresent"/>
114+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProductButtonIsPresent"/>
115+
<!--Choose affected attribute set and Save product and then see success message-->
116+
<waitForElementClickable selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveConfigurableProduct"/>
117+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProduct"/>
118+
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProduct"/>
119+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessage"/>
120+
<!--Grab configurable product name-->
121+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="seeNameOfVariationProduct1"/>
122+
<grabTextFrom selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="grabNameOfVariationProduct1"/>
123+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('2')}}" stepKey="seeNameOfVariationProduct2"/>
124+
<grabTextFrom selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('2')}}" stepKey="grabNameOfVariationProduct2"/>
125+
<!--Remove Configurable product black-8-->
126+
<scrollTo selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" x="0" y="-100" stepKey="scrollToFirstChildProduct"/>
127+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="waitForSelectionLinkToBeClickable"/>
128+
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActions"/>
129+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="waitToClickOnRemove"/>
130+
<click selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="clickRemove"/>
131+
<!--Remove Configurable product black-10-->
132+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="waitForSelectionLinkToBeClickableForProduct2"/>
133+
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActionsForProduct2"/>
134+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="waitToClickOnRemoveForProduct2"/>
135+
<click selector="{{AdminProductFormConfigurationsSection.removeProductBtn}}" stepKey="clickRemoveForProduct2"/>
136+
<!--Save configurable product-->
137+
<waitForElementClickable selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveConfigurableProductAfterRemovingChildVariations"/>
138+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProductAfterRemovingChildVariations"/>
139+
<!--Go to product index and verify child product-->
140+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndexPage"/>
141+
<actionGroup ref="FilterProductGridByProductNameActionGroup" stepKey="filterChildProduct1">
142+
<argument name="productName" value="$grabNameOfVariationProduct1"/>
143+
</actionGroup>
144+
<waitForText selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$grabNameOfVariationProduct1" stepKey="seeProduct1NameInGrid"/>
145+
<actionGroup ref="FilterProductGridByProductNameActionGroup" stepKey="filterChildProduct2">
146+
<argument name="productName" value="$grabNameOfVariationProduct2"/>
147+
</actionGroup>
148+
<waitForText selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$grabNameOfVariationProduct2" stepKey="seeProduct2NameInGrid"/>
149+
</test>
150+
</tests>

0 commit comments

Comments
 (0)