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