Skip to content

Commit fc94ab8

Browse files
Lusine-PapyanAliaksei Yakimovich2
authored andcommitted
MAGETWO-70232: Import customizable options adds it to another product if same SKU is filled
- Update automated test script
1 parent b78c229 commit fc94ab8

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType('0')}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/>
5353
<fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensions('0')}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/>
5454
</actionGroup>
55-
5655
<actionGroup name="AddProductCustomOptionField">
5756
<arguments>
5857
<argument name="option" defaultValue="ProductOptionField"/>
@@ -69,7 +68,6 @@
6968
<selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType(optionIndex)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/>
7069
<fillField selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" userInput="{{option.title}}" stepKey="fillSku"/>
7170
</actionGroup>
72-
7371
<actionGroup name="importProductCustomizableOptions">
7472
<arguments>
7573
<argument name="productName" type="string"/>
@@ -84,13 +82,11 @@
8482
<checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/>
8583
<click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/>
8684
</actionGroup>
87-
8885
<actionGroup name="resetImportOptionFilter">
8986
<conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/>
9087
<click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/>
9188
<click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/>
9289
</actionGroup>
93-
9490
<actionGroup name="checkCustomizableOptionImport">
9591
<arguments>
9692
<argument name="option" defaultValue="ProductOptionField"/>
@@ -99,7 +95,6 @@
9995
<grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/>
10096
<grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/>
10197
<grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/>
102-
10398
<assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/>
10499
<assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/>
105100
<assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
<element name="applyFiltersButton" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/>
5555
<element name="resetFiltersButton" type="button" selector="//button[@data-action='grid-filter-reset']" timeout="30"/>
5656
<element name="firstRowItemCheckbox" type="input" selector="//input[@data-action='select-row']" timeout="30"/>
57-
<element name="importButton" type="button" selector="//button[@class='action-primary']/span[contains(text(), 'Import')]" timeout="30"/>
57+
<element name="importButton" type="button" selector="//button[contains(@class, 'action-primary')]/span[contains(text(), 'Import')]" timeout="30"/>
5858
</section>
5959
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,39 @@
1111
<test name="AdminImportCustomizableOptionToProductWithSKUTest">
1212
<annotations>
1313
<features value="Catalog"/>
14-
<title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
15-
<description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
14+
<title value="Import customizable options to a product with existing SKU"/>
15+
<description value="Import customizable options to a product with existing SKU"/>
1616
<severity value="MAJOR"/>
1717
<testCaseId value="MAGETWO-98211"/>
1818
<useCaseId value="MAGETWO-70232"/>
1919
<group value="catalog"/>
2020
</annotations>
2121
<before>
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23-
2423
<!--Create category-->
24+
<comment userInput="Create category" stepKey="commentCreateCategory"/>
2525
<createData entity="ApiCategory" stepKey="createCategory"/>
26-
2726
<!-- Create two product -->
27+
<comment userInput="Create two product" stepKey="commentCreateTwoProduct"/>
2828
<createData entity="SimpleProduct2" stepKey="createFirstProduct"/>
2929
<createData entity="ApiSimpleProduct" stepKey="createSecondProduct">
3030
<requiredEntity createDataKey="createCategory"/>
3131
</createData>
32-
3332
</before>
3433
<after>
35-
36-
<!--Delete second product with changed sku-->
34+
<!--Delete second product with changed sku-->
35+
<comment userInput="Delete second product with changed sku" stepKey="commentDeleteProduct"/>
3736
<actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct">
3837
<argument name="sku" value="$$createFirstProduct.sku$$-1"/>
3938
</actionGroup>
40-
4139
<!--Delete created data-->
40+
<comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/>
4241
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
4342
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
44-
4543
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
4644
</after>
47-
4845
<!--Go to product page -->
46+
<comment userInput="Go to product page" stepKey="commentGoToProductPage"/>
4947
<amOnPage url="{{AdminProductEditPage.url($$createFirstProduct.id$$)}}" stepKey="goToProductEditPage"/>
5048
<waitForPageLoad stepKey="waitForProductEditPageLoad"/>
5149
<actionGroup ref="AddProductCustomOptionField" stepKey="addCutomOption1">
@@ -57,13 +55,13 @@
5755
<argument name="optionIndex" value="1"/>
5856
</actionGroup>
5957
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
60-
6158
<!--Change second product sku to first product sku-->
59+
<comment userInput="Change second product sku to first product sku" stepKey="commentChangeSecondProduct"/>
6260
<amOnPage url="{{AdminProductEditPage.url($$createSecondProduct.id$$)}}" stepKey="goToProductEditPage1"/>
6361
<waitForPageLoad stepKey="waitForProductEditPageLoad1"/>
6462
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="$$createFirstProduct.sku$$" stepKey="fillProductSku1"/>
65-
6663
<!--Import customizable options and check-->
64+
<comment userInput="Import customizable options and check" stepKey="commentImportOptions"/>
6765
<conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/>
6866
<actionGroup ref="importProductCustomizableOptions" stepKey="importOptions">
6967
<argument name="productName" value="$$createFirstProduct.name$$"/>
@@ -76,8 +74,8 @@
7674
<argument name="option" value="ProductOptionField2"/>
7775
<argument name="optionIndex" value="1"/>
7876
</actionGroup>
79-
80-
<!--SAve product and check sku changed message-->
77+
<!--Save product and check sku changed message-->
78+
<comment userInput="Save product and check sku changed message" stepKey="commentSAveProductAndCheck"/>
8179
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/>
8280
<see userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/>
8381
</test>

app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<test name="AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest">
1212
<annotations>
1313
<features value="Catalog"/>
14-
<title value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
15-
<description value="Check that 'trie price' block not available for simple product from options without 'trie price'"/>
14+
<title value="Check that 'tier price' block not available for simple product from options without 'tier price'"/>
15+
<description value="Check that 'tier price' block not available for simple product from options without 'tier price'"/>
1616
<severity value="MAJOR"/>
1717
<testCaseId value="MAGETWO-97050"/>
1818
<useCaseId value="MAGETWO-96842"/>

0 commit comments

Comments
 (0)