Skip to content

Commit d77d07f

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-98708-v2' into EPAM-PR-61
2 parents 104ec78 + 30055c5 commit d77d07f

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@
275275
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
276276
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
277277
<waitForPageLoad stepKey="waitForPageToLoad"/>
278-
<checkOption selector="{{AdminProductModalSlideGridSection.productRowCheckboxBySku(sku)}}" stepKey="selectProduct"/>
278+
<click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
279279
<click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
280+
<waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/>
280281
</actionGroup>
281282

282283
<!--Click AddCrossSellProducts and adds product by SKU-->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<element name="relatedDependent" type="block" selector="//div[@data-index='related']//div[contains(@class, '_show')]"/>
2121
<element name="selectedRelatedProduct" type="block" selector="//span[@data-index='name']"/>
2222
<element name="removeRelatedProduct" type="button" selector="//span[text()='Related Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
23+
<element name="selectedProductSku" type="text" selector="//div[@data-index='{{section}}']//span[@data-index='sku']" parameterized="true" timeout="30"/>
2324
</section>
2425
<section name="AdminAddUpSellProductsModalSection">
2526
<element name="Modal" type="button" selector=".product_form_product_form_related_upsell_modal"/>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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="AdminCloneProductWithDuplicateUrlTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Cloning a product with duplicate URL key"/>
15+
<description value="Check product cloning with duplicate URL key"/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="MAGETWO-98992"/>
18+
<useCaseId value="MAGETWO-98708"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<!--Create category and product-->
24+
<comment userInput="Create category and product" stepKey="commentCreateCategoryAndProduct"/>
25+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
26+
</before>
27+
<after>
28+
<!--Delete created data-->
29+
<comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/>
30+
<actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts">
31+
<argument name="product" value="$$createSimpleProduct$$"/>
32+
</actionGroup>
33+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/>
34+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
35+
</after>
36+
<amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage"/>
37+
<waitForPageLoad stepKey="waitForSimpleProductPageLoad"/>
38+
<!--Save and duplicated the product once-->
39+
<comment userInput="Save and duplicated the product once" stepKey="commentSaveAndDuplicateProduct"/>
40+
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductFormFirstTime"/>
41+
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSEOSection"/>
42+
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabDuplicatedProductUrlKey"/>
43+
<assertContains expected="$$createSimpleProduct.custom_attributes[url_key]$$" actual="$grabDuplicatedProductUrlKey" stepKey="assertDuplicatedProductUrlKey"/>
44+
<assertContains expectedType="string" expected="-1" actual="$grabDuplicatedProductUrlKey" stepKey="assertDuplicatedProductUrlKey1"/>
45+
<!--Add duplicated product to the simple product-->
46+
<comment userInput="Add duplicated product to the simple product" stepKey="commentAddProduct"/>
47+
<amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToSimpleProductPage"/>
48+
<waitForPageLoad stepKey="waitForSimpleProductPageLoad1"/>
49+
<actionGroup ref="addCrossSellProductBySku" stepKey="addCrossSellProduct">
50+
<argument name="sku" value="$$createSimpleProduct.sku$$"/>
51+
</actionGroup>
52+
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct">
53+
<argument name="sku" value="$$createSimpleProduct.sku$$"/>
54+
</actionGroup>
55+
<actionGroup ref="addUpSellProductBySku" stepKey="addUpSellProduct">
56+
<argument name="sku" value="$$createSimpleProduct.sku$$"/>
57+
</actionGroup>
58+
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/>
59+
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" visible="false" stepKey="openProductRUSSection"/>
60+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeRelatedProduct"/>
61+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('upsell')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeUpSellProduct"/>
62+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('crosssell')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeCrossSellProduct"/>
63+
<!--Save and duplicated the product second time-->
64+
<comment userInput="Save and duplicated the product second time" stepKey="commentSaveAndDuplicateProduct1"/>
65+
<amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage1"/>
66+
<waitForPageLoad stepKey="waitForSimpleProductPageLoad2"/>
67+
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductFormSecondTime"/>
68+
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openProductSEOSection"/>
69+
<waitForElementVisible selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="waitForUrlKeyField"/>
70+
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabSecondDuplicatedProductUrlKey"/>
71+
<assertContains expected="$$createSimpleProduct.custom_attributes[url_key]$$" actual="$grabSecondDuplicatedProductUrlKey" stepKey="assertSecondDuplicatedProductUrlKey"/>
72+
<assertContains expectedType="string" expected="-2" actual="$grabSecondDuplicatedProductUrlKey" stepKey="assertSecondDuplicatedProductUrlKey1"/>
73+
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" visible="false" stepKey="openProductRUSSection1"/>
74+
<waitForElementVisible selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" stepKey="waitForSelectedProductSku"/>
75+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeRelatedProductForDuplicated"/>
76+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('upsell')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeUpSellProductForDuplicated"/>
77+
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('crosssell')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeCrossSellProductForDuplicated"/>
78+
</test>
79+
</tests>

0 commit comments

Comments
 (0)