Skip to content

Commit 1c3d29f

Browse files
committed
ACP2E-1276: Item Qty Goes Negative When Using The Down Arrow Keyboard Key
- Added the test coverage.
1 parent 28c7f79 commit 1c3d29f

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="StorefrontValidateItemQtyShouldNotBeNegativeValueWhenPressKeyboardDownKeyTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Item Qty Goes Negative When Using The Down Arrow Keyboard Key"/>
15+
<title value="Validate item quantity value should not be negative value when pressing keyboard down."/>
16+
<description value="Validate item quantity value should not be negative value when pressing keyboard down."/>
17+
<testCaseId value="AC-6927"/>
18+
<useCaseId value="ACP2E-1276"/>
19+
<severity value="AVERAGE"/>
20+
<group value="checkout"/>
21+
</annotations>
22+
<before>
23+
<!-- Create simple products and category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct" stepKey="createProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
</after>
33+
<!-- Open created product and add to cart -->
34+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage">
35+
<argument name="product" value="$$createProduct$$"/>
36+
</actionGroup>
37+
<actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="productAddToCart"/>
38+
<!--Click on mini cart-->
39+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>
40+
<waitForElementVisible selector="{{StorefrontMinicartSection.quantity}}" stepKey="waitForElementQty"/>
41+
<pressKey selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::DOWN]" stepKey="pressKeyDown1"/>
42+
<pressKey selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::DOWN]" stepKey="pressKeyDown2"/>
43+
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/>
44+
<assertGreaterThanOrEqual stepKey="validateMiniCartQtyValueGreaterThanZero">
45+
<actualResult type="const">$grabProductQtyInMinicart</actualResult>
46+
<expectedResult type="const">0</expectedResult>
47+
</assertGreaterThanOrEqual>
48+
<!--Click on view and edit cart link-->
49+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMiniCart"/>
50+
<waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/>
51+
<pressKey selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::DOWN]" stepKey="pressCartQuantityKeyDown1"/>
52+
<pressKey selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::DOWN]" stepKey="pressCartQuantityKeyDown2"/>
53+
<grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabProductQtyInCart"/>
54+
<assertGreaterThanOrEqual stepKey="validateCartQtyValueGreaterThanZero">
55+
<actualResult type="const">$grabProductQtyInCart</actualResult>
56+
<expectedResult type="const">0</expectedResult>
57+
</assertGreaterThanOrEqual>
58+
</test>
59+
</tests>

0 commit comments

Comments
 (0)