Skip to content

Commit 4d4f307

Browse files
jilu1tomreece
authored andcommitted
MQE-377: Add a wishlist test to demo data persistence through frontend http request.
1 parent e7c5bb5 commit 4d4f307

File tree

9 files changed

+111
-15
lines changed

9 files changed

+111
-15
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Cest/StorefrontExistingCustomerLoginCest.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
<stories value="Existing Customer can Login on the Storefront"/>
1515
</annotations>
1616
<before>
17-
<createData entity="Simple_US_Customer" mergeKey="Simple_US_Customer"/>
17+
<createData mergeKey="customer" entity="Simple_US_Customer"/>
1818
</before>
1919
<after>
20-
<deleteData createDataKey="Simple_US_Customer" mergeKey="Simple_US_Customer"/>
20+
<deleteData mergeKey="deleteCustomer" createDataKey="customer" />
2121
</after>
2222
<test name="ExistingCustomerLoginStorefrontTest">
2323
<annotations>
@@ -31,13 +31,13 @@
3131
<env value="phantomjs"/>
3232
<env value="headless"/>
3333
</annotations>
34-
<amOnPage mergeKey="amOnSignInPage" url="customer/account/login/"/>
35-
<fillField mergeKey="fillEmail" userInput="$$Simple_US_Customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
36-
<fillField mergeKey="fillPassword" userInput="{{Simple_US_Customer.password}}" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
34+
<amOnPage mergeKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage}}"/>
35+
<fillField mergeKey="fillEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
36+
<fillField mergeKey="fillPassword" userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
3737
<click mergeKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
38-
<see mergeKey="seeFirstName" userInput="{{Simple_US_Customer.firstname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
39-
<see mergeKey="seeLastName" userInput="{{Simple_US_Customer.lastname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
40-
<see mergeKey="seeEmail" userInput="$$Simple_US_Customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
38+
<see mergeKey="seeFirstName" userInput="$$customer.firstname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
39+
<see mergeKey="seeLastName" userInput="$$customer.lastname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
40+
<see mergeKey="seeEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
4141
</test>
4242
</cest>
4343
</config>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Cest/AdminCreateStoreGroupCest.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,17 @@
3636
<click mergeKey="s11" selector="{{AdminStoresGridSection.resetButton}}"/>
3737
<waitForPageLoad mergeKey="s15" time="10"/>
3838

39-
<!-- Uncomment after MFTF Bug MQE-391 is fixed -->
40-
<!--fillField mergeKey="s17" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="$$b1.group[name]$$"/-->
39+
<fillField mergeKey="s17" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="$$b1.group[name]$$"/>
4140
<click mergeKey="s19" selector="{{AdminStoresGridSection.searchButton}}"/>
4241
<waitForPageLoad mergeKey="s21" time="10"/>
43-
<!--see mergeKey="s23" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" userInput="$$b1.group[name]$$"/-->
42+
<see mergeKey="s23" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" userInput="$$b1.group[name]$$"/>
4443

4544
<click mergeKey="s31" selector="{{AdminStoresGridSection.resetButton}}"/>
4645
<waitForPageLoad mergeKey="s35" time="10"/>
47-
<!--fillField mergeKey="s37" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="$$b2.group[name]$$"/-->
46+
<fillField mergeKey="s37" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="$$b2.group[name]$$"/>
4847
<click mergeKey="s39" selector="{{AdminStoresGridSection.searchButton}}"/>
4948
<waitForPageLoad mergeKey="s41" time="10"/>
50-
<!--see mergeKey="s43" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" userInput="$$b2.group[name]$$"/-->
49+
<see mergeKey="s43" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" userInput="$$b2.group[name]$$"/>
5150
</test>
5251
</cest>
5352
</config>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Metadata/store-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
1010
<operation name="CreateStore" dataType="store" type="create"
11-
auth="adminFormKey" url="/admin/system_store/save" method="POST" successRegex="messages-message-success" returnRegex="" >
11+
auth="adminFormKey" url="/admin/system_store/save" method="POST" successRegex="/messages-message-success/" returnRegex="" >
1212
<object dataType="store" key="store">
1313
<field key="group_id">string</field>
1414
<field key="name">string</field>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Store/Metadata/store_group-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
1010
<operation name="CreateStoreGroup" dataType="group" type="create"
11-
auth="adminFormKey" url="/admin/system_store/save" method="POST" successRegex="messages-message-success" returnRegex="" >
11+
auth="adminFormKey" url="/admin/system_store/save" method="POST" successRegex="/messages-message-success/" returnRegex="" >
1212
<contentType>application/x-www-form-urlencoded</contentType>
1313
<object dataType="group" key="group">
1414
<field key="group_id">string</field>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Test XML Example -->
3+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
4+
<cest name="StorefrontCustomerCreateWishlistCest">
5+
<annotations>
6+
<features value="Persist a wishlist for a customer"/>
7+
<stories value="Persist a wishlist for a customer"/>
8+
<env value="chrome"/>
9+
<env value="firefox"/>
10+
<env value="phantomjs"/>
11+
<group value="wishlist"/>
12+
</annotations>
13+
<before>
14+
<createData mergeKey="category" entity="SimpleSubCategory"/>
15+
<createData mergeKey="product" entity="SimpleProduct" >
16+
<required-entity persistedKey="category"/>
17+
</createData>
18+
<createData mergeKey="customer" entity="Simple_US_Customer"/>
19+
<createData mergeKey="wishlist" entity="Wishlist">
20+
<required-entity persistedKey="customer"/>
21+
<required-entity persistedKey="product"/>
22+
</createData>
23+
</before>
24+
<after>
25+
<deleteData mergeKey="deleteProduct" createDataKey="product"/>
26+
<deleteData mergeKey="deleteCategory" createDataKey="category"/>
27+
<deleteData mergeKey="deleteCustomer" createDataKey="customer"/>
28+
</after>
29+
<test name="StorefrontCustomerCreateWishlistTest">
30+
<annotations>
31+
<title value="Persist a wishlist for a customer"/>
32+
<description value="Persist a wishlist for a customer"/>
33+
</annotations>
34+
<amOnPage mergeKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage}}"/>
35+
<fillField mergeKey="fillEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
36+
<fillField mergeKey="fillPassword" userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
37+
<waitForElementVisible mergeKey="waitForButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
38+
<click mergeKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
39+
<see mergeKey="seeFirstName" userInput="$$customer.firstname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
40+
<see mergeKey="seeLastName" userInput="$$customer.lastname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
41+
<see mergeKey="seeEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" />
42+
<waitForPageLoad mergeKey="15"/>
43+
<amOnPage mergeKey="amOnWishlist" url="{{StorefrontCustomerWishlistPage}}"/>
44+
<see mergeKey="seeInField" userInput="$$product.name$$" selector="{{StorefrontCustomerWishlistSection.productItemName}}"/>
45+
</test>
46+
</cest>
47+
</config>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
4+
<entity name="Wishlist" type="wishlist">
5+
<data key="id">null</data>
6+
<var key="product" entityType="product" entityKey="id"/>
7+
<var key="customer_email" entityType="customer" entityKey="email"/>
8+
<var key="customer_password" entityType="customer" entityKey="password"/>
9+
</entity>
10+
</config>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
5+
<operation name="CreateWishlist" dataType="wishlist" type="create"
6+
auth="customerFormKey" url="/wishlist/index/add/" method="POST" successRegex="" returnRegex="~\/wishlist_id\/(\d*?)\/~" >
7+
<contentType>application/x-www-form-urlencoded</contentType>
8+
<field key="product">integer</field>
9+
<field key="customer_email">string</field>
10+
<field key="customer_password">string</field>
11+
</operation>
12+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="StorefrontCustomerWishlistPage" urlPath="/wishlist/" module="Magento_Wishlist">
12+
<section name="StorefrontCustomerWishlistSection" />
13+
</page>
14+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCustomerWishlistSection">
12+
<element name="productItemName" type="text" selector=".products-grid .product-item-name a"/>
13+
</section>
14+
</config>

0 commit comments

Comments
 (0)