|
16 | 16 | <see userInput="Save Content as Template" selector="{{PageBuilderSaveTemplateModal.title}}" stepKey="seeTitle"/>
|
17 | 17 | <waitForPageLoad stepKey="waitForPreviewLoad"/>
|
18 | 18 | </actionGroup>
|
| 19 | + <actionGroup name="closePageBuilderSaveTemplateModal"> |
| 20 | + <arguments> |
| 21 | + <argument name="baseContent" defaultValue="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" type="string"/> |
| 22 | + </arguments> |
| 23 | + <waitForPageLoad stepKey="waitForModalLoad"/> |
| 24 | + <waitForElementVisible selector="{{PageBuilderSaveTemplateModal.closeButton}}" stepKey="waitForCloseButton"/> |
| 25 | + <click selector="{{PageBuilderSaveTemplateModal.closeButton}}" stepKey="clickCloseButton"/> |
| 26 | + <waitForPageLoad stepKey="waitForModalClose"/> |
| 27 | + <waitForElementNotVisible time="5" selector="{{PageBuilderSaveTemplateModal.activeModal}}" stepKey="waitForModalNotVisible"/> |
| 28 | + <waitForElementVisible time="10" selector="{{baseContent}}" stepKey="waitForContentUnderModalVisible"/> |
| 29 | + </actionGroup> |
19 | 30 | <actionGroup name="fillPageBuilderSaveTemplateForm">
|
20 | 31 | <arguments>
|
21 | 32 | <argument name="templateName" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/>
|
|
27 | 38 | <waitForElement selector="{{PageBuilderSaveTemplateModal.createdForSelect}}" stepKey="waitForCreatedFor"/>
|
28 | 39 | <selectOption userInput="{{createdFor}}" selector="{{PageBuilderSaveTemplateModal.createdForSelect}}" stepKey="selectCreatedFor"/>
|
29 | 40 | </actionGroup>
|
30 |
| - <actionGroup name="validatePageBuilderSaveTemplateModal"> |
31 |
| - <waitForPageLoad stepKey="waitForModalLoad"/> |
32 |
| - <see userInput="Save Content as Template" selector="{{PageBuilderSaveTemplateModal.title}}" stepKey="seeTitle"/> |
33 |
| - <seeElement selector="{{PageBuilderSaveTemplateModal.closeButton}}" stepKey="seeCloseButton"/> |
34 |
| - <seeElement selector="{{PageBuilderSaveTemplateModal.previewImage}}" stepKey="seePreview"/> |
35 |
| -<!-- todo: validate preview image not error --> |
36 |
| - <seeElement selector="{{PageBuilderSaveTemplateModal.templateNameInput}}" stepKey="seeTemplateNameInput"/> |
37 |
| - <seeElement selector="{{PageBuilderSaveTemplateModal.createdForSelect}}" stepKey="seeCreatedForSelect"/> |
38 |
| - <see userInput="Created For is to help with filtering templates. This does not restrict where this template can be used." selector="{{PageBuilderSaveTemplateModal.createdForHelperText}}" stepKey="seeCreatedForHelperText"/> |
39 |
| - <seeElement selector="{{PageBuilderSaveTemplateModal.saveButton}}" stepKey="seeSaveButton"/> |
40 |
| - <seeElement selector="{{PageBuilderSaveTemplateModal.cancelButton}}" stepKey="seeCancelButton"/> |
41 |
| - </actionGroup> |
42 | 41 | <actionGroup name="clickSaveOnPageBuilderSaveTemplateModal">
|
43 | 42 | <waitForPageLoad stepKey="waitForModalLoad"/>
|
44 | 43 | <waitForElement selector="{{PageBuilderSaveTemplateModal.saveButton}}" stepKey="waitForSaveButton"/>
|
45 | 44 | <click selector="{{PageBuilderSaveTemplateModal.saveButton}}" stepKey="clickSaveButton"/>
|
46 | 45 | <waitForPageLoad stepKey="waitForModalClose"/>
|
47 | 46 | <waitForElementVisible selector="{{PageBuilderSaveTemplateConfirmationModal.modal}}" stepKey="waitForConfirmationModal"/>
|
48 | 47 | </actionGroup>
|
49 |
| - <actionGroup name="validatePageBuilderSaveTemplateConfirmationModal"> |
50 |
| - <waitForPageLoad stepKey="waitForModalLoad"/> |
51 |
| - <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.title}}" stepKey="seeTitle"/> |
52 |
| - <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.closeButton}}" stepKey="seeCloseButton"/> |
53 |
| - <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.message}}" stepKey="seeMessage"/> |
54 |
| - <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.okButton}}" stepKey="seeOKButton"/> |
55 |
| - </actionGroup> |
56 | 48 | <actionGroup name="savePageBuilderTemplate">
|
57 | 49 | <arguments>
|
58 | 50 | <argument name="baseContent" defaultValue="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" type="string"/>
|
|
67 | 59 | <waitForElementNotVisible time="5" selector="{{PageBuilderSaveTemplateConfirmationModal.modal}}" stepKey="waitForModalNotVisible"/>
|
68 | 60 | <waitForElementVisible time="10" selector="{{baseContent}}" stepKey="waitForContentUnderModalVisible"/>
|
69 | 61 | </actionGroup>
|
70 |
| - <actionGroup name="closePageBuilderSaveTemplateModal"> |
71 |
| - <arguments> |
72 |
| - <argument name="baseContent" defaultValue="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" type="string"/> |
73 |
| - </arguments> |
| 62 | + <actionGroup name="validatePageBuilderSaveTemplateModal"> |
74 | 63 | <waitForPageLoad stepKey="waitForModalLoad"/>
|
75 |
| - <waitForElementVisible selector="{{PageBuilderSaveTemplateModal.closeButton}}" stepKey="waitForCloseButton"/> |
76 |
| - <click selector="{{PageBuilderSaveTemplateModal.closeButton}}" stepKey="clickCloseButton"/> |
77 |
| - <waitForPageLoad stepKey="waitForModalClose"/> |
78 |
| - <waitForElementNotVisible time="5" selector="{{PageBuilderSaveTemplateModal.activeModal}}" stepKey="waitForModalNotVisible"/> |
79 |
| - <waitForElementVisible time="10" selector="{{baseContent}}" stepKey="waitForContentUnderModalVisible"/> |
| 64 | + <see userInput="Save Content as Template" selector="{{PageBuilderSaveTemplateModal.title}}" stepKey="seeTitle"/> |
| 65 | + <seeElement selector="{{PageBuilderSaveTemplateModal.closeButton}}" stepKey="seeCloseButton"/> |
| 66 | + <seeElement selector="{{PageBuilderSaveTemplateModal.previewImage}}" stepKey="seePreview"/> |
| 67 | + <executeJS function="return document.evaluate("{{PageBuilderSaveTemplateModal.previewImage}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.naturalHeight" stepKey="screenshotNaturalHeight"/> |
| 68 | + <executeJS function="return document.evaluate("{{PageBuilderSaveTemplateModal.previewImage}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.naturalWidth" stepKey="screenshotNaturalWidth"/> |
| 69 | + <assertGreaterThan stepKey="assertNaturalHeightGreaterThanZero"> |
| 70 | + <expectedResult type="int">0</expectedResult> |
| 71 | + <actualResult type="variable">screenshotNaturalHeight</actualResult> |
| 72 | + </assertGreaterThan> |
| 73 | + <assertGreaterThan stepKey="assertNaturalWidthGreaterThanZero"> |
| 74 | + <expectedResult type="int">0</expectedResult> |
| 75 | + <actualResult type="variable">screenshotNaturalWidth</actualResult> |
| 76 | + </assertGreaterThan> |
| 77 | + <seeElement selector="{{PageBuilderSaveTemplateModal.templateNameInput}}" stepKey="seeTemplateNameInput"/> |
| 78 | + <seeElement selector="{{PageBuilderSaveTemplateModal.createdForSelect}}" stepKey="seeCreatedForSelect"/> |
| 79 | + <see userInput="Created For is to help with filtering templates. This does not restrict where this template can be used." selector="{{PageBuilderSaveTemplateModal.createdForHelperText}}" stepKey="seeCreatedForHelperText"/> |
| 80 | + <seeElement selector="{{PageBuilderSaveTemplateModal.saveButton}}" stepKey="seeSaveButton"/> |
| 81 | + <seeElement selector="{{PageBuilderSaveTemplateModal.cancelButton}}" stepKey="seeCancelButton"/> |
| 82 | + </actionGroup> |
| 83 | + <actionGroup name="validatePageBuilderSaveTemplateConfirmationModal"> |
| 84 | + <waitForPageLoad stepKey="waitForModalLoad"/> |
| 85 | + <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.title}}" stepKey="seeTitle"/> |
| 86 | + <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.closeButton}}" stepKey="seeCloseButton"/> |
| 87 | + <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.message}}" stepKey="seeMessage"/> |
| 88 | + <seeElement selector="{{PageBuilderSaveTemplateConfirmationModal.okButton}}" stepKey="seeOKButton"/> |
80 | 89 | </actionGroup>
|
81 | 90 | <actionGroup name="openPageBuilderApplyTemplateSlideOut">
|
82 | 91 | <waitForElementVisible selector="{{PageBuilderStage.applyTemplateButton}}" stepKey="waitForApplyTemplateButton"/>
|
|
86 | 95 | <see userInput="Apply Template" selector="{{PageBuilderApplyTemplateSlideOut.title}}" stepKey="seeTitle"/>
|
87 | 96 | <waitForPageLoad stepKey="waitForSlideOutForm"/>
|
88 | 97 | </actionGroup>
|
| 98 | + <actionGroup name="closePageBuilderApplyTemplateSlideOut"> |
| 99 | + <arguments> |
| 100 | + <argument name="baseContent" defaultValue="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" type="string"/> |
| 101 | + </arguments> |
| 102 | + <waitForPageLoad stepKey="waitForSlideOutLoad"/> |
| 103 | + <waitForElementVisible selector="{{PageBuilderApplyTemplateSlideOut.closeButton}}" stepKey="waitForCloseButton"/> |
| 104 | + <click selector="{{PageBuilderApplyTemplateSlideOut.closeButton}}" stepKey="clickCloseButton"/> |
| 105 | + <waitForPageLoad stepKey="waitForSlideOutClose"/> |
| 106 | + <waitForElementNotVisible time="5" selector="{{PageBuilderApplyTemplateSlideOut.slideOut}}" stepKey="waitForSlideOutNotVisible"/> |
| 107 | + <waitForElementVisible time="10" selector="{{baseContent}}" stepKey="waitForContentUnderSlideOutVisible"/> |
| 108 | + </actionGroup> |
89 | 109 | <actionGroup name="clickApplyFromPageBuilderApplyTemplateSlideOut">
|
90 | 110 | <arguments>
|
91 | 111 | <argument name="templateIdentifier" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/>
|
|
102 | 122 | <waitForElementNotVisible time="5" selector="{{PageBuilderApplyTemplateSlideOut.slideOut}}" stepKey="waitForSlideOutNotVisible" after="waitForPageLoad2"/>
|
103 | 123 | <waitForElementVisible time="10" selector="{{baseContent}}" stepKey="waitForContentUnderSlideOutVisible" after="waitForSlideOutNotVisible"/>
|
104 | 124 | </actionGroup>
|
105 |
| - <actionGroup name="closePageBuilderApplyTemplateSlideOut"> |
106 |
| - <arguments> |
107 |
| - <argument name="baseContent" defaultValue="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" type="string"/> |
108 |
| - </arguments> |
109 |
| - <waitForPageLoad stepKey="waitForSlideOutLoad"/> |
110 |
| - <waitForElementVisible selector="{{PageBuilderApplyTemplateSlideOut.closeButton}}" stepKey="waitForCloseButton"/> |
111 |
| - <click selector="{{PageBuilderApplyTemplateSlideOut.closeButton}}" stepKey="clickCloseButton"/> |
112 |
| - <waitForPageLoad stepKey="waitForSlideOutClose"/> |
113 |
| - <waitForElementNotVisible time="5" selector="{{PageBuilderApplyTemplateSlideOut.slideOut}}" stepKey="waitForSlideOutNotVisible"/> |
114 |
| - <waitForElementVisible time="10" selector="{{baseContent}}" stepKey="waitForContentUnderSlideOutVisible"/> |
| 125 | + <actionGroup name="verifyNoPageBuilderSaveOrApplyTemplateButtons"> |
| 126 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 127 | + <dontSeeElementInDOM selector="{{PageBuilderStage.saveAsTemplateButton}}" stepKey="dontSeeSaveAsTemplateButton"/> |
| 128 | + <dontSeeElementInDOM selector="{{PageBuilderStage.applyTemplateButton}}" stepKey="dontSeeApplyTemplateButton"/> |
115 | 129 | </actionGroup>
|
116 | 130 | <actionGroup name="navigateToPageBuilderTemplatesGridPage">
|
117 | 131 | <amOnPage url="{{PageBuilderTemplatesGridPage.url}}" stepKey="goToPageBuilderTemplatesGridPage"/>
|
118 | 132 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
119 | 133 | <waitForElementVisible selector="{{PageBuilderTemplatePageGrid.pageTitle}}" stepKey="waitForPageTitle"/>
|
120 | 134 | <see userInput="Templates" selector="{{PageBuilderTemplatePageGrid.pageTitle}}" stepKey="seePageTitle"/>
|
121 | 135 | </actionGroup>
|
122 |
| - <actionGroup name="deletePageBuilderTemplate"> |
123 |
| - <arguments> |
124 |
| - <argument name="templateIdentifier" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/> |
125 |
| - </arguments> |
| 136 | + <actionGroup name="verifyCannotNavigateToPageBuilderTemplatesGridPage"> |
| 137 | + <amOnPage url="{{PageBuilderTemplatesGridPage.url}}" stepKey="goToPageBuilderTemplatesGridPage"/> |
126 | 138 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
127 |
| - <waitForElementVisible selector="{{PageBuilderTemplatePageGrid.deleteButton(templateIdentifier)}}" stepKey="waitForDeleteButton"/> |
128 |
| - <click selector="{{PageBuilderTemplatePageGrid.deleteButton(templateIdentifier)}}" stepKey="clickDeleteButton"/> |
129 |
| - <waitForPageLoad stepKey="waitForConfirmationModalLoad"/> |
130 |
| - <waitForElementVisible selector="{{PageBuilderDeleteTemplateConfirmationModal.modal}}" stepKey="waitForConfirmationModalVisible"/> |
131 |
| - <waitForElementVisible selector="{{PageBuilderDeleteTemplateConfirmationModal.okButton}}" stepKey="waitForConfirmationModalOKButton"/> |
132 |
| - <click selector="{{PageBuilderDeleteTemplateConfirmationModal.okButton}}" stepKey="clickConfirmationModalOKButton"/> |
133 |
| - <waitForPageLoad stepKey="waitForDelete"/> |
134 |
| - <see userInput="Template successfully deleted." stepKey="seeSuccessMessage"/> |
| 139 | + <waitForElementVisible selector="{{PageBuilderTemplatePageGrid.pageTitle}}" stepKey="waitForPageTitle"/> |
| 140 | + <see userInput="Magento Admin" selector="{{PageBuilderTemplatePageGrid.pageTitle}}" stepKey="seePageTitle"/> |
| 141 | + <see selector="{{AdminHeaderSection.pageHeading}}" userInput="Sorry, you need permissions to view this content." stepKey="seeErrorMessage"/> |
| 142 | + <waitForElementVisible selector="{{AdminMenuSection.content}}" stepKey="waitForContent"/> |
| 143 | + <click selector="{{AdminMenuSection.content}}" stepKey="clickContent"/> |
| 144 | + <waitForPageLoad stepKey="waitForMenu"/> |
| 145 | + <seeElement selector="{{AdminMenuSection.menuItem('magento-backend-content-elements')}}" stepKey="seeElementsSection"/> |
| 146 | + <see userInput="Pages" selector="{{AdminMenuSection.menuItem('magento-backend-content-elements')}}" stepKey="seeTemplates"/> |
| 147 | + <dontSee userInput="Templates" selector="{{AdminMenuSection.menuItem('magento-backend-content-elements')}}" stepKey="dontSeeTemplates"/> |
135 | 148 | </actionGroup>
|
136 | 149 | <actionGroup name="filterPageBuilderTemplateGrid">
|
137 | 150 | <arguments>
|
|
153 | 166 | <waitForPageLoad stepKey="waitForClearFilters"/>
|
154 | 167 | <dontSeeElement selector="{{PageBuilderTemplateGridFilter.clearFilters}}" stepKey="dontSeeClearFilters"/>
|
155 | 168 | </actionGroup>
|
| 169 | + <actionGroup name="validatePageBuilderTemplateDataInGrid"> |
| 170 | + <arguments> |
| 171 | + <argument name="section" defaultValue="PageBuilderTemplatePageGrid"/> |
| 172 | + <argument name="templateName" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/> |
| 173 | + <argument name="createdFor" defaultValue="{{PageBuilderTemplateCreatedFor.any}}" type="string"/> |
| 174 | + <argument name="createdDate" defaultValue="" type="string"/> |
| 175 | + <argument name="rowIndex" defaultValue="1" type="string"/> |
| 176 | + </arguments> |
| 177 | + <waitForPageLoad stepKey="waitForGridLoad"/> |
| 178 | + <grabTextFrom selector="{{section.templateId(rowIndex)}}" stepKey="grabTemplateId"/> |
| 179 | + <assertGreaterThan stepKey="assertGreaterThanZero"> |
| 180 | + <expectedResult type="int">0</expectedResult> |
| 181 | + <actualResult type="variable">grabTemplateId</actualResult> |
| 182 | + </assertGreaterThan> |
| 183 | + <seeElement selector="{{section.image(rowIndex)}}" stepKey="seeImage"/> |
| 184 | + <executeJS function="return document.evaluate("{{section.image(rowIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.naturalHeight" stepKey="screenshotNaturalHeight"/> |
| 185 | + <executeJS function="return document.evaluate("{{section.image(rowIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.naturalWidth" stepKey="screenshotNaturalWidth"/> |
| 186 | + <assertGreaterThan stepKey="assertNaturalHeightGreaterThanZero"> |
| 187 | + <expectedResult type="int">0</expectedResult> |
| 188 | + <actualResult type="variable">screenshotNaturalHeight</actualResult> |
| 189 | + </assertGreaterThan> |
| 190 | + <assertGreaterThan stepKey="assertNaturalWidthGreaterThanZero"> |
| 191 | + <expectedResult type="int">0</expectedResult> |
| 192 | + <actualResult type="variable">screenshotNaturalWidth</actualResult> |
| 193 | + </assertGreaterThan> |
| 194 | + <see userInput="{{templateName}}" selector="{{section.templateName(rowIndex)}}" stepKey="seeTemplateName"/> |
| 195 | +<!-- <see userInput="{{createdFor}}" selector="{{section.createdFor(rowIndex)}}" stepKey="seeCreatedFor"/>--> |
| 196 | +<!-- <see userInput="{{createdDate}}" selector="{{section.createdDate(rowIndex)}}" stepKey="seeCreatedDate"/>--> |
| 197 | + </actionGroup> |
| 198 | + <actionGroup name="validatePageBuilderTemplateEmptyGrid"> |
| 199 | + <arguments> |
| 200 | + <argument name="section" defaultValue="PageBuilderTemplatePageGrid"/> |
| 201 | + </arguments> |
| 202 | + <waitForPageLoad stepKey="waitForGridLoad"/> |
| 203 | + <waitForElementVisible selector="{{section.emptyGrid}}" stepKey="waitForEmptyGrid"/> |
| 204 | + <see userInput="We couldn't find any records." selector="{{section.emptyGrid}}" stepKey="seeEmptyGridMessage"/> |
| 205 | + </actionGroup> |
| 206 | + <actionGroup name="deletePageBuilderTemplate"> |
| 207 | + <arguments> |
| 208 | + <argument name="templateIdentifier" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/> |
| 209 | + </arguments> |
| 210 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 211 | + <waitForElementVisible selector="{{PageBuilderTemplatePageGrid.deleteButton(templateIdentifier)}}" stepKey="waitForDeleteButton"/> |
| 212 | + <click selector="{{PageBuilderTemplatePageGrid.deleteButton(templateIdentifier)}}" stepKey="clickDeleteButton"/> |
| 213 | + <waitForPageLoad stepKey="waitForConfirmationModalLoad"/> |
| 214 | + <waitForElementVisible selector="{{PageBuilderDeleteTemplateConfirmationModal.modal}}" stepKey="waitForConfirmationModalVisible"/> |
| 215 | + <waitForElementVisible selector="{{PageBuilderDeleteTemplateConfirmationModal.okButton}}" stepKey="waitForConfirmationModalOKButton"/> |
| 216 | + <click selector="{{PageBuilderDeleteTemplateConfirmationModal.okButton}}" stepKey="clickConfirmationModalOKButton"/> |
| 217 | + <waitForPageLoad stepKey="waitForDelete"/> |
| 218 | + <see userInput="Template successfully deleted." stepKey="seeSuccessMessage"/> |
| 219 | + </actionGroup> |
| 220 | + <actionGroup name="verifyNoPageBuilderDeleteTemplateButton"> |
| 221 | + <arguments> |
| 222 | + <argument name="templateIdentifier" defaultValue="{{PageBuilderTemplateNameRandom.name}}" type="string"/> |
| 223 | + </arguments> |
| 224 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 225 | + <waitForElementVisible selector="{{PageBuilderTemplatePageGrid.templateName('1')}}" stepKey="waitForTemplateName"/> |
| 226 | + <see userInput="{{templateIdentifier}}" selector="{{PageBuilderTemplatePageGrid.templateName('1')}}" stepKey="seeTemplateName"/> |
| 227 | + <dontSeeElementInDOM selector="{{PageBuilderTemplatePageGrid.deleteButton(templateIdentifier)}}" stepKey="dontSeeDeleteTemplateButton"/> |
| 228 | + </actionGroup> |
156 | 229 | <!-- todo: search by keyword in grid-->
|
157 |
| -<!-- todo: actiongroup descriptions--> |
| 230 | + <!-- todo: actiongroup descriptions--> |
158 | 231 | </actionGroups>
|
0 commit comments