Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 1060edf

Browse files
Merge pull request #2081 from magento-trigger/MAGETWO-71404
[CMS Team 3] Sprint 1
2 parents 37d8bf1 + 6e50041 commit 1060edf

File tree

19 files changed

+240
-67
lines changed

19 files changed

+240
-67
lines changed

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
</fileUploader>
177177
</formElements>
178178
</field>
179-
<field name="description" template="ui/form/field" sortOrder="50" formElement="wysiwyg">
179+
<field name="description" template="Magento_Catalog/field-wysiwyg" sortOrder="50" formElement="wysiwyg">
180180
<argument name="data" xsi:type="array">
181181
<item name="config" xsi:type="array">
182182
<item name="wysiwygConfigData" xsi:type="array">
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div class="admin__field"
8+
visible="visible"
9+
css="$data.additionalClasses"
10+
attr="'data-index': index"
11+
ifnot="stageActive">
12+
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
13+
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
14+
</label>
15+
<div class="admin__field-control"
16+
css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault">
17+
<render args="elementTmpl" ifnot="hasAddons()"/>
18+
19+
<div class="admin__control-addon" if="hasAddons()">
20+
<render args="elementTmpl"/>
21+
22+
<label class="admin__addon-prefix" if="$data.addbefore" attr="for: uid">
23+
<span text="addbefore"/>
24+
</label>
25+
<label class="admin__addon-suffix" if="$data.addafter" attr="for: uid">
26+
<span text="addafter"/>
27+
</label>
28+
</div>
29+
30+
<render args="tooltipTpl" if="$data.tooltip"/>
31+
32+
<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
33+
34+
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
35+
36+
<div class="admin__field-note" if="$data.notice" attr="id: noticeId">
37+
<span translate="notice"/>
38+
</div>
39+
40+
<div class="admin__additional-info" if="$data.additionalInfo" html="$data.additionalInfo"></div>
41+
42+
<render args="$data.service.template" if="$data.hasService()"/>
43+
</div>
44+
</div>
45+
46+
<render if="stageActive" args="elementTmpl"/>

app/code/Magento/Cms/Model/Wysiwyg/CompositeConfigProvider.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ public function processWysiwygConfig($config)
130130
/**
131131
* Returns active editor path
132132
*
133+
* @param \Magento\Framework\DataObject $config
133134
* @return string
134135
*/
135-
private function getActiveEditorPath()
136+
private function getActiveEditorPath($config)
136137
{
137-
if (!isset($this->activeEditorPath)) {
138-
$this->activeEditorPath = $this->activeEditor->getWysiwygAdapterPath();
138+
if (!isset($this->activeEditorPath) || $this->activeEditorPath !== $config->getData('activeEditorPath')) {
139+
$this->activeEditorPath = $config->getData('activeEditorPath')
140+
? $config->getData('activeEditorPath')
141+
: $this->activeEditor->getWysiwygAdapterPath();
142+
$config->setData('activeEditorPath', $this->activeEditorPath);
139143
}
140144
return $this->activeEditorPath;
141145
}
@@ -149,7 +153,7 @@ private function getActiveEditorPath()
149153
*/
150154
private function updateConfig($config, array $configProviders)
151155
{
152-
$adapterType = $this->getActiveEditorPath();
156+
$adapterType = $this->getActiveEditorPath($config);
153157
//Extension point to update plugin settings by adapter type
154158
$providerClass = isset($configProviders[$adapterType])
155159
? $configProviders[$adapterType]

app/code/Magento/Cms/Model/Wysiwyg/Config.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ public function getConfig($data = [])
201201

202202
$config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
203203

204-
if ($this->_authorization->isAllowed('Magento_Cms::media_gallery')) {
205-
$this->configProvider->processGalleryConfig($config);
206-
}
207-
208204
if (is_array($data)) {
209205
$config->addData($data);
210206
}
207+
208+
if ($this->_authorization->isAllowed('Magento_Cms::media_gallery')) {
209+
$this->configProvider->processGalleryConfig($config);
210+
}
211211
if ($config->getData('add_widgets')) {
212212
$this->configProvider->processWidgetConfig($config);
213213
}

app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ define([
2323
value: '',
2424
$wysiwygEditorButton: '',
2525
links: {
26-
value: '${ $.provider }:${ $.dataScope }'
26+
value: '${ $.provider }:${ $.dataScope }',
27+
stageActive: false
2728
},
2829
template: 'ui/form/field',
2930
elementTmpl: 'ui/form/element/wysiwyg',
31+
stageActive: false,
3032
content: '',
3133
showSpinner: false,
3234
loading: false,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="navigateToCreatedCMSPage">
11+
<arguments>
12+
<argument name="CMSPage" defaultValue=""/>
13+
</arguments>
14+
<amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/>
15+
<waitForPageLoad stepKey="waitForPageLoad1"/>
16+
<conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
17+
<waitForPageLoad stepKey="waitForPageLoad2"/>
18+
<conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/>
19+
<waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish" />
20+
<!-- Conditional Click again in case it goes from default state to ascending on first click -->
21+
<conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/>
22+
<waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish" />
23+
<click selector="{{CmsPagesPageActionsSection.select(CMSPage.identifier)}}" stepKey="clickSelectCreatedCMSPage" />
24+
<click selector="{{CmsPagesPageActionsSection.edit(CMSPage.identifier)}}" stepKey="navigateToCreatedCMSPage" />
25+
<waitForPageLoad stepKey="waitForPageLoad3"/>
26+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/>
27+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection" />
28+
</actionGroup>
29+
<actionGroup name="navigateToCreatedCMSBlockPage">
30+
<arguments>
31+
<argument name="CMSBlockPage" defaultValue=""/>
32+
</arguments>
33+
<amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/>
34+
<waitForPageLoad stepKey="waitForPageLoad1"/>
35+
<conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/>
36+
<waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish" />
37+
<!-- Conditional Click again in case it goes from default state to ascending on first click -->
38+
<conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/>
39+
<waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish" />
40+
<click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock" />
41+
<click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock" />
42+
<waitForPageLoad stepKey="waitForPageLoad2"/>
43+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection" />
44+
</actionGroup>
45+
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Page/BlockPage.xml renamed to dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Page/CmsBlocksPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11-
<page name="BlocksPage" url="cms/block/new/" area="admin" module="Magento_Block">
11+
<page name="CmsBlocksPage" url="cms/block" area="admin" module="Magento_Block">
1212
<section name="BlockPageActionsSection"/>
1313
</page>
1414
</pages>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Section/BlockPageActionsSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="BlockPageActionsSection">
1212
<element name="addNewBlock" type="button" selector="#add" timeout="30"/>
13+
<element name="select" type="button" selector="//div[text()='{{var1}}']//parent::td//following-sibling::td//button[text()='Select']" parameterized="true"/>
14+
<element name="edit" type="button" selector="//div[text()='{{var1}}']//parent::td//following-sibling::td//a[text()='Edit']" parameterized="true"/>
15+
<element name="idColumn" type="button" selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]"/>
16+
<element name="clearAll" type="button" selector="//div[@class='admin__data-grid-header']//button[contains(text(), 'Clear all')]"/>
17+
<element name="activeFilters" type="button" selector="//div[@class='admin__data-grid-header']//span[contains(text(), 'Active filters:')]" />
1318
</section>
1419
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Section/CmsNewPagePageActionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="CmsNewPagePageActionsSection">
1212
<element name="savePage" type="button" selector="#save" timeout="30"/>
13+
<element name="saveAndContinueEdit" type="button" selector="#save_and_continue" timeout="30"/>
1314
</section>
1415
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Section/CmsNewPagePageContentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="header" type="button" selector="div[data-index=content]"/>
1313
<element name="contentHeading" type="input" selector="input[name=content_heading]"/>
1414
<element name="content" type="input" selector="#cms_page_form_content"/>
15+
<element name="TextArea" type="text" selector="#text_form_content"/>
1516
</section>
1617
<section name="CmsWYSIWYGSection">
1718
<element name="CheckIfTabExpand" type="button" selector="//div[@data-state-collapsible='closed']//span[text()='Content']"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Test/AdminAddImageToWYSIWYGBlockCest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/>
2424
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" />
2525
</before>
26-
<amOnPage url="{{BlocksPage.url}}" stepKey="amOnNewBlockPage"/>
26+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/>
2727
<waitForPageLoad stepKey="waitForPageLoad1"/>
2828
<fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{_defaultBlock.title}}" stepKey="fillFieldTitle1"/>
2929
<fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{_defaultBlock.identifier}}" stepKey="fillFieldIdentifier"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Test/AdminAddVariableToWYSIWYGBlockCest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<fillField selector="{{StoreConfigSection.City}}" userInput="{{_defaultVariable.city}}" stepKey="fillCity" />
3333
<click selector="{{StoreConfigSection.Save}}" stepKey="saveConfig"/>
3434
<!--Main test-->
35-
<amOnPage url="{{BlocksPage.url}}" stepKey="amOnNewBlockPage"/>
36-
<waitForPageLoad stepKey="waitForPageLoad2"/>
35+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/>
36+
<waitForPageLoad stepKey="waitForGridToLoad"/>
3737
<fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{_defaultBlock.title}}" stepKey="fillFieldTitle1"/>
3838
<fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{_defaultBlock.identifier}}" stepKey="fillFieldIdentifier"/>
3939
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" />
@@ -78,6 +78,8 @@
7878
<click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="clickSaveBlock"/>
7979
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/>
8080
<waitForPageLoad stepKey="waitForPageLoad7"/>
81+
<conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter1" visible="true"/>
82+
<waitForPageLoad stepKey="waitForFilterReload"/>
8183
<click selector="{{CmsPagesPageActionsSection.FilterBtn}}" stepKey="clickFiltersBtn" />
8284
<fillField selector="{{CmsPagesPageActionsSection.URLKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillOutURLKey" />
8385
<click selector="{{CmsPagesPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyBtn" />
@@ -109,6 +111,8 @@
109111
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
110112
<waitForPageLoad stepKey="waitForPageLoadAfterSaveCmsPage" />
111113
<see userInput="You saved the page." stepKey="seeSuccessMessage"/>
114+
<conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
115+
<waitForPageLoad stepKey="waitForPageLoad2"/>
112116
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage1"/>
113117
<waitForPageLoad stepKey="waitForPageLoad11" />
114118
<!--see Default Variable on Storefront-->

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Test/AdminAddWidgetToWYSIWYGBlockCest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/>
2525
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" />
2626
</before>
27-
<amOnPage url="{{BlocksPage.url}}" stepKey="amOnNewBlockPage"/>
27+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/>
2828
<waitForPageLoad stepKey="waitForPageLoad1"/>
2929
<fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{_defaultBlock.title}}" stepKey="fillFieldTitle"/>
3030
<fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{_defaultBlock.identifier}}" stepKey="fillFieldIdentifier"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Test/AdminCreateCmsPageTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
<description value="You should be able to create a CMS Page via the Admin."/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-25580"/>
19-
<group value="cms"/>
19+
<group value="Cms"/>
2020
</annotations>
21+
<before>
22+
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
23+
<actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/>
24+
</before>
2125
<after>
2226
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
2327
</after>
24-
25-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
2628
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/>
2729
<waitForPageLoad stepKey="waitForPageLoad1"/>
2830
<click selector="{{CmsPagesPageActionsSection.addNewPage}}" stepKey="clickAddNewPage"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Cms/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockCest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/>
2525
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" />
2626
</before>
27-
<amOnPage url="{{BlocksPage.url}}" stepKey="amOnNewBlockPage"/>
27+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/>
2828
<waitForPageLoad stepKey="waitForPageLoad1"/>
2929
<fillField selector="{{BlockNewPageBasicFieldsSection.blockTitle}}" userInput="{{_defaultBlock.title}}" stepKey="fillFieldTitle"/>
3030
<fillField selector="{{BlockNewPageBasicFieldsSection.identifier}}" userInput="{{_defaultBlock.identifier}}" stepKey="fillFieldIdentifier"/>
@@ -41,6 +41,8 @@
4141
<click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="clickSaveBlock"/>
4242
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnEditPage"/>
4343
<waitForPageLoad stepKey="waitForPageLoad2"/>
44+
<conditionalClick selector="{{BlockPageActionsSection.clearAll}}" dependentSelector="{{BlockPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
45+
<waitForPageLoad stepKey="waitForGridReload"/>
4446
<click selector="{{CmsPagesPageActionsSection.FilterBtn}}" stepKey="clickFiltersBtn" />
4547
<fillField selector="{{CmsPagesPageActionsSection.URLKey}}" userInput="$$createPreReqCMSPage.identifier$$" stepKey="fillOutURLKey" />
4648
<click selector="{{CmsPagesPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyBtn" />

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Config/Page/AdminConfigPage.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99
<page name="AdminConfigPage" url="admin/system_config/" area="admin" module="Magento_Config">
1010
<section name="AdminConfigSection"/>
1111
</page>
12+
<page name="AdminContentManagementPage" url="admin/system_config/edit/section/cms/" area="admin" module="Magento_Config">
13+
<section name="ContentManagementSection"/>
14+
</page>
1215
</pages>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Newsletter/Section/NewsletterTemplateSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<element name="save" type="button" selector="button[data-role='template-save']"/>
1616
</section>
1717
<section name="NewsletterWYSIWYGSection">
18+
<element name="TextArea" type="text" selector="#text" />
1819
<element name="TinyMCE4" type="text" selector=".mce-branding-powered-by" />
1920
<element name="TinyMCE3" type="text" selector="#cms_page_form_content_tbl"/>
2021
<element name="ShowHideBtn" type="button" selector="#toggletext"/>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Util\Command\Cli;
8+
9+
use Magento\Mtf\Util\Command\Cli;
10+
11+
/**
12+
* Handle set configuration for test execution.
13+
*/
14+
class Config extends Cli
15+
{
16+
/**
17+
* Parameter for reindex command.
18+
*/
19+
const PARAM_CONFIG_SET = 'config:set';
20+
21+
/**
22+
* Set configuration.
23+
*
24+
* @param string $path
25+
* @param string $value
26+
* @param string|null $scope
27+
* @param string|null $scopeCode
28+
* @return void
29+
*/
30+
public function setConfig($path, $value, $scope = null, $scopeCode = null)
31+
{
32+
$configurationString = '';
33+
34+
if ($scope !== null) {
35+
$configurationString.= sprintf('--scope=%s ', $scope);
36+
}
37+
38+
if ($scopeCode !== null) {
39+
$configurationString.= sprintf('--scope-code=%s ', $scopeCode);
40+
}
41+
$configurationString.= sprintf('%s %s', $path, $value);
42+
43+
parent::execute(Config::PARAM_CONFIG_SET . ' ' . $configurationString);
44+
}
45+
}

0 commit comments

Comments
 (0)