|
252 | 252 | <annotations>
|
253 | 253 | <description>Verifies that you cannot navigates to the Page Builder Templates grid page via direct url nor via the left nav menu.</description>
|
254 | 254 | </annotations>
|
| 255 | + <arguments> |
| 256 | + <argument name="pageHeading" defaultValue="Sorry, you need permissions to view this content." type="string"/> |
| 257 | + </arguments> |
255 | 258 | <amOnPage url="{{PageBuilderTemplatesGridPage.url}}" stepKey="goToPageBuilderTemplatesGridPage"/>
|
256 | 259 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
257 | 260 | <waitForElementVisible selector="{{PageBuilderTemplatesPage.pageTitle}}" stepKey="waitForPageTitle"/>
|
258 | 261 | <see userInput="Magento Admin" selector="{{PageBuilderTemplatesPage.pageTitle}}" stepKey="seePageTitle"/>
|
259 |
| - <see selector="{{AdminHeaderSection.pageHeading}}" userInput="Sorry, you need permissions to view this content." stepKey="seeErrorHeading"/> |
| 262 | + <see selector="{{AdminHeaderSection.pageHeading}}" userInput="{{pageHeading}}" stepKey="seeErrorHeading"/> |
260 | 263 | <waitForElementVisible selector="{{AdminMenuSection.content}}" stepKey="waitForContent"/>
|
261 | 264 | <click selector="{{AdminMenuSection.content}}" stepKey="clickContent"/>
|
262 | 265 | <waitForPageLoad stepKey="waitForMenu"/>
|
|
303 | 306 | <click selector="{{section.filters}}" stepKey="openFilters"/>
|
304 | 307 | <waitForElementVisible selector="{{section.templateIdFromFilter}}" stepKey="waitForTemplateIdFilter"/>
|
305 | 308 | <fillField selector="{{section.templateIdFromFilter}}" userInput="{{templateIdFrom}}" stepKey="fillTemplateIdFromFilter"/>
|
306 |
| - <fillField selector="{{section.templateIdFromFilter}}" userInput="{{templateIdTo}}" stepKey="fillTemplateIdToFilter"/> |
| 309 | + <fillField selector="{{section.templateIdToFilter}}" userInput="{{templateIdTo}}" stepKey="fillTemplateIdToFilter"/> |
307 | 310 | <waitForElementVisible selector="{{section.applyFilters}}" stepKey="waitForApplyFilters"/>
|
308 | 311 | <click selector="{{section.applyFilters}}" stepKey="clickApplyFilters"/>
|
309 | 312 | <waitForPageLoad stepKey="waitForFilterOnGrid"/>
|
|
528 | 531 | <click selector="{{section.previousPageButton}}" stepKey="clickPreviousPageButton"/>
|
529 | 532 | <waitForPageLoad stepKey="waitForPreviousPage"/>
|
530 | 533 | </actionGroup>
|
| 534 | + <actionGroup name="openPageBuilderTemplatePreviewImageModal"> |
| 535 | + <annotations> |
| 536 | + <description>Opens the template preview image modal from the template grid.</description> |
| 537 | + </annotations> |
| 538 | + <arguments> |
| 539 | + <argument name="templateName" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/> |
| 540 | + <argument name="section" defaultValue="PageBuilderTemplatesPageGrid"/> |
| 541 | + <argument name="rowIndex" defaultValue="1" type="string"/> |
| 542 | + </arguments> |
| 543 | + <waitForElementVisible selector="{{section.image(rowIndex)}}" stepKey="waitForPreviewImageInGrid"/> |
| 544 | + <click selector="{{section.image(rowIndex)}}" stepKey="clickPreviewImageInGrid"/> |
| 545 | + <waitForPageLoad stepKey="waitForModalLoad"/> |
| 546 | + <waitForElementVisible selector="{{PageBuilderPreviewImageModal.activeModal}}" stepKey="waitForModalVisible"/> |
| 547 | + <see userInput="{{templateName}}" selector="{{PageBuilderPreviewImageModal.title}}" stepKey="seeTitle"/> |
| 548 | + <waitForPageLoad stepKey="waitForPreviewLoad"/> |
| 549 | + </actionGroup> |
| 550 | + <actionGroup name="closePageBuilderTemplatePreviewImageModal"> |
| 551 | + <annotations> |
| 552 | + <description>Closes the template preview image modal.</description> |
| 553 | + </annotations> |
| 554 | + <arguments> |
| 555 | + <argument name="section" defaultValue="PageBuilderTemplatesPageGrid"/> |
| 556 | + </arguments> |
| 557 | + <waitForPageLoad stepKey="waitForModalLoad"/> |
| 558 | + <waitForElementVisible selector="{{PageBuilderPreviewImageModal.closeButton}}" stepKey="waitForCloseButton"/> |
| 559 | + <click selector="{{PageBuilderPreviewImageModal.closeButton}}" stepKey="clickCloseButton"/> |
| 560 | + <waitForPageLoad stepKey="waitForModalClose"/> |
| 561 | + <waitForElementNotVisible time="5" selector="{{PageBuilderPreviewImageModal.activeModal}}" stepKey="waitForModalNotVisible"/> |
| 562 | + <waitForElementVisible time="10" selector="{{section.grid}}" stepKey="waitForTemplateGridVisible"/> |
| 563 | + </actionGroup> |
| 564 | + <actionGroup name="validatePageBuilderTemplatePreviewImageModal"> |
| 565 | + <annotations> |
| 566 | + <description>Validate all buttons and the image on the template image preview modal.</description> |
| 567 | + </annotations> |
| 568 | + <arguments> |
| 569 | + <argument name="templateName" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/> |
| 570 | + </arguments> |
| 571 | + <waitForPageLoad stepKey="waitForModalLoad"/> |
| 572 | + <waitForElementVisible selector="{{PageBuilderPreviewImageModal.image}}" stepKey="waitForImageLoad"/> |
| 573 | + <see userInput="{{templateName}}" selector="{{PageBuilderPreviewImageModal.title}}" stepKey="seeTitle"/> |
| 574 | + <seeElement selector="{{PageBuilderPreviewImageModal.closeButton}}" stepKey="seeCloseButton"/> |
| 575 | + <executeJS function="return document.evaluate("{{PageBuilderPreviewImageModal.image}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.naturalHeight" stepKey="screenshotNaturalHeight"/> |
| 576 | + <executeJS function="return document.evaluate("{{PageBuilderPreviewImageModal.image}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.naturalWidth" stepKey="screenshotNaturalWidth"/> |
| 577 | + <assertGreaterThan stepKey="assertNaturalHeightGreaterThanZero"> |
| 578 | + <expectedResult type="int">0</expectedResult> |
| 579 | + <actualResult type="variable">screenshotNaturalHeight</actualResult> |
| 580 | + </assertGreaterThan> |
| 581 | + <assertGreaterThan stepKey="assertNaturalWidthGreaterThanZero"> |
| 582 | + <expectedResult type="int">0</expectedResult> |
| 583 | + <actualResult type="variable">screenshotNaturalWidth</actualResult> |
| 584 | + </assertGreaterThan> |
| 585 | + </actionGroup> |
531 | 586 | </actionGroups>
|
0 commit comments