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

Commit 4fd98c3

Browse files
committed
MAGETWO-87704: add creating simple product with unicode characters test.
1 parent a29b455 commit 4fd98c3

8 files changed

+148
-63
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertProductInStorefrontCategoryPage">
12+
<arguments>
13+
<argument name="category"/>
14+
<argument name="product"/>
15+
</arguments>
16+
<!-- Go to storefront category page, assert product visibility -->
17+
<amOnPage url="{{StorefrontCategoryPage.url(category.name)}}" stepKey="navigateToCategoryPage"/>
18+
<waitForPageLoad stepKey="waitForPageLoad1"/>
19+
<see userInput="{{product.name}}" stepKey="assertProductPresent"/>
20+
<see userInput="{{product.price}}" stepKey="assertProductPricePresent"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertProductInStorefrontProductPage">
12+
<arguments>
13+
<argument name="product"/>
14+
</arguments>
15+
<!-- Go to storefront product page, assert product visibility -->
16+
<amOnPage url="{{product.urlKey}}.html" stepKey="navigateToProductPage"/>
17+
<waitForPageLoad stepKey="waitForPageLoad2"/>
18+
<seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/>
19+
<see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
20+
<see userInput="{{product.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
21+
<see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="FillAdminSimpleProductForm">
12+
<arguments>
13+
<argument name="category"/>
14+
<argument name="simpleProduct"/>
15+
</arguments>
16+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
17+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
18+
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
19+
<fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
20+
<fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
21+
<fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
22+
<fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
23+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/>
24+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
25+
<fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
26+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
27+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
28+
<seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/>
29+
<seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/>
30+
<seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/>
31+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/>
32+
<seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/>
33+
</actionGroup>
34+
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/NewProductActionGroup.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,17 @@
6666
<data key="shareable">Yes</data>
6767
<data key="file">logo.png</data>
6868
</entity>
69+
<entity name="ProductWithUnicode" type="product">
70+
<data key="sku" unique="suffix">&#38657;&#20135;&#21697;</data>
71+
<data key="type_id">simple</data>
72+
<data key="attribute_set_id">4</data>
73+
<data key="visibility">4</data>
74+
<data key="name" unique="suffix">&#38657;&#20135;&#21697;</data>
75+
<data key="price">123.00</data>
76+
<data key="urlKey" unique="suffix">testurlkey</data>
77+
<data key="status">1</data>
78+
<data key="quantity">100</data>
79+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
80+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
81+
</entity>
6982
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminAddImageToWYSIWYGProductCest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@
9999
<click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.OkBtn}}" stepKey="clickOkBtn2" />
100100
<waitForPageLoad stepKey="waitForPageLoad6"/>
101101
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
102-
<waitForLoadingMaskToDisappear stepKey="waitForLoading13" />
102+
<waitForLoadingMaskToDisappear stepKey="waitForLoading16" />
103103
<amOnPage url="{{_defaultProduct.name}}.html" stepKey="navigateToProductPage"/>
104-
<waitForPageLoad stepKey="waitForPageLoad2"/>
104+
<waitForPageLoad stepKey="waitForPageLoad17"/>
105105
<seeElement selector="{{StorefrontProductInfoMainSection.mediaDescription}}" stepKey="assertMediaDescription"/>
106106
<seeElement selector="{{StorefrontProductInfoMainSection.mediaShortDescription}}" stepKey="assertMediaShortDescription"/>
107107
<after>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminCreateSimpleProductTest.xml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,16 @@
2727
</after>
2828

2929
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
30-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
31-
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
32-
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
33-
<fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
34-
<fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
35-
<fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
36-
<fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
37-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createPreReqCategory.name$$]" stepKey="searchAndSelectCategory"/>
38-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
39-
<fillField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
40-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
41-
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
42-
<seeInField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/>
43-
<seeInField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/>
44-
<seeInField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/>
45-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/>
46-
<seeInField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/>
47-
48-
<!-- Go to storefront category page, assert product visibility -->
49-
<amOnPage url="{{StorefrontCategoryPage.url($$createPreReqCategory.name$$)}}" stepKey="navigateToCategoryPage"/>
50-
<waitForPageLoad stepKey="waitForPageLoad1"/>
51-
<see userInput="{{_defaultProduct.name}}" stepKey="assertProductPresent"/>
52-
<see userInput="{{_defaultProduct.price}}" stepKey="assertProductPricePresent"/>
53-
54-
<!-- Go to storefront product page, assert product visibility -->
55-
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="navigateToProductPage"/>
56-
<waitForPageLoad stepKey="waitForPageLoad2"/>
57-
<seeInTitle userInput="{{_defaultProduct.name}}" stepKey="assertProductNameTitle"/>
58-
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
59-
<see userInput="{{_defaultProduct.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
60-
<see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
30+
<actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin">
31+
<argument name="category" value="$$createPreReqCategory$$"/>
32+
<argument name="simpleProduct" value="_defaultProduct"/>
33+
</actionGroup>
34+
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1">
35+
<argument name="category" value="$$createPreReqCategory$$"/>
36+
<argument name="product" value="_defaultProduct"/>
37+
</actionGroup>
38+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2">
39+
<argument name="product" value="_defaultProduct"/>
40+
</actionGroup>
6141
</test>
6242
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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="AdminCreateSimpleProductWithUnicodeTest">
12+
<annotations>
13+
<features value="Product Creation"/>
14+
<stories value="Create a Unicode Named Simple Product via Admin"/>
15+
<title value="You should be able to create a unicode named simple product in admin."/>
16+
<description value="You should be able to create a unicode named simple product in admin."/>
17+
<severity value="NORMAL"/>
18+
<testCaseId value="MAGETWO-87504"/>
19+
<!--useCaseId value="USECASE-114"/-->
20+
<group value="product"/>
21+
</annotations>
22+
<before>
23+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
24+
</before>
25+
<after>
26+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
27+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
28+
</after>
29+
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
31+
<actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin">
32+
<argument name="category" value="$$createPreReqCategory$$"/>
33+
<argument name="simpleProduct" value="ProductWithUnicode"/>
34+
</actionGroup>
35+
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1">
36+
<argument name="category" value="$$createPreReqCategory$$"/>
37+
<argument name="product" value="ProductWithUnicode"/>
38+
</actionGroup>
39+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2">
40+
<argument name="product" value="ProductWithUnicode"/>
41+
</actionGroup>
42+
</test>
43+
</tests>

0 commit comments

Comments
 (0)