Skip to content

Commit f7256b0

Browse files
Merge remote-tracking branch 'remotes/github/MC-5906' into EPAM-PR-41
2 parents 63680bc + ca6f3c0 commit f7256b0

File tree

7 files changed

+97
-2
lines changed

7 files changed

+97
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="CompareTwoProductsOrder">
12+
<arguments>
13+
<argument name="product_1"/>
14+
<argument name="product_2"/>
15+
</arguments>
16+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
17+
<waitForPageLoad stepKey="waitForPageLoad5"/>
18+
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByNumber('1')}}" userInput="alt" stepKey="grabFirstProductName1_1"/>
19+
<assertEquals expected="{{product_1.name}}" actual="($grabFirstProductName1_1)" message="notExpectedOrder" stepKey="compare1"/>
20+
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByNumber('2')}}" userInput="alt" stepKey="grabFirstProductName2_2"/>
21+
<assertEquals expected="{{product_2.name}}" actual="($grabFirstProductName2_2)" message="notExpectedOrder" stepKey="compare2"/>
22+
</actionGroup>
23+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<element name="ProductInfoByNumber" type="text" selector="//main//li[{{var1}}]//div[@class='product-item-info']" parameterized="true"/>
1717
<element name="ProductAddToCompareByNumber" type="text" selector="//main//li[{{var1}}]//a[contains(@class, 'tocompare')]" parameterized="true"/>
1818
<element name="listedProduct" type="block" selector="ol li:nth-child({{productPositionInList}}) img" parameterized="true"/>
19+
<element name="ProductImageByNumber" type="button" selector="//main//li[{{var1}}]//img" parameterized="true"/>
1920
<element name="categoryListView" type="button" selector="a[title='List']" timeout="30"/>
2021

2122
<element name="ProductTitleByName" type="button" selector="//main//li//a[contains(text(), '{{var1}}')]" parameterized="true"/>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ClearWidgetsFromCMSContent">
11+
<amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/>
12+
<waitForPageLoad stepKey="waitEditHomePagePageToLoad"/>
13+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab" />
14+
<waitForElementNotVisible selector="{{CmsWYSIWYGSection.CheckIfTabExpand}}" stepKey="waitForTabExpand"/>
15+
<executeJS function="tinyMCE.activeEditor.setContent('Hello TinyMCE4!');" stepKey="executeJSFillContent1"/>
16+
<click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/>
17+
<waitForPageLoad stepKey="waitSaveToBeApplied"/>
18+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the page." stepKey="seeSaveSuccess"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<page name="CmsPageEditPage" area="admin" url="admin/cms_page/edit/page_id/{{var}}" parameterized="true">
11+
<section name="CmsNewPagePageActionsSection"/>
12+
<section name="CmsNewPagePageBasicFieldsSection"/>
13+
<section name="CmsNewPagePageContentSection"/>
14+
<section name="CmsNewPagePageSeoSection"/>
15+
</page>
16+
</pages>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<element name="InsertImage" type="button" selector=".mce-i-image" />
3232
<element name="InsertTable" type="button" selector=".mce-i-table" />
3333
<element name="SpecialCharacter" type="button" selector=".mce-i-charmap" />
34+
<element name="WidgetButton" type="button" selector="span[class*='magento-widget mceNonEditable']"/>
3435
</section>
3536
<section name="MediaGallerySection">
3637
<element name="Browse" type="button" selector=".mce-i-browse"/>
@@ -99,6 +100,7 @@
99100
<element name="AddParam" type="button" selector=".rule-param-add"/>
100101
<element name="ConditionsDropdown" type="select" selector="#conditions__1__new_child"/>
101102
<element name="RuleParam" type="button" selector="//a[text()='...']"/>
103+
<element name="RuleParam1" type="button" selector="(//span[@class='rule-param']//a)[{{var}}]" parameterized="true"/>
102104
<element name="RuleParamSelect" type="select" selector="//ul[contains(@class,'rule-param-children')]/li[{{arg1}}]//*[contains(@class,'rule-param')][{{arg2}}]//select" parameterized="true"/>
103105
<element name="RuleParamInput" type="input" selector="//ul[contains(@class,'rule-param-children')]/li[{{arg1}}]//*[contains(@class,'rule-param')][{{arg2}}]//input" parameterized="true"/>
104106
<element name="RuleParamLabel" type="input" selector="//ul[contains(@class,'rule-param-children')]/li[{{arg1}}]//*[contains(@class,'rule-param')][{{arg2}}]//a" parameterized="true"/>

app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,15 @@
3838
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
3939
<waitForPageLoad stepKey="waitForPageLoad2" />
4040
</actionGroup>
41+
<actionGroup name="EnabledWYSIWYGEditor">
42+
<amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/>
43+
<waitForPageLoad stepKey="waitForPageLoad"/>
44+
<conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/>
45+
<waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitTabToExpand"/>
46+
<uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="enableEnableSystemValue"/>
47+
<selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Enabled by Default" stepKey="enableWYSIWYG"/>
48+
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptionsTab"/>
49+
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig" />
50+
<see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/>
51+
</actionGroup>
4152
</actionGroups>

app/code/Magento/Rule/Model/Condition/Sql/Builder.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,30 @@ public function attachConditionToCollection(
250250
$this->_joinTablesToCollection($collection, $combine);
251251
$whereExpression = (string)$this->_getMappedSqlCombination($combine);
252252
if (!empty($whereExpression)) {
253-
// Select ::where method adds braces even on empty expression
254-
$collection->getSelect()->where($whereExpression);
253+
if (!empty($combine->getConditions())) {
254+
$conditions = '';
255+
$attribute = '';
256+
foreach ($combine->getConditions() as $condition) {
257+
if ($condition->getData('attribute') === \Magento\Catalog\Api\Data\ProductInterface::SKU) {
258+
$conditions = $condition->getData('value');
259+
$attribute = $condition->getData('attribute');
260+
}
261+
}
262+
263+
$collection->getSelect()->where($whereExpression);
264+
265+
if (!empty($conditions) && !empty($attribute)) {
266+
$conditions = explode(',', $conditions);
267+
foreach ($conditions as &$condition) {
268+
$condition = "'" . trim($condition) . "'";
269+
}
270+
$conditions = implode(', ', $conditions);
271+
$collection->getSelect()->order("FIELD($attribute, $conditions)");
272+
}
273+
} else {
274+
// Select ::where method adds braces even on empty expression
275+
$collection->getSelect()->where($whereExpression);
276+
}
255277
}
256278
}
257279
}

0 commit comments

Comments
 (0)