Skip to content

Commit 0e812a7

Browse files
committed
Merge branch 'ACQE-6784' into ACQE-6879-functional-mainline-deployment
2 parents 5b980dc + c5c689a commit 0e812a7

File tree

6 files changed

+198
-0
lines changed

6 files changed

+198
-0
lines changed
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="waitFprDefaultLabelInputField"/>
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,7 @@
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="cancel" type="button" selector=".action-cancel"/>
66+
<element name="back" type="button" selector=".action-back-step"/>
6567
</section>
6668
</sections>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@
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="selectAttribute" type="button" selector=".steps-wizard-navigation .active"/>
33+
<element name="title" type="button" selector="//*[text()='{{title}}']" parameterized="true"/>
34+
<element name="titleContainsText" type="button" selector=".//*[contains(text(),'{{titleContainsText}}')]" parameterized="true"/>
35+
<element name="productSku" type="input" selector="//input[@name='product[sku]']"/>
3236
</section>
3337
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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="AdminCreateConfigurableProductsWithUniquePricesAndSingleQuantityOnEachSKUTest">
12+
<annotations>
13+
<stories value="Create configurable product"/>
14+
<title value="Configure Price 'Apply unique prices by attribute to each SKU' and Inventory 'Apply single quantity to each SKUs' in 'Create Configurations' wizard"/>
15+
<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."/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4671"/>
18+
</annotations>
19+
20+
<before>
21+
<!-- Log in to Dashboard page -->
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
23+
</before>
24+
25+
<after>
26+
<!--Delete configurable product-->
27+
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductsWithAllVariations">
28+
<argument name="product" value="ApiConfigurableProduct"/>
29+
</actionGroup>
30+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
31+
<!-- Delete Created Attribute -->
32+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute">
33+
<argument name="ProductAttribute" value="sizeAttribute"/>
34+
</actionGroup>
35+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterInProductAttributePage"/>
36+
<!--Logout from Admin-->
37+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminArea"/>
38+
</after>
39+
40+
<!-- Navigate to Catalog-> Products and click On Configurable product dropdown -->
41+
<actionGroup ref="GotoCatalogProductsPageActionGroup" stepKey="goToCatalogProductsPage"/>
42+
<actionGroup ref="GotoConfigurableProductPageActionGroup" stepKey="goToConfigurableProductPage"/>
43+
<!-- Assert Page title and Fill New product information-->
44+
<waitForText selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductPageTitle"/>
45+
<waitForElementVisible selector="{{NewProduct.productName}}" stepKey="waitForProductNameToBeDisplayed"/>
46+
<fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{ApiConfigurableProduct.name}}"/>
47+
<waitForElementVisible selector="{{NewProduct.productSku}}" stepKey="waitForProductSkuToBeDisplayed"/>
48+
<fillField stepKey="fillInProductSkuFields" selector="{{NewProduct.productSku}}" userInput="{{ApiConfigurableProduct.sku}}"/>
49+
<waitForElementVisible selector="{{NewProduct.price}}" stepKey="waitForPriceToBeDisplayed"/>
50+
<fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{ApiConfigurableProduct.price}}"/>
51+
<waitForElementVisible selector="{{NewProduct.weight}}" stepKey="waitForWeightToBeDisplayed"/>
52+
<fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{ApiConfigurableProduct.weight}}"/>
53+
<!--Click on create configuration button-->
54+
<scrollTo selector="{{NewProduct.title('Configurations')}}" stepKey="scrollToConfigurationsSection"/>
55+
<waitForText userInput="Configurations" selector="{{NewProduct.title('Configurations')}}" stepKey="seeConfigurationsSection"/>
56+
<waitForText userInput="Create Configurations" selector="{{NewProduct.title('Create Configurations')}}" stepKey="seeCreateConfigurationsButtonIsPresent"/>
57+
<waitForElementClickable selector="{{NewProduct.createConfigurationButton}}" stepKey="waitForCreateConfigurationButtonToBeClickable"/>
58+
<click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/>
59+
<waitForPageLoad stepKey="waitForCreateProductConfigurationPageToLoad"/>
60+
<!--Assert create product configuration title and Select Attribute step is active-->
61+
<waitForText userInput="Create Product Configurations" selector="{{NewProduct.titleContainsText('Create Product Configurations')}}" stepKey="seeCreateProductConfigurationsWizard"/>
62+
<waitForText userInput="Select Attributes" selector="{{NewProduct.selectAttribute}}" stepKey="seeSelectAttributeStepIsActive"/>
63+
<!-- Click on create Attribute buttons-->
64+
<click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/>
65+
<waitForPageLoad stepKey="waitForNewAttributePageLoad"/>
66+
<!--Fill option 1 -->
67+
<actionGroup ref="AdminCreateNewDefaultAttributeForAsWithOptionActionGroup" stepKey="fillOption1">
68+
<argument name="defaultLabel" value="{{sizeAttribute.default_label}}"/>
69+
</actionGroup>
70+
<!-- Fill option 2-->
71+
<actionGroup ref="AdminAddOptionForAttributeActionGroup" stepKey="fillOption2"/>
72+
<!--Click on save button-->
73+
<waitForElementClickable selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="waitForClickSaveAttributeButton"/>
74+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickSaveAttribute"/>
75+
<waitForPageLoad stepKey="waitForSavingAttribute"/>
76+
<!--Filter created attribute and click on Next-->
77+
<actionGroup ref="AdminSelectAttributeInConfigurableAttributesGrid" stepKey="checkFirstAttribute">
78+
<argument name="attributeCode" value="{{sizeAttribute.attribute_code}}"/>
79+
</actionGroup>
80+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitToClickOnNextButton"/>
81+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/>
82+
<waitForPageLoad stepKey="waitForStepLoad"/>
83+
<!--Select All options-->
84+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="waitToClickOnSelectAll"/>
85+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/>
86+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitToClickSecondNextStep"/>
87+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickSecondNextStep"/>
88+
<!--Set image and price-->
89+
<waitForText userInput="Step 3: Bulk Images, Price and Quantity" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeBulkImagesPriceAndQuantityStepIsDisplayed"/>
90+
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/>
91+
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="Size" stepKey="selectAttribute"/>
92+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" stepKey="seePriceFieldForOption1"/>
93+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="6" stepKey="fillRedAttributePrice"/>
94+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" stepKey="seePriceFieldForOption2"/>
95+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="8" stepKey="fillBlueAttributePrice"/>
96+
<!-- Assigning quantities to each SKU's -->
97+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitToClickOnApplySingleQuantityToEachSku"/>
98+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
99+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.quantity}}" stepKey="waitForQuantityField"/>
100+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="15" stepKey="enterAttributeQuantity"/>
101+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextButtonToBecomeClickable"/>
102+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToNavigateToSummaryTab"/>
103+
<!--Assert Cancel, Back and Generate Products and buttons are present-->
104+
<waitForText userInput="Cancel" selector="{{AdminCreateProductConfigurationsPanel.cancel}}" stepKey="assertCancelButtonIsPresent"/>
105+
<waitForText userInput="Back" selector="{{AdminCreateProductConfigurationsPanel.back}}" stepKey="assertBackButtonIsPresent"/>
106+
<waitForText userInput="Generate Products" selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="assertGenerateProductButtonIsPresent"/>
107+
<!--See created child products are present in summary page-->
108+
<waitForText userInput="Step 4: Summary" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeSummeryStepIsDisplayed"/>
109+
<waitForElement selector="{{AdminCreateProductConfigurationsPanel.configProductName('1')}}" stepKey="seeConfigurableProduct1"/>
110+
<waitForElement selector="{{AdminCreateProductConfigurationsPanel.configProductName('2')}}" stepKey="seeConfigurableProduct2"/>
111+
<!--Grab child products's names and click on next-->
112+
<grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.configProductName('1')}}" stepKey="grabTextForConfigProduct1"/>
113+
<grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.configProductName('2')}}" stepKey="grabTextForConfigProduct2"/>
114+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForGenerateProductButtonIsPresent"/>
115+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProductButtonIsPresent"/>
116+
<!--Choose affected attribute set and Save product and then see success message-->
117+
<waitForElementClickable selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveConfigurableProduct"/>
118+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProduct"/>
119+
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProduct"/>
120+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessage"/>
121+
<!--Open 1st child variant and assert the price from configuration grid-->
122+
<scrollTo selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" x="0" y="-100" stepKey="scrollToFirstChildProduct"/>
123+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="waitForLinkOfProduct1ToDisplay"/>
124+
<click selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('1')}}" stepKey="clickOnProduct1Link"/>
125+
<switchToNextTab stepKey="switchToConfigChildProduct1Page"/>
126+
<waitForPageLoad stepKey="waitForProduct1PageToLoad"/>
127+
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="6.00" stepKey="seeProductPrice1"/>
128+
<closeTab stepKey="closeConfigChildProduct1Page"/>
129+
<!--Open 2nd child variant and assert the price from configuration grid-->
130+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('2')}}" stepKey="waitForLinkOfProduct2ToDisplay"/>
131+
<click selector="{{AdminProductFormConfigurationsSection.currentVariationsProductName('2')}}" stepKey="clickOnProduct2Link"/>
132+
<switchToNextTab stepKey="switchToConfigChildProduct2Page"/>
133+
<waitForPageLoad stepKey="waitForProduct2PageLoad"/>
134+
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="8.00" stepKey="seeProductPrice2"/>
135+
<closeTab stepKey="closeConfigChildProduct2Page"/>
136+
</test>
137+
</tests>

0 commit comments

Comments
 (0)