Skip to content

Commit

Permalink
Merge branch '2.4-develop' into Fixed-27141
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie authored May 7, 2020
2 parents 2d34f05 + 6b6f428 commit f6938af
Show file tree
Hide file tree
Showing 325 changed files with 9,964 additions and 1,312 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFillSearchTermActionGroup">
<annotations>
<description>Fills the search terms form with sample data.</description>
</annotations>
<arguments>
<argument name="searchQuery" type="string"/>
<argument name="store" type="string"/>
<argument name="redirectUrl" type="string"/>
<argument name="suggestedTerms" type="string"/>
</arguments>
<!-- Fill form fields -->
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.query_text}}" userInput="{{searchQuery}}" stepKey="fillFieldSearchQuery"/>
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.store_id}}" userInput="{{store}}" stepKey="selectStoreView"/>
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.redirect}}" userInput="{{redirectUrl}}" stepKey="fillFieldRedirectUrl"/>
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.display_in_terms}}" userInput="{{suggestedTerms}}" stepKey="selectSuggestedTerms" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenNewSearchTermsPageActionGroup">
<annotations>
<description>Navigate to search terms form page.</description>
</annotations>
<amOnPage url="{{AdminSearchTermsFormPage.url}}" stepKey="amOnSearchTermsForm"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSaveSearchTermActionGroup">
<annotations>
<description>Save a new search term from Magento admin.</description>
</annotations>
<!-- Click save action and verify success message -->
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveSearchButton"/>
</actionGroup>
</actionGroups>
17 changes: 17 additions & 0 deletions app/code/Magento/AdvancedSearch/Test/Mftf/Data/SearchTermsData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="SearchTerms">
<data key="searchQuery" unique="suffix">books</data>
<data key="store">Default Store View</data>
<data key="redirectUrl">http://sample.com</data>
<data key="suggestedTerms">1</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminSearchTermsFormPage" url="search/term/new/" area="admin" module="Magento_AdvancedSearch">
<section name="AdminSearchTermsPageFormFieldsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSearchTermsPageFormFieldsSection">
<element name="query_text" type="input" selector="#query_text"/>
<element name="store_id" type="select" selector="#store_id"/>
<element name="redirect" type="input" selector="#redirect"/>
<element name="display_in_terms" type="select" selector="#display_in_terms"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminAddSearchTermTest">
<annotations>
<features value="AdvancedSearch"/>
<stories value="Add a new search term"/>
<title value="Admin should be able to create a new search term"/>
<description value="Admin should be able to create a new search term using search terms grid"/>
<severity value="CRITICAL"/>
<group value="AdvancedSearch"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="AdminOpenNewSearchTermsPageActionGroup" stepKey="navigateToSearchTermPage"/>
<actionGroup ref="AdminFillSearchTermActionGroup" stepKey="fillNewSearchTermData">
<argument name="searchQuery" value="{{SearchTerms.searchQuery}}"/>
<argument name="store" value="{{SearchTerms.store}}"/>
<argument name="redirectUrl" value="{{SearchTerms.redirectUrl}}"/>
<argument name="suggestedTerms" value="{{SearchTerms.suggestedTerms}}"/>
</actionGroup>
<actionGroup ref="AdminSaveSearchTermActionGroup" stepKey="saveSearchTerm"/>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSaveSearchTermSuccessMessage">
<argument name="message" value="You saved the search term."/>
<argument name="messageType" value="success"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
<data key="scope_code">base</data>
<data key="value">en_US</data>
</entity>
<entity name="GeneralLocalCodeConfigsForMexico">
<data key="path">general/locale/code</data>
<data key="scope">websites</data>
<data key="scope_code">base</data>
<data key="value">es_MX</data>
</entity>
</entities>
6 changes: 3 additions & 3 deletions app/code/Magento/Catalog/Helper/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function productAttribute($product, $attributeHtml, $attributeName)
if ($attributeHtml !== null
&& $attribute->getIsHtmlAllowedOnFront()
&& $attribute->getIsWysiwygEnabled()
&& $this->isDirectivesExists($attributeHtml)
&& $this->isDirectivesExists((string)$attributeHtml)
) {
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
}
Expand Down Expand Up @@ -219,7 +219,7 @@ public function categoryAttribute($category, $attributeHtml, $attributeName)
if ($attributeHtml !== null
&& $attribute->getIsHtmlAllowedOnFront()
&& $attribute->getIsWysiwygEnabled()
&& $this->isDirectivesExists($attributeHtml)
&& $this->isDirectivesExists((string)$attributeHtml)

) {
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
Expand All @@ -238,7 +238,7 @@ public function categoryAttribute($category, $attributeHtml, $attributeName)
* @param string $attributeHtml
* @return bool
*/
public function isDirectivesExists($attributeHtml)
public function isDirectivesExists(string $attributeHtml): bool
{
$matches = false;
foreach ($this->directivePatterns as $pattern) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@
<createData entity="CustomerAccountSharingGlobal" stepKey="setConfigCustomerAccountToGlobal"/>
</before>

<!--Create website, Sore adn Store View-->
<!--Create website, Store and Store View-->
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="AdminCreateWebsite">
<argument name="newWebsiteName" value="secondWebsite"/>
<argument name="websiteCode" value="second_website"/>
<argument name="newWebsiteName" value="{{customWebsite.name}}"/>
<argument name="websiteCode" value="{{customWebsite.code}}"/>
</actionGroup>
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="AdminCreateStore">
<argument name="website" value="secondWebsite"/>
<argument name="storeGroupName" value="secondStore"/>
<argument name="storeGroupCode" value="second_store"/>
<argument name="website" value="{{customWebsite.name}}"/>
<argument name="storeGroupName" value="{{customStoreGroup.name}}"/>
<argument name="storeGroupCode" value="{{customStoreGroup.code}}"/>
</actionGroup>
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="AdminCreateStoreView">
<argument name="StoreGroup" value="customStoreTierPrice"/>
<argument name="customStore" value="customStoreView"/>
<argument name="StoreGroup" value="customStoreGroup"/>
<argument name="customStore" value="customStore"/>
</actionGroup>
<!--Set Configuration-->
<createData entity="CatalogPriceScopeWebsite" stepKey="paymentMethodsSettingConfig"/>
Expand All @@ -63,10 +63,10 @@
<argument name="product" value="$$product1$$"/>
</actionGroup>
<actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>
<actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing1">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>

<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct2">
Expand All @@ -76,10 +76,10 @@
<argument name="product" value="$$product2$$"/>
</actionGroup>
<actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite2">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>
<actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing2">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>

<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct3">
Expand All @@ -89,10 +89,10 @@
<argument name="product" value="$$product3$$"/>
</actionGroup>
<actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite3">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>
<actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing3">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>

<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct4">
Expand All @@ -102,10 +102,10 @@
<argument name="product" value="$$product4$$"/>
</actionGroup>
<actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite4">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>
<actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing4">
<argument name="website" value="secondWebsite"/>
<argument name="website" value="{{customWebsite.name}}"/>
</actionGroup>
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="ClearProductsFilterActionGroup"/>

Expand All @@ -120,7 +120,7 @@
<click selector="{{AdminCustomerAccountInformationSection.accountInformationButton}}" stepKey="ClickOnAccountInformationSection"/>
<waitForPageLoad stepKey="waitForPageOpened1"/>
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="Retailer" stepKey="Group"/>
<selectOption selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="secondStoreView" stepKey="clickToSelectStore"/>
<selectOption selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{customStore.name}}" stepKey="clickToSelectStore"/>
<click selector="{{AdminCustomerAccountInformationSection.saveCustomer}}" stepKey="save"/>
<waitForPageLoad stepKey="waitForCustomersPage"/>
<see userInput="You saved the customer." stepKey="CustomerIsSaved"/>
Expand All @@ -136,7 +136,7 @@
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
<waitForPageLoad stepKey="waitForPageDiscountPageIsLoaded"/>
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="ship" stepKey="fillRuleName"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="secondWebsite" stepKey="selectWebsites"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="{{customWebsite.name}}" stepKey="selectWebsites"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectCustomerGroup"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/>
<fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="ship" stepKey="setCode"/>
Expand All @@ -152,7 +152,7 @@
<!--Create new order-->
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="CreateNewOrder">
<argument name="customer" value="Simple_US_Customer"/>
<argument name="storeView" value="customStoreView"/>
<argument name="storeView" value="customStore"/>
</actionGroup>

<click selector="{{OrdersGridSection.addProducts}}" stepKey="clickToAddProduct"/>
Expand Down Expand Up @@ -327,7 +327,7 @@
<argument name="ruleName" value="ship"/>
</actionGroup>
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite">
<argument name="websiteName" value="secondWebsite"/>
<argument name="websiteName" value="{{customWebsite.name}}"/>
</actionGroup>
<createData entity="CustomerAccountSharingDefault" stepKey="setConfigCustomerAccountDefault"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
Expand Down
Loading

0 comments on commit f6938af

Please sign in to comment.