Skip to content

Commit 9a3131e

Browse files
nathanjosiahirenelagno
authored andcommitted
MC-3565: Build stabilization for MC-1438
- Fixed tests
1 parent 05f7171 commit 9a3131e

File tree

3 files changed

+44
-14
lines changed

3 files changed

+44
-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
@@ -144,4 +144,15 @@
144144
<waitForPageLoad stepKey="waitForPageLoad2"/>
145145
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForInsertLinkModalGone"/>
146146
</actionGroup>
147+
<actionGroup name="assertTextareaContainsValue">
148+
<arguments>
149+
<argument name="selector" type="string"/>
150+
<argument name="value" type="string"/>
151+
</arguments>
152+
<executeJS function="return Boolean(document.evaluate(&quot;{{selector}}&quot;, document.body).iterateNext().value.match(&apos;{{value}}&apos;))" stepKey="textareaValue"/>
153+
<assertContains stepKey="assertTextareaContainsValue">
154+
<expectedResult type="string">true</expectedResult>
155+
<actualResult type="variable">textareaValue</actualResult>
156+
</assertContains>
157+
</actionGroup>
147158
</actionGroups>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<section name="TextOnStage">
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"/>
13-
<element name="textAreaTextContains" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//textarea[contains(@value,'{{arg2}}')]" parameterized="true"/>
1413
<element name="text" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]/div//*[contains(.,'{{arg2}}')]" parameterized="true"/>
1514
<element name="mcePlaceholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]/div//*[starts-with(@id, '{{arg2}}')]" parameterized="true"/>
1615
<element name="placeholder" type="text" selector="(//div[contains(@class,'pagebuilder-text')])[{{arg1}}]//div[contains(@class, 'placeholder-text') and text()='Edit Text']" parameterized="true"/>
@@ -57,7 +56,7 @@
5756
<element name="base" type="text" selector="(//div[@data-role='text'])[{{arg1}}]" parameterized="true"/>
5857
<element name="baseJs" type="text" selector="document.querySelectorAll('[data-role=\'text\']')[{{arg1}}]" parameterized="true"/>
5958
<element name="textAreaText" type="text" selector="(//div[@data-role='text'])[{{arg1}}][.='{{arg2}}']" parameterized="true"/>
60-
<element name="textAreaWidget" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//a[contains(@href,'{{arg2}}{{arg3}}')]" parameterized="true"/>
59+
<element name="textAreaWidget" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//a[contains(@href,'{{arg2}}{{arg3}}{{arg4}}')]" parameterized="true"/>
6160
<element name="textAreaVariable" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//a[contains(@href,'{{arg2}}{{arg3}}')]" parameterized="true"/>
6261
<element name="text" type="text" selector="(//div[@data-role='text'])[{{arg1}}]//*[contains(text(),'{{arg2}}')]" parameterized="true"/>
6362
<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
@@ -322,7 +322,7 @@
322322
<see userInput="{{PageBuilderTextContentTypeDefault.value}}" stepKey="seeTextContentType"/>
323323
<seeElement selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
324324
<seeElement selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
325-
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
325+
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, '', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
326326
</test>
327327
<test name="TextSaveEmptyTextContentType">
328328
<annotations>
@@ -1535,6 +1535,7 @@
15351535
</actionGroup>
15361536
<waitForElementVisible selector="{{TextOnConfiguration.insertImageButton}}" stepKey="waitForInsertImage"/>
15371537
<click selector="{{TextOnConfiguration.insertImageButton}}" stepKey="clickInsertImage"/>
1538+
<waitForPageLoad stepKey="waitForPageLoad"/>
15381539
<actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder">
15391540
<argument name="ImageFolder" value="ImageFolder"/>
15401541
</actionGroup>
@@ -1545,12 +1546,18 @@
15451546
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
15461547
<!-- Validate Stage -->
15471548
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1548-
<waitForElementVisible selector="{{TextOnStage.textAreaText('1', ImageUpload3.value)}}" stepKey="waitForRawImageSourceToAppearInTextarea"/>
1549+
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaValueBeforeSave">
1550+
<argument name="value" value="{{ImageUpload3.value}}"/>
1551+
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
1552+
</actionGroup>
15491553
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/>
15501554
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
15511555
<!-- Validate Stage After Save -->
15521556
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
1553-
<waitForElementVisible selector="{{TextOnStage.textAreaText('1', ImageUpload3.value)}}" stepKey="waitForRawImageSourceToAppearInTextarea2"/>
1557+
<actionGroup ref="assertTextareaContainsValue" stepKey="assertTextareaValueAfterSave">
1558+
<argument name="value" value="{{ImageUpload3.value}}"/>
1559+
<argument name="selector" value="{{TextOnStage.textArea('1')}}"/>
1560+
</actionGroup>
15541561
<!-- Validate Storefront -->
15551562
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
15561563
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
@@ -1639,9 +1646,6 @@
16391646
<group value="pagebuilder"/>
16401647
<group value="pagebuilder-text"/>
16411648
<group value="pagebuilder-customBeforeAfter"/>
1642-
<skip>
1643-
<issueId value="MC-3720"/>
1644-
</skip>
16451649
</annotations>
16461650
<before>
16471651
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -1674,7 +1678,11 @@
16741678
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
16751679
<!-- Validate Stage -->
16761680
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1677-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_WidgetCMSPageLink.editPanelValue)}}" stepKey="waitForTextStage"/>
1681+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue"/>
1682+
<assertContains stepKey="assertTextareaContainsValue">
1683+
<expectedResult type="string">{{PageBuilderTextArea_WidgetCMSPageLink.editPanelValue}}</expectedResult>
1684+
<actualResult type="variable">textareaValue</actualResult>
1685+
</assertContains>
16781686
<!-- Validate Edit Panel -->
16791687
<comment userInput="Validate Edit Panel" stepKey="commentValidateEditPanel"/>
16801688
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
@@ -1688,7 +1696,11 @@
16881696
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
16891697
<!-- Validate Stage After Save -->
16901698
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
1691-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_WidgetCMSPageLink.editPanelValue)}}" stepKey="waitForTextStage2"/>
1699+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue2"/>
1700+
<assertContains stepKey="assertTextareaContainsValue2">
1701+
<expectedResult type="string">{{PageBuilderTextArea_WidgetCMSPageLink.editPanelValue}}</expectedResult>
1702+
<actualResult type="variable">textareaValue2</actualResult>
1703+
</assertContains>
16921704
<!-- Validate Edit Panel -->
16931705
<comment userInput="Validate Edit Panel After Save" stepKey="commentValidateEditPanel2"/>
16941706
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage3">
@@ -1702,7 +1714,7 @@
17021714
</actionGroup>
17031715
<!-- Validate Storefront -->
17041716
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
1705-
<waitForElementVisible selector="{{TextOnStorefront.textAreaWidget('1', '{{_ENV.MAGENTO_BASE_URL}}', PageBuilderPageTitle.pageName)}}" stepKey="waitForTextStorefront"/>
1717+
<waitForElementVisible selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, 'text', PageBuilderPageTitle.pageName)}}" stepKey="waitForTextStorefront"/>
17061718
</test>
17071719
<test name="TextDisabledWYSIWYGAddVariable">
17081720
<annotations>
@@ -1747,7 +1759,11 @@
17471759
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
17481760
<!-- Validate Stage -->
17491761
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1750-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_VariableBaseURL.editPanelValue)}}" stepKey="waitForTextStage"/>
1762+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue1"/>
1763+
<assertContains stepKey="assertTextareaContainsValue1">
1764+
<expectedResult type="string">{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}</expectedResult>
1765+
<actualResult type="variable">textareaValue1</actualResult>
1766+
</assertContains>
17511767
<!-- Validate Edit Panel -->
17521768
<comment userInput="Validate Edit Panel" stepKey="commentValidateEditPanel"/>
17531769
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2">
@@ -1761,7 +1777,11 @@
17611777
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
17621778
<!-- Validate Stage After Save -->
17631779
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
1764-
<waitForElementVisible selector="{{TextOnStage.textAreaTextContains('1', PageBuilderTextArea_VariableBaseURL.editPanelValue)}}" stepKey="waitForTextStage2"/>
1780+
<executeJS function="return document.evaluate(&quot;{{TextOnStage.textArea('1')}}&quot;, document.body).iterateNext().value" stepKey="textareaValue2"/>
1781+
<assertContains stepKey="assertTextareaContainsValue2">
1782+
<expectedResult type="string">{{PageBuilderTextArea_VariableBaseURL.editPanelValue}}</expectedResult>
1783+
<actualResult type="variable">textareaValue2</actualResult>
1784+
</assertContains>
17651785
<!-- Validate Edit Panel -->
17661786
<comment userInput="Validate Edit Panel After Save" stepKey="commentValidateEditPanel2"/>
17671787
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage3">
@@ -1991,6 +2011,6 @@
19912011
<see userInput="{{PageBuilderTextContentTypeDefault.value}}" stepKey="seeTextContentType"/>
19922012
<seeElement selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
19932013
<seeElement selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
1994-
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
2014+
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', _ENV.MAGENTO_BASE_URL, '', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
19952015
</test>
19962016
</tests>

0 commit comments

Comments
 (0)