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