/
StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml
91 lines (79 loc) · 4.41 KB
/
StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCustomerCheckoutDisabledProductAndCouponTest">
<annotations>
<features value="Checkout"/>
<stories value="Checkout via the Storefront"/>
<title value="Customer can login if product in his cart was disabled"/>
<description value="Customer can login with disabled product in the cart and a coupon applied"/>
<severity value="MINOR"/>
<testCaseId value="MC-21996"/>
<group value="checkout"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="Simple_US_Customer" stepKey="createUSCustomer"/>
<!-- Create sales rule with coupon -->
<createData entity="SalesRuleSpecificCouponAndByPercent" stepKey="createSalesRule"/>
<createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule">
<requiredEntity createDataKey="createSalesRule"/>
</createData>
</before>
<after>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createUSCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/>
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/>
</after>
<!-- Login as Customer -->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
<argument name="Customer" value="$$createUSCustomer$$" />
</actionGroup>
<!-- Add product to shopping cart -->
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/>
<actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart">
<argument name="product" value="$$createSimpleProduct$$"/>
<argument name="productCount" value="1"/>
</actionGroup>
<!-- Open View and edit -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart1"/>
<!-- Fill the Estimate Shipping and Tax section -->
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/>
<!-- Apply Coupon -->
<actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyDiscount">
<argument name="coupon" value="$$createCouponForCartPriceRule$$"/>
</actionGroup>
<!-- Sign out Customer from storefront -->
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/>
<!-- Login to admin panel -->
<openNewTab stepKey="openNewTab"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!-- Find the first simple product that we just created using the product grid and go to its page-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<!-- Disabled simple product from grid -->
<actionGroup ref="ChangeStatusProductUsingProductGridActionGroup" stepKey="disabledProductFromGrid">
<argument name="product" value="$$createSimpleProduct$$"/>
<argument name="status" value="Disable"/>
</actionGroup>
<closeTab stepKey="closeTab"/>
<!-- Login as Customer -->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLoginSecondTime">
<argument name="Customer" value="$$createUSCustomer$$" />
</actionGroup>
<!-- Check cart -->
<click selector="{{StorefrontMiniCartSection.show}}" stepKey="clickMiniCart2"/>
<dontSeeElement selector="{{StorefrontMiniCartSection.quantity}}" stepKey="dontSeeCartItem"/>
</test>
</tests>