Skip to content

Commit 006f79b

Browse files
committed
MC-39953: After changing the layout the theme doesn't apply
1 parent c363bf7 commit 006f79b

File tree

6 files changed

+41
-36
lines changed

6 files changed

+41
-36
lines changed

app/code/Magento/Cms/Controller/Adminhtml/Page/InlineEdit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ private function filterPostWithDateConverting($postData = [], $pageData = [])
140140
if (
141141
!empty($newPageData['custom_theme_from'])
142142
&& date("Y-m-d", strtotime($postData['custom_theme_from']))
143-
=== date("Y-m-d", strtotime($pageData['custom_theme_from']))
143+
=== date("Y-m-d", strtotime($pageData['custom_theme_from']))
144144
) {
145145
$newPageData['custom_theme_from'] = date("Y-m-d", strtotime($postData['custom_theme_from']));
146146
}
147147
if (
148148
!empty($newPageData['custom_theme_to'])
149149
&& date("Y-m-d", strtotime($postData['custom_theme_to']))
150-
=== date("Y-m-d", strtotime($pageData['custom_theme_to']))
150+
=== date("Y-m-d", strtotime($pageData['custom_theme_to']))
151151
) {
152152
$newPageData['custom_theme_to'] = date("Y-m-d", strtotime($postData['custom_theme_to']));
153153
}

app/code/Magento/Cms/Test/Mftf/Page/CmsPagesPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="CmsPagesPage" url="/cms/page" area="admin" module="Magento_Cms">
1212
<section name="CmsPagesPageActionsSection"/>
13+
<section name="AdminCmsGridPageInlineEditSection"/>
1314
</page>
1415
</pages>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminCmsGridPageInlineEditSection">
11+
<element name="customDesignFrom" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_from']"/>
12+
<element name="customDesignTo" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_to']"/>
13+
<element name="customLayout" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='page_layout']"/>
14+
<element name="savePageButton" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/>
15+
</section>
16+
</sections>

app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageContentSection/CmsDesignSection.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
<element name="customDesignUpdateTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Custom Design Update']"/>
1313
<element name="customDesignFrom" type="input" selector="input[name='custom_theme_from']"/>
1414
<element name="customDesignTo" type="input" selector="input[name='custom_theme_to']"/>
15-
<element name="customDesignFromGrid" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_from']"/>
16-
<element name="customDesignToGrid" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='custom_theme_to']"/>
17-
<element name="customLayoutGrid" type="input" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='page_layout']"/>
18-
<element name="saveInGrid" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/>
19-
<element name="customTheme" type="select" selector="select[name='custom_theme']"/>
15+
<element name="customTheme" type="select" selector="//div[@data-index='custom_design_update']//select[@name='custom_theme']"/>
2016
<element name="LayoutDropdown" type="select" selector="select[name='page_layout']"/>
2117
</section>
2218
</sections>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
2323
<element name="activeFilters" type="button" selector="//div[@class='admin__data-grid-header']//span[contains(text(), 'Active filters:')]" />
2424
<element name="spinner" type="input" selector='//div[@data-component="cms_page_listing.cms_page_listing.cms_page_columns"]'/>
25-
<element name="firstItemSelectButton" type="button" selector=".data-grid .action-select-wrap button.action-select"/>
26-
<element name="firstItemEditButton" type="button" selector=".data-grid .action-select-wrap .action-menu-item[data-action~='item-edit']"/>
25+
<element name="firstItemSelectButton" type="button" selector=".data-grid .action-select-wrap button.action-select" timeout="30"/>
26+
<element name="firstItemEditButton" type="button" selector=".data-grid .action-select-wrap .action-menu-item[data-action~='item-edit']" timeout="30"/>
2727
<element name="activeFilter" type="button" selector="(//div[contains(@class, 'admin__data-grid-filters-current') and contains(@class, '_show')])[1]"/>
2828
<element name="savePageSuccessMessage" type="text" selector=".message-success"/>
2929
<element name="savePageWarningMessage" type="text" selector=".message-warning"/>

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

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,77 +10,69 @@
1010
<test name="AdminCMSPageInlineEditTest">
1111
<annotations>
1212
<features value="Cms"/>
13-
<stories value="Edit CMS Page"/>
13+
<stories value="Inline Edit Cms Page"/>
1414
<title value="Inline changing CMS page custom theme will be applied with proper dates"/>
1515
<description value="Verify that Merchant can inline edit CMS pages in grid and dates will be proper"/>
16-
<testCaseId value="MC-40900" />
1716
<severity value="MAJOR"/>
17+
<testCaseId value="MC-40900" />
18+
<useCaseId value="MC-39953"/>
1819
<group value="cms"/>
1920
<group value="ui"/>
2021
</annotations>
2122
<before>
2223
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2324
</before>
2425
<after>
26+
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCmsPageGridAgain"/>
2527
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetGridFilters"/>
2628
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
2729
</after>
28-
<generateDate date="+0 day" format="m/d/Y" stepKey="today"/>
30+
<generateDate date="now" format="m/d/Y" stepKey="today"/>
2931
<generateDate date="+1 day" format="m/d/Y" stepKey="tomorrow"/>
30-
<generateDate date="+0 day" format="M j, Y" stepKey="todayFormatted"/>
32+
<generateDate date="now" format="M j, Y" stepKey="todayFormatted"/>
3133
<generateDate date="+1 day" format="M j, Y" stepKey="tomorrowFormatted"/>
3234
<generateDate date="+100 day" format="m/d/Y" stepKey="newDateFrom"/>
3335
<generateDate date="+101 day" format="m/d/Y" stepKey="newDateTo"/>
3436
<generateDate date="+100 day" format="M j, Y" stepKey="newDateFromFormatted"/>
3537
<generateDate date="+101 day" format="M j, Y" stepKey="newDateToFormatted"/>
3638
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCmsPageGrid"/>
37-
<waitForPageLoad stepKey="waitForCmsPageGrid"/>
3839
<actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumn">
3940
<argument name="columnLabel" value="Custom design from"/>
4041
</actionGroup>
4142
<actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumnTwo">
4243
<argument name="columnLabel" value="Custom design to"/>
4344
</actionGroup>
44-
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
45+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clickClearFilters"/>
4546
<fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="404 Not Found" stepKey="fillKeywordSearchFieldWithSecondCustomerEmail"/>
4647
<click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/>
47-
<waitForPageLoad stepKey="waitForPageLoad"/>
4848
<see userInput="404 Not Found" selector="{{AdminGridRow.rowOne}}" stepKey="seeFirstCmsPageAfterFiltering"/>
49-
<actionGroup ref="AdminAssertNumberOfRecordsInUiGridActionGroup" stepKey="assertNumberOfRecordsInCmsPageGrid"/>
5049
<click selector="{{CmsPagesPageActionsSection.firstItemSelectButton}}" stepKey="clickOnSelectButton"/>
5150
<click selector="{{CmsPagesPageActionsSection.firstItemEditButton}}" stepKey="clickOnEditButton"/>
52-
<waitForPageLoad stepKey="waitForEditPageLoad"/>
5351
<click selector="{{CmsDesignSection.customDesignUpdateTab}}" stepKey="clickOnDesignTab"/>
5452
<waitForElementVisible selector="{{CmsDesignSection.customDesignFrom}}" stepKey="waitForLayoutDropDown" />
5553
<fillField selector="{{CmsDesignSection.customDesignFrom}}" userInput="{$today}" stepKey="fillDateFrom"/>
5654
<fillField selector="{{CmsDesignSection.customDesignTo}}" userInput="{$tomorrow}" stepKey="fillDateTo"/>
57-
<selectOption selector="{{CmsDesignSection.customTheme}}" userInput="Magento Blank" stepKey="fillCustomTheme"/>
58-
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
59-
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/>
60-
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
61-
<see userInput="You saved the page." stepKey="seeSuccessMessage"/>
55+
<selectOption selector="{{CmsDesignSection.customTheme}}" userInput="{{MagentoBlankTheme.name}}" stepKey="fillCustomTheme"/>
56+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="cxvcbcvb"/>
6257
<see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom"/>
6358
<see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo"/>
6459
<click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit"/>
65-
<waitForElementVisible selector="{{CmsDesignSection.customLayoutGrid}}" stepKey="waitForDate"/>
66-
<selectOption userInput="2 columns with right bar" selector="{{CmsDesignSection.customLayoutGrid}}" stepKey="changeLayoutFromGrid"/>
67-
<click selector="{{CmsDesignSection.saveInGrid}}" stepKey="clickSaveFromGrid"/>
68-
<waitForPageLoad stepKey="waitForPageSave"/>
60+
<waitForElementVisible selector="{{AdminCmsGridPageInlineEditSection.customLayout}}" stepKey="waitForDate"/>
61+
<selectOption userInput="2 columns with right bar" selector="{{AdminCmsGridPageInlineEditSection.customLayout}}" stepKey="changeLayoutFromGrid"/>
62+
<click selector="{{AdminCmsGridPageInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid"/>
6963
<see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom2"/>
7064
<see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo2"/>
7165
<click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit2"/>
72-
<waitForElementVisible selector="{{CmsDesignSection.customLayoutGrid}}" stepKey="waitForDate2"/>
73-
<selectOption userInput="2 columns with left bar" selector="{{CmsDesignSection.customLayoutGrid}}" stepKey="changeLayoutFromGrid2"/>
74-
<click selector="{{CmsDesignSection.saveInGrid}}" stepKey="clickSaveFromGrid2"/>
75-
<waitForPageLoad stepKey="waitForPageSave2"/>
66+
<waitForElementVisible selector="{{AdminCmsGridPageInlineEditSection.customLayout}}" stepKey="waitForDate2"/>
67+
<selectOption userInput="2 columns with left bar" selector="{{AdminCmsGridPageInlineEditSection.customLayout}}" stepKey="changeLayoutFromGrid2"/>
68+
<click selector="{{AdminCmsGridPageInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid2"/>
7669
<see userInput="{$todayFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom3"/>
7770
<see userInput="{$tomorrowFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo3"/>
7871
<click selector="{{AdminDataGridTableSection.rows}}" stepKey="clickEdit3"/>
79-
<waitForElementVisible selector="{{CmsDesignSection.customDesignFromGrid}}" stepKey="waitForDate3"/>
80-
<fillField selector="{{CmsDesignSection.customDesignFromGrid}}" userInput="{$newDateFrom}" stepKey="fillDateFromInGrid"/>
81-
<fillField selector="{{CmsDesignSection.customDesignToGrid}}" userInput="{$newDateTo}" stepKey="fillDateToInGrid"/>
82-
<click selector="{{CmsDesignSection.saveInGrid}}" stepKey="clickSaveFromGrid3"/>
83-
<waitForPageLoad stepKey="waitForPageSave3"/>
72+
<waitForElementVisible selector="{{AdminCmsGridPageInlineEditSection.customDesignFrom}}" stepKey="waitForDate3"/>
73+
<fillField selector="{{AdminCmsGridPageInlineEditSection.customDesignFrom}}" userInput="{$newDateFrom}" stepKey="fillDateFromInGrid"/>
74+
<fillField selector="{{AdminCmsGridPageInlineEditSection.customDesignTo}}" userInput="{$newDateTo}" stepKey="fillDateToInGrid"/>
75+
<click selector="{{AdminCmsGridPageInlineEditSection.savePageButton}}" stepKey="clickSaveFromGrid3"/>
8476
<see userInput="{$newDateFromFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design from')}}" stepKey="assertCustomDesignFrom4"/>
8577
<see userInput="{$newDateToFormatted}" selector="{{AdminOrdersGridSection.gridCell('2','Custom design to')}}" stepKey="assertCustomDesignTo4"/>
8678
</test>

0 commit comments

Comments
 (0)