Skip to content

Commit ff7b459

Browse files
author
OlgaVasyltsun
committed
Merge remote-tracking branch 'origin/MC-30445' into 2.3-develop-pr105
2 parents 3262a5f + 38e082e commit ff7b459

File tree

3 files changed

+97
-1
lines changed

3 files changed

+97
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="StorefrontAddProductToCartFromProductPageActionGroup">
12+
<annotations>
13+
<description>Click on the Add to Cart button. Validates that the Success Message is present.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string" defaultValue="{{ApiSimpleProduct.name}}"/>
17+
</arguments>
18+
19+
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
20+
<waitForPageLoad stepKey="waitForAddToCart"/>
21+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/>
22+
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/>
23+
<waitForPageLoad stepKey="waitForPageLoad"/>
24+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
25+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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="StorefrontInactiveCatalogRule2Test">
12+
<annotations>
13+
<features value="CatalogRule"/>
14+
<stories value="Customer view catalog price rule"/>
15+
<title value="Customer should not see the catalog price rule promotion if status is inactive"/>
16+
<description value="Customer should not see the catalog price rule promotion if status is inactive"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-79"/>
19+
<group value="catalogRule"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
28+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
29+
30+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/>
31+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule">
32+
<argument name="active" value="0"/>
33+
<argument name="groups" value="'NOT LOGGED IN'"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForThirdPriceRule"/>
36+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyFirstPriceRule"/>
37+
<!-- Perform reindex -->
38+
<magentoCLI command="indexer:reindex" arguments="catalogrule_rule" stepKey="reindex"/>
39+
</before>
40+
41+
<after>
42+
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
43+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
44+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
45+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
46+
</after>
47+
48+
<!-- Verify price is not discounted on category page -->
49+
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openCategoryPageOnFrontend"/>
50+
<waitForPageLoad stepKey="waitForCategoryPageLoaded"/>
51+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByNumber('1')}}" userInput="$$createProduct.price$$" stepKey="seeProductPriceOnCategoryPage"/>
52+
53+
<!-- Verify price is not discounted on the product page -->
54+
<amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openProductPageOnFrontend"/>
55+
<waitForPageLoad stepKey="waitForProductPageLoaded"/>
56+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$createProduct.price$" stepKey="seePriceOnProductPage"/>
57+
58+
<!-- Verify price is not discounted in the cart -->
59+
<actionGroup ref="StorefrontAddProductToCartFromProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
60+
<argument name="productName" value="$createProduct.name$"/>
61+
</actionGroup>
62+
<actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCartPage" />
63+
<waitForElementVisible selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="waitForSubtotalAppears"/>
64+
<see selector="{{CheckoutCartSummarySection.subtotal}}" userInput="$createProduct.price$" stepKey="seeProductPriceOnCartPage"/>
65+
</test>
66+
</tests>

app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<annotations>
1313
<features value="CatalogRule"/>
1414
<stories value="Customer view catalog price rule"/>
15-
<title value="Customer should not see the catalog price rule promotion if status is inactive"/>
15+
<title value="DEPRECATED. Customer should not see the catalog price rule promotion if status is inactive"/>
1616
<description value="Customer should not see the catalog price rule promotion if status is inactive"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-79"/>
1919
<group value="CatalogRule"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use StorefrontInactiveCatalogRule2Test instead.</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="LoginAsAdmin" stepKey="login"/>

0 commit comments

Comments
 (0)