Skip to content

Commit 17a25d0

Browse files
committed
Revert "Revert "Added test coverage""
This reverts commit 25652bc.
1 parent 30f55fc commit 17a25d0

File tree

2 files changed

+121
-1
lines changed

2 files changed

+121
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111

1212
<section name="StoreFrontRecentlyViewedProductSection">
1313
<element name="ProductName" type="text" selector="//div[@class='products-grid']/ol/li[position()={{position}}]/div/div[@class='product-item-details']/strong/a" parameterized="true"/>
14+
<element name="ProductPrice" type="text" selector=".price-including-tax .price"/>
1415
</section>
15-
</sections>
16+
</sections>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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="AdminCreateTaxRuleForBundleProductInRecentlyViewedWidgetTest">
12+
<annotations>
13+
<stories value="Create tax rule for bundle product in recently viewed widget"/>
14+
<title value="Create tax rule for bundle product in recently viewed widget"/>
15+
<description value="Create tax rule for bundle product in recently viewed widget"/>
16+
<testCaseId value="AC-6282"/>
17+
<severity value="CRITICAL"/>
18+
<group value="tax"/>
19+
</annotations>
20+
<before>
21+
<createData entity="defaultTaxRate" stepKey="initialTaxRate"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/>
25+
<createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"/>
26+
<createData entity="ApiGroupedProduct2" stepKey="createGroupedProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<createData entity="OneSimpleProductLink" stepKey="addFirstProduct">
30+
<requiredEntity createDataKey="createGroupedProduct"/>
31+
<requiredEntity createDataKey="createFirstSimpleProduct"/>
32+
</createData>
33+
<updateData entity="OneMoreSimpleProductLink" createDataKey="addFirstProduct" stepKey="addSecondProduct">
34+
<requiredEntity createDataKey="createGroupedProduct"/>
35+
<requiredEntity createDataKey="createSecondSimpleProduct"/>
36+
</updateData>
37+
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
38+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" />
39+
<!-- Create tax rate for TX -->
40+
<createData entity="TaxRateTexas" stepKey="createTaxRateTX"/>
41+
<!-- Create tax rule -->
42+
<actionGroup ref="AdminCreateTaxRuleWithTwoTaxRatesActionGroup" stepKey="createTaxRule">
43+
<argument name="taxRate" value="$$createTaxRateTX$$"/>
44+
<argument name="taxRate2" value="US_NY_Rate_1"/>
45+
<argument name="taxRule" value="SimpleTaxRule"/>
46+
</actionGroup>
47+
<magentoCLI command="config:set {{CustomDisplayProductPricesInCatalog.path}} {{CustomDisplayProductPricesInCatalog.value}}" stepKey="selectInclAndExlTax"/>
48+
<magentoCLI command="cron:run --group=index" stepKey="runCronReindex"/>
49+
<!-- Create customer -->
50+
<createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/>
51+
</before>
52+
<after>
53+
<actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule">
54+
<argument name="taxRuleCode" value="{{SimpleTaxRule.code}}" />
55+
</actionGroup>
56+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
57+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
58+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
59+
<deleteData createDataKey="createGroupedProduct" stepKey="deleteProduct"/>
60+
<deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" />
61+
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
62+
<!-- Delete tax rate for UK -->
63+
<deleteData createDataKey="createTaxRateTX" stepKey="deleteTaxRateUK"/>
64+
<!-- Delete customer -->
65+
<magentoCLI command="config:set {{DisplayProductPricesInCatalog.path}} {{DisplayProductPricesInCatalog.value}}" stepKey="selectExlTax"/>
66+
<magentoCron groups="index" stepKey="reindex"/>
67+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
68+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
69+
</after>
70+
71+
<actionGroup ref="AdminOpenCreateNewCMSPageActionGroup" stepKey="navigateToPage"/>
72+
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/>
73+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab" />
74+
<waitForElementVisible selector="{{TinyMCESection.TinyMCE}}" stepKey="waitForTinyMCE"/>
75+
<executeJS function="tinyMCE.activeEditor.setContent('Hello CMS Page!');" stepKey="executeJSFillContent"/>
76+
<seeElement selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="seeWidgetIcon" />
77+
<click selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="clickInsertWidgetIcon" />
78+
<waitForPageLoad stepKey="waitForPageLoad" />
79+
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
80+
<!--see Insert Widget button disabled-->
81+
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
82+
<!--see Cancel button enabled-->
83+
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
84+
<!--Select "Widget Type"-->
85+
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Recently Viewed Products" stepKey="selectRecentlyViewedProducts" />
86+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear" />
87+
<!--see Insert Widget button enabled-->
88+
<see selector="{{WidgetSection.InsertWidgetBtnEnabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetEnabled" />
89+
<fillField selector="{{WidgetSection.PageSize}}" userInput="5" stepKey="fillNoOfProductDisplay" />
90+
<selectOption selector="{{WidgetSection.ProductAttribute}}" parameterArray="['Name','Image','Price','Learn More Link']" stepKey="selectSpecifiedOptions"/>
91+
<selectOption selector="{{WidgetSection.ButtonToShow}}" userInput="Add to Cart" stepKey="selectBtnToShow" />
92+
<selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Viewed Products Grid Template" stepKey="selectTemplate" />
93+
<actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/>
94+
<scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" />
95+
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/>
96+
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/>
97+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/>
98+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
99+
<argument name="Customer" value="$$createCustomer$$"/>
100+
</actionGroup>
101+
<!-- Navigate to the product -->
102+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct2Page">
103+
<argument name="product" value="$$createGroupedProduct$$"/>
104+
</actionGroup>
105+
<amOnPage url="$$createGroupedProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage" />
106+
<waitForPageLoad stepKey="waitForPage" />
107+
<amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/>
108+
<waitForPageLoad stepKey="wait5" />
109+
<!--see widget on Storefront-->
110+
<see userInput="Hello CMS Page!" stepKey="seeContent"/>
111+
<waitForPageLoad stepKey="wait6" />
112+
<waitForText userInput="$$createGroupedProduct.name$$" stepKey="waitForProductVisible" />
113+
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductPrice}}" stepKey="grabRelatedProductPosition"/>
114+
<assertStringContainsString stepKey="assertRelatedProductPrice">
115+
<actualResult type="const">$grabRelatedProductPosition</actualResult>
116+
<expectedResult type="string">$133.30</expectedResult>
117+
</assertStringContainsString>
118+
</test>
119+
</tests>

0 commit comments

Comments
 (0)