Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 7ec62d4

Browse files
committed
MAGETWO-87705: add creating simple product with duplicate urlkey test.
1 parent 4fd98c3 commit 7ec62d4

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@
5959
<data key="status">1</data>
6060
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
6161
</entity>
62+
<entity name="SimpleTwo" type="product2">
63+
<data key="sku" unique="suffix">SimpleTwo</data>
64+
<data key="type_id">simple</data>
65+
<data key="attribute_set_id">4</data>
66+
<data key="name" unique="suffix">SimpleProduct</data>
67+
<data key="price">1.23</data>
68+
<data key="visibility">4</data>
69+
<data key="status">1</data>
70+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
71+
<requiredEntity type="custom_attribute">CustomAttributeProductUrlKey</requiredEntity>
72+
</entity>
6273
<entity name="ImageUpload" type="uploadImage">
6374
<data key="title" unique="suffix">Image1</data>
6475
<data key="price">1.00</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductMessagesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductMessagesSection">
1212
<element name="successMessage" type="text" selector=".message-success"/>
13+
<element name="errorMessage" type="text" selector=".message.message-error.error"/>
1314
</section>
1415
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminCreateSimpleProductDuplicateUrlkeyTest">
12+
<annotations>
13+
<features value="Product Creation Negative"/>
14+
<stories value="Error when try to save project with duplicate URL key"/>
15+
<title value="Error when try to save project with duplicate URL key."/>
16+
<description value="Error when try to save project with duplicate URL key."/>
17+
<severity value="NORMAL"/>
18+
<testCaseId value="MAGETWO-87586"/>
19+
<!--useCaseId value="USECASE-114"/-->
20+
<group value="product"/>
21+
</annotations>
22+
<before>
23+
<createData entity="SimpleTwo" stepKey="simpleProduct">
24+
</createData>
25+
</before>
26+
<after>
27+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
28+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
29+
</after>
30+
31+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
32+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
33+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
34+
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
35+
<fillField userInput="$$simpleProduct.name$$new" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
36+
<fillField userInput="$$simpleProduct.sku$$new" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
37+
<fillField userInput="$$simpleProduct.price$$" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
38+
<fillField userInput="$$simpleProduct.quantity$$" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
39+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
40+
<fillField userInput="$$simpleProduct.custom_attributes[url_key]$$" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
41+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
42+
<see userInput="The value specified in the URL Key field would generate a URL that already exists" selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="assertErrorMessage"/>
43+
</test>
44+
</tests>

0 commit comments

Comments
 (0)