Skip to content

Commit 2fb45bb

Browse files
committed
Merge remote-tracking branch 'origin/MC-4890' into mtf-eol
2 parents 1d4b482 + ef721e9 commit 2fb45bb

File tree

4 files changed

+102
-2
lines changed

4 files changed

+102
-2
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
<section name="StorefrontProductPageSection">
1212
<element name="qtyInput" type="button" selector="input.input-text.qty" timeout="30"/>
1313
<element name="addToCartBtn" type="button" selector="button.action.tocart.primary" timeout="30"/>
14-
<element name="successMsg" type="button" selector="div.message-success"/>
14+
<element name="successMsg" type="button" selector="div.message-success" timeout="30"/>
1515
<element name="errorMsg" type="button" selector="div.message-error" timeout="30"/>
1616
<element name="alertMessage" type="text" selector=".page.messages [role=alert]"/>
17-
<element name="messagesBlock" type="text" selector=".page.messages"/>
17+
<element name="messagesBlock" type="text" selector=".page.messages" timeout="30"/>
1818
<element name="addToWishlist" type="button" selector="//a[@class='action towishlist']" timeout="30"/>
1919
<element name="customTextOptionInput" type="input" selector=".input-text.product-custom-option"/>
2020
<element name="charCounter" type="text" selector=".character-counter"/>
2121
<element name="tax" type="input" selector=".totals-tax .amount .price"/>
22+
<element name="subTotal" type="input" selector="span[data-th='Subtotal']"/>
23+
<element name="shipping" type="input" selector="span[data-th='Shipping']"/>
2224
<element name="orderTotal" type="input" selector=".grand.totals .amount .price"/>
2325
</section>
2426
</sections>
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="FillShippingZipForm">
12+
<arguments>
13+
<argument name="address"/>
14+
</arguments>
15+
<conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="openShippingDetails"/>
16+
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{address.country}}" stepKey="selectCountry"/>
17+
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{address.state}}" stepKey="selectStateProvince"/>
18+
<fillField stepKey="fillPostCode" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{address.postcode}}"/>
19+
<waitForPageLoad stepKey="waitForFormUpdate"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="taxRate" type="input" selector="#taxRuleGrid_filter_tax_rates_codes"/>
1616
<element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/>
1717
<element name="successMessage" type="text" selector="#messages"/>
18+
<element name="emptyText" type="text" selector="//*[@id='taxRuleGrid_table']/tbody/tr"/>
1819
</section>
1920
</sections>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="AdminDeleteTaxRuleTest">
12+
<annotations>
13+
<stories value="Delete tax rule"/>
14+
<title value="Delete tax rule"/>
15+
<description value="Test log in to tax rule and Delete tax rule"/>
16+
<testCaseId value="MC-5823"/>
17+
<severity value="CRITICAL"/>
18+
<group value="tax"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="defaultTaxRule" stepKey="initialTaxRule"/>
24+
<createData entity="ApiSimplePrice100Qty100v2" stepKey="simpleProduct"/>
25+
<createData entity="Simple_US_Utah_Customer" stepKey="customer" />
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
</before>
28+
<after>
29+
<deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct" />
30+
<deleteData stepKey="deleteCustomer" createDataKey="customer" />
31+
</after>
32+
33+
<amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/>
34+
<waitForPageLoad stepKey="waitForTaxRuleIndex1"/>
35+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/>
36+
<fillField selector="{{AdminTaxRuleGridSection.code}}" userInput="$$initialTaxRule.code$$" stepKey="fillTaxCodeSearch"/>
37+
<click selector="{{AdminTaxRuleGridSection.search}}" stepKey="clickSearch1"/>
38+
<click selector="{{AdminTaxRuleGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/>
39+
40+
<!-- Delete values on the tax rule form page -->
41+
<click selector="{{AdminTaxRuleFormSection.deleteRule}}" stepKey="clickDeleteRule"/>
42+
<click selector="{{AdminTaxRuleFormSection.ok}}" stepKey="clickOk"/>
43+
<waitForPageLoad stepKey="waitForTaxRuleDeleted" />
44+
45+
<!-- Verify we see success message -->
46+
<see selector="{{AdminMessagesSection.success}}" userInput="The tax rule has been deleted." stepKey="seeAssertTaxRuleDeleteMessage"/>
47+
48+
<!-- Confirm Deleted Tax Rule(from the above step) on the tax rule grid page -->
49+
<amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex2"/>
50+
<waitForPageLoad stepKey="waitForTaxRuleIndex2"/>
51+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/>
52+
<fillField selector="{{AdminTaxRuleGridSection.code}}" userInput="$$initialTaxRule.code$$" stepKey="fillTaxCodeSearch2"/>
53+
<click selector="{{AdminTaxRuleGridSection.search}}" stepKey="clickSearch2"/>
54+
<see selector="{{AdminTaxRuleGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertTaxRuleNotFound"/>
55+
56+
<!-- Verify customer don't tax on the store front product page -->
57+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
58+
<argument name="Customer" value="$$customer$$" />
59+
</actionGroup>
60+
<amOnPage url="{{StorefrontProductPage.url($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPageOnStorefront"/>
61+
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
62+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
63+
<argument name="product" value="$$simpleProduct$$" />
64+
<argument name="productCount" value="1" />
65+
</actionGroup>
66+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart" />
67+
<actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm">
68+
<argument name="address" value="US_Address_Utah" />
69+
</actionGroup>
70+
<scrollTo selector="{{StorefrontProductPageSection.orderTotal}}" x="0" y="-80" stepKey="scrollToOrderTotal"/>
71+
<see selector="{{StorefrontProductPageSection.subTotal}}" userInput="$100.00" stepKey="seeSubTotal"/>
72+
<see selector="{{StorefrontProductPageSection.shipping}}" userInput="$5.00" stepKey="seeShipping"/>
73+
<dontSee selector="{{StorefrontProductPageSection.tax}}" stepKey="dontSeeAssertTaxAmount" />
74+
<see selector="{{StorefrontProductPageSection.orderTotal}}" userInput="$105.00" stepKey="seeAssertOrderTotal"/>
75+
</test>
76+
</tests>

0 commit comments

Comments
 (0)