Skip to content

Commit c4f0864

Browse files
kieuphan2406irenelagno
authored andcommitted
Merge branch 'MC-1438' of github.com:magento-trigger/magento2-page-builder into MC-1438
2 parents 2279d35 + f7a1103 commit c4f0864

File tree

3 files changed

+45
-14
lines changed

3 files changed

+45
-14
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/WYSIWYGActionGroup.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,15 @@
143143
<waitForPageLoad stepKey="waitForPageLoad2"/>
144144
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForInsertLinkModalGone"/>
145145
</actionGroup>
146+
<actionGroup name="assertTextareaContainsValue">
147+
<arguments>
148+
<argument name="selector" type="string"/>
149+
<argument name="value" type="string"/>
150+
</arguments>
151+
<executeJS function="return Boolean(document.evaluate(&quot;{{selector}}&quot;, document.body).iterateNext().value.match(&apos;{{value}}&apos;))" stepKey="textareaValue"/>
152+
<assertContains stepKey="assertTextareaContainsValue">
153+
<expectedResult type="string">true</expectedResult>
154+
<actualResult type="variable">textareaValue</actualResult>
155+
</assertContains>
156+
</actionGroup>
146157
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTextSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<element name="base" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]/div" parameterized="true"/>
1212
<element name="textAreaText" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//div[.='{{arg2}}']" parameterized="true"/>
1313
<element name="textAreaTextContains" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//textarea[contains(@value,'{{arg2}}')]" parameterized="true"/>
14-
<element name="text" type="text" selector="//*[contains(@class, 'pagebuilder-text')][{{arg}}]//*[contains(text(),'{{arg2}}')]" parameterized="true"/>
14+
<element name="text" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]/div//*[contains(.,'{{arg2}}')]" parameterized="true"/>
1515
<element name="mcePlaceholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]/div//*[starts-with(@id, '{{arg2}}')]" parameterized="true"/>
1616
<element name="variablePlaceholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg}}]//*[@data-bind='html: data.main.html']//*[contains(@class, 'magento-variable magento-placeholder')]" parameterized="true"/>
1717
<element name="widgetPlaceholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg}}]//*[@data-bind='html: data.main.html']//*[contains(@class, 'magento-placeholder magento-widget')]" parameterized="true"/>
@@ -59,7 +59,7 @@
5959
<element name="base" type="text" selector="(//div[@data-role='text'])[{{arg1}}]" parameterized="true"/>
6060
<element name="baseJs" type="text" selector="document.querySelectorAll('[data-role=\'text\']')[{{arg1}}]" parameterized="true"/>
6161
<element name="textAreaText" type="text" selector="(//div[@data-role='text'])[{{arg1}}][.='{{arg2}}']" parameterized="true"/>
62-
<element name="textAreaWidget" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//a[contains(@href,'{{arg2}}{{arg3}}')]" parameterized="true"/>
62+
<element name="textAreaWidget" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//a[contains(@href,'{{arg2}}{{arg3}}{{arg4}}')]" parameterized="true"/>
6363
<element name="textAreaVariable" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//a[contains(@href,'{{arg2}}{{arg3}}')]" parameterized="true"/>
6464
<element name="text" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//*[contains(text(),'{{arg2}}')]" parameterized="true"/>
6565
<element name="empty" type="text" selector="//div[@data-role='text'][{{arg1}}][not(*)]" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTextTest.xml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
<see userInput="{{PageBuilderTextContentTypeDefault.value}}" stepKey="seeTextContentType"/>
453453
<seeElement selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
454454
<seeElement selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
455-
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
455+
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, '', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
456456
</test>
457457
<test name="TextSaveEmptyTextContentType">
458458
<annotations>
@@ -1666,6 +1666,7 @@
16661666
</actionGroup>
16671667
<waitForElementVisible selector="{{TextOnConfiguration.insertImageButton}}" stepKey="waitForInsertImage"/>
16681668
<click selector="{{TextOnConfiguration.insertImageButton}}" stepKey="clickInsertImage"/>
1669+
<waitForPageLoad stepKey="waitForPageLoad"/>
16691670
<actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder">
16701671
<argument name="ImageFolder" value="ImageFolder"/>
16711672
</actionGroup>
@@ -1676,12 +1677,18 @@
16761677
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
16771678
<!-- Validate Stage -->
16781679
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1679-
<waitForElementVisible selector="{{TextOnStage.textAreaText('1', ImageUpload3.value)}}" stepKey="waitForRawImageSourceToAppearInTextarea"/>
1680+
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaValueBeforeSave">
1681+
<argument name="value" value="{{ImageUpload3.value}}"/>
1682+
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
1683+
</actionGroup>
16801684
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
16811685
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
16821686
<!-- Validate Stage After Save -->
16831687
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
1684-
<waitForElementVisible selector="{{TextOnStage.textAreaText('1', ImageUpload3.value)}}" stepKey="waitForRawImageSourceToAppearInTextarea2"/>
1688+
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaValueAfterSave">
1689+
<argument name="value" value="{{ImageUpload3.value}}"/>
1690+
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
1691+
</actionGroup>
16851692
<!-- Validate Storefront -->
16861693
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
16871694
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
@@ -1770,9 +1777,6 @@
17701777
<group value="pagebuilder"/>
17711778
<group value="pagebuilder-text"/>
17721779
<group value="pagebuilder-customBeforeAfter"/>
1773-
<skip>
1774-
<issueId value="MC-3720"/>
1775-
</skip>
17761780
</annotations>
17771781
<before>
17781782
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -1805,7 +1809,11 @@
18051809
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
18061810
<!-- Validate Stage -->
18071811
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1808-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_WidgetCMSPageLink.editPanelValue)}}" stepKey="waitForTextStage"/>
1812+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue"/>
1813+
<assertContains stepKey="assertTextareaContainsValue">
1814+
<expectedResult type="string">{{PageBuilderTextArea_WidgetCMSPageLink.editPanelValue}}</expectedResult>
1815+
<actualResult type="variable">textareaValue</actualResult>
1816+
</assertContains>
18091817
<!-- Validate Edit Panel -->
18101818
<comment userInput="Validate Edit Panel" stepKey="commentValidateEditPanel"/>
18111819
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
@@ -1819,7 +1827,11 @@
18191827
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
18201828
<!-- Validate Stage After Save -->
18211829
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
1822-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_WidgetCMSPageLink.editPanelValue)}}" stepKey="waitForTextStage2"/>
1830+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue2"/>
1831+
<assertContains stepKey="assertTextareaContainsValue2">
1832+
<expectedResult type="string">{{PageBuilderTextArea_WidgetCMSPageLink.editPanelValue}}</expectedResult>
1833+
<actualResult type="variable">textareaValue2</actualResult>
1834+
</assertContains>
18231835
<!-- Validate Edit Panel -->
18241836
<comment userInput="Validate Edit Panel After Save" stepKey="commentValidateEditPanel2"/>
18251837
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage3">
@@ -1833,7 +1845,7 @@
18331845
</actionGroup>
18341846
<!-- Validate Storefront -->
18351847
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
1836-
<waitForElementVisible selector="{{TextOnStorefront.textAreaWidget('1', '{{_ENV.MAGENTO_BASE_URL}}', PageBuilderPageTitle.pageName)}}" stepKey="waitForTextStorefront"/>
1848+
<waitForElementVisible selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, 'text', PageBuilderPageTitle.pageName)}}" stepKey="waitForTextStorefront"/>
18371849
</test>
18381850
<test name="TextDisabledWYSIWYGAddVariable">
18391851
<annotations>
@@ -1878,7 +1890,11 @@
18781890
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
18791891
<!-- Validate Stage -->
18801892
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1881-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_VariableBaseURL.editPanelValue)}}" stepKey="waitForTextStage"/>
1893+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue1"/>
1894+
<assertContains stepKey="assertTextareaContainsValue1">
1895+
<expectedResult type="string">{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}</expectedResult>
1896+
<actualResult type="variable">textareaValue1</actualResult>
1897+
</assertContains>
18821898
<!-- Validate Edit Panel -->
18831899
<comment userInput="Validate Edit Panel" stepKey="commentValidateEditPanel"/>
18841900
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
@@ -1892,7 +1908,11 @@
18921908
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
18931909
<!-- Validate Stage After Save -->
18941910
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
1895-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_VariableBaseURL.editPanelValue)}}" stepKey="waitForTextStage2"/>
1911+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue2"/>
1912+
<assertContains stepKey="assertTextareaContainsValue2">
1913+
<expectedResult type="string">{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}</expectedResult>
1914+
<actualResult type="variable">textareaValue2</actualResult>
1915+
</assertContains>
18961916
<!-- Validate Edit Panel -->
18971917
<comment userInput="Validate Edit Panel After Save" stepKey="commentValidateEditPanel2"/>
18981918
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage3">
@@ -2122,6 +2142,6 @@
21222142
<see userInput="{{PageBuilderTextContentTypeDefault.value}}" stepKey="seeTextContentType"/>
21232143
<seeElement selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
21242144
<seeElement selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
2125-
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
2145+
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, '', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
21262146
</test>
21272147
</tests>

0 commit comments

Comments
 (0)