Skip to content

Commit 3f70852

Browse files
committed
AC-5811 : Verify that customer is matched only if cart has virtual item, Email Remainde
1 parent fa3d6ec commit 3f70852

11 files changed

+271
-0
lines changed
Lines changed: 26 additions & 0 deletions
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminDeleteEmailReminderRuleActionGroup">
12+
<annotations>
13+
<description> Delete created New Rule, and validate the success message</description>
14+
</annotations>
15+
<amOnPage url="{{AdminEmailReminderPage.url}}" stepKey="navigateToDesignConfigPageAgain" />
16+
<waitForPageLoad stepKey="waitForPageLoadToViewReminderPage"/>
17+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="resetSearchFilter"/>
18+
<fillField userInput="Test Rule" selector="{{AdminEmailReminderSection.searchRule}}" stepKey="fillSearchEmailField"/>
19+
<click selector="{{AdminDataGridHeaderSection.searchButton}}" stepKey="clickSearchButton"/>
20+
<click selector="{{AdminEmailReminderSection.selectFirstRow}}" stepKey="clickFirstRow"/>
21+
<click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnDeleteStorePage"/>
22+
<click selector="{{AdminEmailReminderSection.ok}}" stepKey="clickOnPlusButton"/>
23+
<waitForPageLoad stepKey="waitForPageToLoad"/>
24+
<see userInput="You deleted the reminder rule." stepKey="seeSuccessMessage"/>
25+
</actionGroup>
26+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEmailReminderConditionsActionGroup">
12+
<annotations>
13+
<description>Create Conditions and click save And Continue Edit it.</description>
14+
</annotations>
15+
<click selector="{{AdminEmailReminderSection.conditions}}" stepKey="clickOnConditions"/>
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<click selector="{{AdminEmailReminderSection.clickAdd}}" stepKey="clickOnPlusButton"/>
18+
<click selector="{{AdminEmailReminderSection.chooseCart}}" stepKey="clickOnchooseCartOption"/>
19+
<waitForPageLoad stepKey="waitForPageToLoad"/>
20+
<click selector="{{AdminEmailReminderSection.clickOnPlus}}" stepKey="clickOnPlusAgain"/>
21+
<click selector="{{AdminEmailReminderSection.chooseVirtualOnly}}" stepKey="clickOnChooseVirtualOnly"/>
22+
<click selector="{{AdminEmailReminderSection.saveAndContinueEdit}}" stepKey="clickOnSaveAndContinueEdit"/>
23+
<see userInput="You saved the reminder rule." stepKey="seeSuccessMessage"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEmailReminderMatchedCustomersActionGroup">
12+
<annotations>
13+
<description>Validatte custimer email id .</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="Customer"/>
17+
</arguments>
18+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="resetSearchFilter"/>
19+
<fillField userInput="{{Customer.email}}" selector="{{AdminEmailReminderSection.emailCustomer}}" stepKey="fillSearchEmailField"/>
20+
<click selector="{{AdminDataGridHeaderSection.searchButton}}" stepKey="clickSearchButton"/>
21+
<seeElement selector="{{AdminEmailReminderSection.emailId(Customer.email)}}" stepKey="seeExistingCustomerId"/>
22+
<waitForPageLoad stepKey="waitForStoreToLoad"/>
23+
<see userInput="You matched the reminder rule." stepKey="seeSuccessMessage"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEmailReminderRuleActionGroup">
12+
<annotations>
13+
<description>Create an New Rule, and click on save And Continue Edit it</description>
14+
</annotations>
15+
<click selector="{{AdminEmailReminderSection.addNewRule}}" stepKey="clickAddNewRule"/>
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<fillField selector="{{AdminEmailReminderSection.ruleName}}" userInput="Test Rule" stepKey="enterRuleName"/>
18+
<click selector="{{AdminEmailReminderSection.saveAndContinueEdit}}" stepKey="clickOnSaveAndContinueEdit"/>
19+
<see userInput="You saved the reminder rule." stepKey="seeSuccessMessage"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 22 additions & 0 deletions
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEmailReminderRunNowActionGroup">
12+
<annotations>
13+
<description>click on Run now and goto Matched Customers options.</description>
14+
</annotations>
15+
<click selector="{{AdminEmailReminderSection.runNow}}" stepKey="clickOnRunNow"/>
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<click selector="{{AdminEmailReminderSection.ok}}" stepKey="clickOnPlusButton"/>
18+
<waitForPageLoad stepKey="waitForPageToLoad"/>
19+
<click selector="{{AdminEmailReminderSection.matchedCustomers}}" stepKey="clickOnMatchedCustomers"/>
20+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 14 additions & 0 deletions
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminEmailReminderPage" url="/admin/reminder/" area="admin" module="Magento_Email">
12+
<section name="AdminEmailTemplateIndexSection"/>
13+
</page>
14+
</pages>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminEmailReminderSection">
12+
<element name="addNewRule" type="button" selector="//span[normalize-space()='Add New Rule']"/>
13+
<element name="ruleName" type="input" selector="//input[@name='name']"/>
14+
<element name="saveAndContinueEdit" type="button" selector="//span[normalize-space()='Save and Continue Edit']"/>
15+
<element name="successMessage" type="text" selector="//div[text()='You saved the reminder rule.']"/>
16+
<element name="conditions" type="button" selector="//a[@name='conditions_section']" timeout="30"/>
17+
<element name="clickAdd" type="button" selector="//img[@class='rule-param-add v-middle']" timeout="30"/>
18+
<element name="chooseCart" type="button" selector="//select[@name='rule[conditions][1][new_child]']//option[text()='Shopping Cart']" timeout="30"/>
19+
<element name="clickOnPlus" type="button" selector="//ul[@id='conditions__1--1__children']//img[@title='Add']" />
20+
<element name="chooseVirtualOnly" type="button" selector="//select[@name='rule[conditions][1--1][new_child]']//option[text()='Virtual Only']" timeout="30"/>
21+
<element name="runNow" type="button" selector="//button[@title='Run Now']"/>
22+
<element name="ok" type="button" selector="aside.confirm .modal-footer button.action-accept" timeout="120"/>
23+
<element name="matchedCustomers" type="button" selector="//a[@name='matched_customers']" timeout="30"/>
24+
<element name="emailCustomer" type="input" selector="//input[@name='grid_email']" timeout="30"/>
25+
<element name="searchRule" type="input" selector="//input[@id='reminderGrid_filter_name']" timeout="30"/>
26+
<element name="emailId" type="text" selector= "//td[contains(@class,'a-left col-grid_email')]//a[text()='{{email}}']" parameterized="true"/>
27+
<element name="selectFirstRow" type="text" selector="//td[normalize-space()='Test Rule']" timeout="30"/>
28+
</section>
29+
30+
</sections>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="VerifyCustomerMatchedOnlyVirtualItemInCartTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Verify that customer is matched only if cart has virtual item, Email Remainde"/>
15+
<title value="Verify that customer is matched only if cart has virtual item, Email Remainde"/>
16+
<description value="Verify that customer is matched only if cart has virtual item, Email Remainde"/>
17+
<severity value="MAJOR"></severity>
18+
<testCaseId value="AC-5811"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
24+
<!-- Customer John.Doe@example.com is created.-->
25+
<createData entity="Simple_US_Customer" stepKey="customer"/>
26+
27+
<!--Customer Jane.Doe@example.com is created.-->
28+
<createData entity="Simple_GB_Customer" stepKey="customer2"/>
29+
30+
<!--Simple product is created.-->
31+
<createData entity="_defaultCategory" stepKey="category"/>
32+
<createData entity="SimpleProduct" stepKey="product">
33+
<requiredEntity createDataKey="category"/>
34+
</createData>
35+
36+
<!--Virtual product is created.-->
37+
<createData entity="VirtualProduct" stepKey="virtualProduct">
38+
<requiredEntity createDataKey="category"/>
39+
</createData>
40+
41+
<!-- johndoe has 1 virtual prduct in cart-->
42+
<!-- Login as customer -->
43+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront">
44+
<argument name="Customer" value="$$customer$$"/>
45+
</actionGroup>
46+
47+
<!-- Add product to shopping cart -->
48+
<amOnPage url="{{StorefrontProductPage.url($$virtualProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToToPDP"/>
49+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addVirtualProductToCart">
50+
<argument name="productQty" value="1"/>
51+
</actionGroup>
52+
<actionGroup ref="AdminCustomerLogoutActionGroup" stepKey="clickOnSignOut"/>
53+
54+
<!--JaneDoe has 1 simple product in cart-->
55+
<!-- Login as customer -->
56+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontWithNewCustomer">
57+
<argument name="Customer" value="$$customer2$$"/>
58+
</actionGroup>
59+
60+
<!-- Add product to shopping cart -->
61+
<amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="navigateToToPDPAgain"/>
62+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addSimpleProductToCart">
63+
<argument name="productQty" value="1"/>
64+
</actionGroup>
65+
</before>
66+
67+
<!-- Create new rule, condition and clicking on run now -->
68+
<amOnPage url="{{AdminEmailReminderPage.url}}" stepKey="navigateToDesignConfigPage" />
69+
<waitForPageLoad stepKey="waitForPageLoadToViewDesignConfigPage"/>
70+
<actionGroup ref="AdminEmailReminderRuleActionGroup" stepKey="createNewRule"/>
71+
<actionGroup ref="AdminEmailReminderConditionsActionGroup" stepKey="createConditions"/>
72+
<actionGroup ref="AdminEmailReminderRunNowActionGroup" stepKey="clickonRunNow"/>
73+
74+
<!-- Match the customer in grid/>-->
75+
<actionGroup ref="AdminEmailReminderMatchedCustomersActionGroup" stepKey="validateEmailid">
76+
<argument name="Customer" value="$$customer$$"/>
77+
</actionGroup>
78+
79+
<after>
80+
<actionGroup ref="AdminDeleteEmailReminderRuleActionGroup" stepKey="deleteTheRule"/>
81+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
82+
<deleteData createDataKey="virtualProduct" stepKey="deleteVirtualProduct"/>
83+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
84+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
85+
</after>
86+
</test>
87+
</tests>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCustomerLogoutActionGroup">
12+
<annotations>
13+
<description>>Admin Customer Logout from the page.</description>
14+
</annotations>
15+
<click selector="{{AdminLoginAsCustomerConfirmationModalSection.onArrow}}" stepKey="clickOnArrow"/>
16+
<click selector="{{AdminLoginAsCustomerConfirmationModalSection.onSignOut}}" stepKey="clickOnSignOut"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/LoginAsCustomer/Test/Mftf/Section/AdminLoginAsCustomerConfirmationModalSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminLoginAsCustomerConfirmationModalSection">
1212
<element name="store" type="select" selector="//select[@id='lac-confirmation-popup-store-id']"/>
13+
<element name="onArrow" type="button" selector="//div[@class='panel header']//button[@type='button']"/>
14+
<element name="onSignOut" type="button" selector="//div[@aria-hidden='false']//a[contains(text(),'Sign Out')]"/>
1315
</section>
1416
</sections>

0 commit comments

Comments
 (0)