Skip to content

Commit ba8cebe

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop-temporary-one-prs' into 2.4-develop-temporary-five-prs
2 parents b4f29c4 + 4a550b4 commit ba8cebe

32 files changed

+1035
-138
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToPageGridActionGroup">
12+
<annotations>
13+
<description>Navigates to CMS page grid.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CreateNewPageWithBasicValues">
12+
<annotations>
13+
<description>Click Add new page button and fills basic information in cms page. Values are hardcoded from _defaultCmsPage.</description>
14+
</annotations>
15+
16+
<click selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="clickAddNewPage"/>
17+
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/>
18+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
19+
<fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_defaultCmsPage.content_heading}}" stepKey="fillFieldContentHeading"/>
20+
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_defaultCmsPage.content}}" stepKey="fillFieldContent"/>
21+
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/>
22+
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="VerifyCreatedCmsPage">
12+
<annotations>
13+
<description>Verify created cms page in store front. Values are hardcoded from _defaultCmsPage.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/>
17+
<waitForPageLoad stepKey="waitForPageLoad2"/>
18+
<see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/>
19+
<see userInput="{{_defaultCmsPage.content}}" stepKey="seeContent"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,10 @@
2525
<after>
2626
<actionGroup ref="logout" stepKey="adminLogout"/>
2727
</after>
28-
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/>
29-
<waitForPageLoad stepKey="waitForPageLoad1"/>
30-
<click selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="clickAddNewPage"/>
31-
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/>
32-
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
33-
<fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_defaultCmsPage.content_heading}}" stepKey="fillFieldContentHeading"/>
34-
<!-- As of 2017/11/15, this test is failing here (Jenkins only, works locally). See MQE-282. -->
35-
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_defaultCmsPage.content}}" stepKey="fillFieldContent"/>
36-
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/>
37-
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/>
38-
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/>
39-
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
40-
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/>
41-
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
42-
<see userInput="You saved the page." stepKey="seeSuccessMessage"/>
43-
<amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/>
44-
<waitForPageLoad stepKey="waitForPageLoad2"/>
45-
<see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/>
46-
<see userInput="{{_defaultCmsPage.content}}" stepKey="seeContent"/>
28+
<actionGroup ref="AdminNavigateToPageGridActionGroup" stepKey="navigateToCmsPageGrid" />
29+
<actionGroup ref="CreateNewPageWithBasicValues" stepKey="createNewPageWithBasicValues" />
30+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveCmsPageButton" />
31+
<actionGroup ref="VerifyCreatedCmsPage" stepKey="verifyCmsPage" />
4732
</test>
4833
<test name="AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest">
4934
<annotations>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToCurrencySymbolsPageActionGroup">
12+
<amOnPage url="{{AdminCurrencySymbolsPage.url}}" stepKey="navigateToCurrencySymbolsPage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminCurrencySymbolIsDisabledActionGroup">
12+
<arguments>
13+
<argument name="currency" type="string"/>
14+
</arguments>
15+
16+
<grabAttributeFrom selector="{{AdminCurrencySymbolsGridSection.currencyElement(currency)}}" userInput="disabled" stepKey="grabDisabledAttribute"/>
17+
<assertEquals expected='true' expectedType="string" actual="$grabDisabledAttribute" stepKey="assertInputIsDisabled"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminCurrencySymbolsPage" url="admin/system_currencysymbol/" area="admin" module="CurrencySymbol">
12+
<section name="AdminCurrencySymbolsGridSection"/>
13+
</page>
14+
</pages>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCurrencySymbolsGridSection">
12+
<element name="currencyElement" type="input" selector="#currency-symbols-form #custom_currency_symbol{{currency}}" parameterized="true"/>
13+
</section>
14+
</sections>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="AdminCurrencySymbolsAreDisabledTest">
12+
<annotations>
13+
<features value="CurrencySymbol"/>
14+
<stories value="Currency Symbols"/>
15+
<title value="Currency symbols are disabled by default"/>
16+
<description value="Currency symbols should be disabled by default"/>
17+
<severity value="MINOR"/>
18+
<group value="currency"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}},{{SetAllowedCurrenciesConfigForRUB.value}}" stepKey="setAllowedCurrencyWebsites_EUR_RUB_USD"/>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyWebsites_EUR_USD"/>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
<actionGroup ref="AdminNavigateToCurrencySymbolsPageActionGroup" stepKey="navigateToCurrencySymbolsPage"/>
29+
<actionGroup ref="AssertAdminCurrencySymbolIsDisabledActionGroup" stepKey="assertEURDisabledInput">
30+
<argument name="currency" value="{{SetAllowedCurrenciesConfigForEUR.value}}"/>
31+
</actionGroup>
32+
<actionGroup ref="AssertAdminCurrencySymbolIsDisabledActionGroup" stepKey="assertUSDDisabledInput">
33+
<argument name="currency" value="{{SetAllowedCurrenciesConfigForUSD.value}}"/>
34+
</actionGroup>
35+
<actionGroup ref="AssertAdminCurrencySymbolIsDisabledActionGroup" stepKey="assertRUBDisabledInput">
36+
<argument name="currency" value="{{SetAllowedCurrenciesConfigForRUB.value}}"/>
37+
</actionGroup>
38+
</test>
39+
</tests>

app/code/Magento/CurrencySymbol/view/adminhtml/templates/grid.phtml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,28 @@
1212
<form id="currency-symbols-form" action="<?= $block->escapeUrl($block->getFormActionUrl()) ?>" method="post">
1313
<input name="form_key" type="hidden" value="<?= $block->escapeHtmlAttr($block->getFormKey()) ?>" />
1414
<fieldset class="admin__fieldset">
15-
<?php foreach ($block->getCurrencySymbolsData() as $code => $data) : ?>
15+
<?php foreach ($block->getCurrencySymbolsData() as $code => $data): ?>
1616
<div class="admin__field _required">
1717
<label class="admin__field-label" for="custom_currency_symbol<?= $block->escapeHtmlAttr($code) ?>">
1818
<span><?= $block->escapeHtml($code) ?> (<?= $block->escapeHtml($data['displayName']) ?>)</span>
1919
</label>
2020
<div class="admin__field-control">
2121
<input id="custom_currency_symbol<?= $block->escapeHtmlAttr($code) ?>"
22-
class="required-entry admin__control-text <?= $data['inherited'] ? 'disabled' : '' ?>"
22+
class="required-entry admin__control-text"
2323
type="text"
2424
value="<?= $block->escapeHtmlAttr($data['displaySymbol']) ?>"
25-
name="custom_currency_symbol[<?= $block->escapeHtmlAttr($code) ?>]">
25+
name="custom_currency_symbol[<?= $block->escapeHtmlAttr($code) ?>]"
26+
<?= $data['inherited'] ? 'disabled' : '' ?>>
2627
<div class="admin__field admin__field-option">
28+
<?php
29+
$escapedCode = $block->escapeHtmlAttr($block->escapeJs($code));
30+
$escapedSymbol = $block->escapeJs($data['parentSymbol']);
31+
?>
2732
<input id="custom_currency_symbol_inherit<?= $block->escapeHtmlAttr($code) ?>"
2833
class="admin__control-checkbox" type="checkbox"
29-
onclick="toggleUseDefault(<?= '\'' . $block->escapeHtmlAttr($block->escapeJs($code)) . '\',\'' . $block->escapeJs($data['parentSymbol']) . '\'' ?>)"
34+
<?php //@codingStandardsIgnoreStart ?>
35+
onclick="toggleUseDefault(<?= '\'' . $escapedCode . '\',\'' . $escapedSymbol . '\'' ?>)"
36+
<?php //@codingStandardsIgnoreEnd ?>
3037
<?= $data['inherited'] ? ' checked="checked"' : '' ?>
3138
value="1"
3239
name="inherit_custom_currency_symbol[<?= $block->escapeHtmlAttr($code) ?>]">

0 commit comments

Comments
 (0)