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