Skip to content

Commit 91a4d18

Browse files
author
Joan He
authored
Merge pull request #2141 from magento-borg/MAGETWO-72524
[borg] B2C User End-to-end automation
2 parents a1ed0bd + 4b98ce5 commit 91a4d18

File tree

127 files changed

+3980
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3980
-268
lines changed

dev/tests/acceptance/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ MAGENTO_ADMIN_PASSWORD=
5858
#TESTS_MODULE_PATH=
5959

6060
#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set
61-
#MODULE_WHITELIST=
61+
MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
6262
#CUSTOM_MODULE_PATHS=
6363

6464
#*** Bool property which allows the user to toggle debug output during test execution

dev/tests/acceptance/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "magento/magento2ce-functional-tests",
23
"description": "Magento 2 (Open Source) Functional Tests",
34
"type": "project",
45
"version": "1.0.0-dev",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<!-- Check the category page -->
12+
<actionGroup name="StorefrontCheckCategoryActionGroup">
13+
<arguments>
14+
<argument name="category"/>
15+
<argument name="productCount"/>
16+
</arguments>
17+
<seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/>
18+
<seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/>
19+
<see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/>
20+
<see userInput="{{productCount}}" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/>
21+
</actionGroup>
22+
23+
<!-- Check simple product on the category page -->
24+
<actionGroup name="StorefrontCheckCategorySimpleProduct">
25+
<arguments>
26+
<argument name="product"/>
27+
</arguments>
28+
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/>
29+
<see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/>
30+
<!-- @TODO: MAGETWO-80272 Move to Magento_Checkout -->
31+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
32+
<!-- @TODO: MAGETWO-80272 Move to Magento_Checkout -->
33+
<seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart" />
34+
</actionGroup>
35+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
<!-- Add Product to Compare from the category page and check message -->
12+
<actionGroup name="StorefrontAddCategoryProductToCompareActionGroup">
13+
<arguments>
14+
<argument name="productVar"/>
15+
</arguments>
16+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="moveMouseOverProduct" />
17+
<click selector="{{StorefrontCategoryProductSection.ProductAddToCompareByName(productVar.name)}}" stepKey="clickAddProductToCompare"/>
18+
<waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddCategoryProductToCompareSuccessMessage"/>
19+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddCategoryProductToCompareSuccessMessage"/>
20+
</actionGroup>
21+
22+
<!-- Add Product to Compare from the product page and check message -->
23+
<actionGroup name="StorefrontAddProductToCompareActionGroup">
24+
<arguments>
25+
<argument name="productVar"/>
26+
</arguments>
27+
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare" />
28+
<waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/>
29+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/>
30+
</actionGroup>
31+
32+
<!-- Check the product in compare sidebar -->
33+
<actionGroup name="StorefrontCheckCompareSidebarProductActionGroup">
34+
<arguments>
35+
<argument name="productVar"/>
36+
</arguments>
37+
<waitForElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName(productVar.name)}}" stepKey="waitForProduct"/>
38+
</actionGroup>
39+
40+
<!-- Open and check comparison page -->
41+
<actionGroup name="StorefrontOpenAndCheckComparisionActionGroup">
42+
<click selector="{{StorefrontComparisonSidebarSection.Compare}}" stepKey="clickCompare"/>
43+
<waitForLoadingMaskToDisappear stepKey="waitForComparePageloaded" />
44+
<seeInCurrentUrl url="{{StorefrontProductComparePage.url}}" stepKey="checkUrl"/>
45+
<seeInTitle userInput="Products Comparison List" stepKey="assertPageNameInTitle"/>
46+
<see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.PageName}}" stepKey="assertPageName"/>
47+
</actionGroup>
48+
49+
<!-- Check the simple product in comparison page -->
50+
<actionGroup name="StorefrontCheckCompareSimpleProductActionGroup">
51+
<arguments>
52+
<argument name="productVar"/>
53+
</arguments>
54+
<seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" stepKey="assertProductName"/>
55+
<see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.ProductPriceByName(productVar.name)}}" stepKey="assertProductPrice"/>
56+
<see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice"/>
57+
<!-- @TODO: MAGETWO-80272 Move to Magento_Checkout -->
58+
<seeElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/>
59+
</actionGroup>
60+
61+
<!-- Clear the compare list -->
62+
<actionGroup name="StorefrontClearCompareActionGroup">
63+
<waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/>
64+
<click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/>
65+
<waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/>
66+
<scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/>
67+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/>
68+
<waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/>
69+
<waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/>
70+
</actionGroup>
71+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<!-- Check the simple product on the product page -->
12+
<actionGroup name="StorefrontCheckSimpleProduct">
13+
<arguments>
14+
<argument name="product"/>
15+
</arguments>
16+
<seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/>
17+
<seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/>
18+
<see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
19+
<see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
20+
<see userInput="${{product.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/>
21+
<see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/>
22+
<seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart" />
23+
<see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/>
24+
<see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/>
25+
</actionGroup>
26+
</actionGroups>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<data key="name_lwr" unique="suffix">simplecategory</data>
1414
<data key="is_active">true</data>
1515
</entity>
16+
<entity name="ApiCategory" type="category">
17+
<data key="name" unique="suffix">Api Category</data>
18+
<data key="is_active">true</data>
19+
</entity>
1620
<entity name="SimpleSubCategory" type="category">
1721
<data key="name" unique="suffix">SimpleSubCategory</data>
1822
<data key="name_lwr" unique="suffix">simplesubcategory</data>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
/**
54
* Copyright © Magento, Inc. All rights reserved.
@@ -9,10 +8,9 @@
98

109
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1110
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
12-
<entity name="_defaultCoupon" type="coupon">
13-
<data key="rule_id">4</data>
14-
<data key="code">FREESHIPPING123</data>
15-
<data key="times_used">0</data>
16-
<data key="is_primary">false</data>
11+
<!-- @TODO: Get rid off this workaround and its usages after MQE-498 is implemented -->
12+
<entity name="CONST" type="CONST">
13+
<data key="one">1</data>
14+
<data key="two">2</data>
1715
</entity>
1816
</entities>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@
2323
<entity name="CustomAttributeProductAttribute" type="custom_attribute">
2424
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
2525
<var key="value" entityKey="value" entityType="ProductAttributeOption"/>
26-
<data key="value">test product attribute</data>
27-
<data key="attribute_code">test_product_attribute</data>
26+
</entity>
27+
<entity name="ApiProductDescription" type="custom_attribute">
28+
<data key="attribute_code">description</data>
29+
<data key="value" unique="suffix">API Product Description</data>
30+
</entity>
31+
<entity name="ApiProductShortDescription" type="custom_attribute">
32+
<data key="attribute_code">short_description</data>
33+
<data key="value" unique="suffix">API Product Short Description</data>
2834
</entity>
2935
</entities>

0 commit comments

Comments
 (0)