|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * ADOBE CONFIDENTIAL |
| 5 | + * |
| 6 | + * Copyright 2025 Adobe |
| 7 | + * All Rights Reserved. |
| 8 | + * |
| 9 | + * NOTICE: All information contained herein is, and remains |
| 10 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 11 | + * and technical concepts contained herein are proprietary to Adobe |
| 12 | + * and its suppliers and are protected by all applicable intellectual |
| 13 | + * property laws, including trade secret and copyright laws. |
| 14 | + * Dissemination of this information or reproduction of this material |
| 15 | + * is strictly forbidden unless prior written permission is obtained |
| 16 | + * from Adobe. |
| 17 | + */ |
| 18 | +--> |
| 19 | + |
| 20 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 21 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 22 | + <test name="AdminEditCMSBlockScheduledUpdateComprehensiveTest"> |
| 23 | + <annotations> |
| 24 | + <features value="CmsStaging"/> |
| 25 | + <stories value="CMS Block Scheduled Update Management"/> |
| 26 | + <title value="Admin can edit CMS block scheduled updates and verify changes across dashboard and storefront"/> |
| 27 | + <description value="Verify complete workflow of creating, editing, and validating CMS block scheduled updates including staging dashboard verification and storefront validation"/> |
| 28 | + <severity value="CRITICAL"/> |
| 29 | + <testCaseId value="MAGETWO-25578"/> |
| 30 | + <group value="cms_staging"/> |
| 31 | + <group value="staging"/> |
| 32 | + <group value="cms_block"/> |
| 33 | + </annotations> |
| 34 | + |
| 35 | + <before> |
| 36 | + <!-- Create CMS block A1 --> |
| 37 | + <createData entity="ActiveTestBlock" stepKey="createCmsBlockA1"> |
| 38 | + <field key="identifier">cms_block_a1_{{_unique}}</field> |
| 39 | + <field key="title">CMS Block A1</field> |
| 40 | + <field key="content">Original CMS Block A1 Content</field> |
| 41 | + </createData> |
| 42 | + |
| 43 | + <!-- Login as admin first for widget creation --> |
| 44 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 45 | + |
| 46 | + <!-- Create CMS Static Block widget for home page display --> |
| 47 | + <actionGroup ref="AdminCreateWidgetWithBlockActionGroup" stepKey="createCmsBlockWidget"> |
| 48 | + <argument name="widget" value="WidgetWithBlock"/> |
| 49 | + <argument name="block" value="$createCmsBlockA1.identifier$"/> |
| 50 | + </actionGroup> |
| 51 | + </before> |
| 52 | + |
| 53 | + <after> |
| 54 | + <!-- Clean up created data --> |
| 55 | + <!-- Delete widget --> |
| 56 | + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidget"> |
| 57 | + <argument name="widget" value="WidgetWithBlock"/> |
| 58 | + </actionGroup> |
| 59 | + |
| 60 | + <!-- Delete CMS block --> |
| 61 | + <deleteData createDataKey="createCmsBlockA1" stepKey="deleteCmsBlockA1"/> |
| 62 | + |
| 63 | + <!-- Logout from admin --> |
| 64 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 65 | + </after> |
| 66 | + |
| 67 | + <!-- Step 1: Log in to Admin (Already done in before section) --> |
| 68 | + |
| 69 | + <!-- Step 2: Go to Content > Blocks page --> |
| 70 | + <actionGroup ref="AdminOpenCmsBlocksGridActionGroup" stepKey="goToContentBlocksPage"/> |
| 71 | + <waitForPageLoad stepKey="waitForBlocksPageLoad"/> |
| 72 | + |
| 73 | + <!-- Step 3: Open CMS block A1 to edit --> |
| 74 | + <actionGroup ref="AdminOpenCmsBlockActionGroup" stepKey="openCmsBlockA1ToEdit"> |
| 75 | + <argument name="block_id" value="$createCmsBlockA1.id$"/> |
| 76 | + </actionGroup> |
| 77 | + <waitForPageLoad stepKey="waitForBlockEditPageLoad"/> |
| 78 | + |
| 79 | + <!-- Step 4: Click Schedule New Update --> |
| 80 | + <waitForElementClickable selector="{{AdminStagingSlideOutSection.scheduleNewUpdateBtn}}" stepKey="waitForScheduleNewUpdateButton"/> |
| 81 | + <click selector="{{AdminStagingSlideOutSection.scheduleNewUpdateBtn}}" stepKey="clickScheduleNewUpdate"/> |
| 82 | + <waitForElementVisible selector="{{AdminStagingSlideOutSection.updateName}}" stepKey="waitForUpdateFormVisible"/> |
| 83 | + |
| 84 | + <!-- Step 5: Click Save as a New Update, fill name and set future date --> |
| 85 | + <fillField selector="{{AdminStagingSlideOutSection.updateName}}" userInput="CMS Block A1 Scheduled Update" stepKey="fillUpdateName"/> |
| 86 | + <fillField selector="{{AdminStagingSlideOutSection.updateDescription}}" userInput="Scheduled update for CMS Block A1 testing" stepKey="fillUpdateDescription"/> |
| 87 | + <generateDate date="+1 day" format="m/d/Y g:i A" stepKey="generateFutureStartDate"/> |
| 88 | + <fillField selector="{{AdminStagingSlideOutSection.startDate}}" userInput="{$generateFutureStartDate}" stepKey="fillStartDate"/> |
| 89 | + <generateDate date="+1 week" format="m/d/Y g:i A" stepKey="generateFutureEndDate"/> |
| 90 | + <fillField selector="{{AdminStagingSlideOutSection.endDate}}" userInput="{$generateFutureEndDate}" stepKey="fillEndDate"/> |
| 91 | + |
| 92 | + <!-- Step 6: Save --> |
| 93 | + <click selector="{{AdminStagingSlideOutSection.save}}" stepKey="saveScheduledUpdate"/> |
| 94 | + <waitForPageLoad stepKey="waitForUpdateSave"/> |
| 95 | + |
| 96 | + |
| 97 | + <!-- Step 7: Click View/Edit in Scheduled Changes grid near created update --> |
| 98 | + <waitForElementVisible selector="{{AdminScheduledChangesSection.scheduleActions('CMS Block A1 Scheduled Update', 'View/Edit')}}" stepKey="waitForViewEditLink"/> |
| 99 | + <click selector="{{AdminScheduledChangesSection.scheduleActions('CMS Block A1 Scheduled Update', 'View/Edit')}}" stepKey="clickViewEditLink"/> |
| 100 | + <waitForPageLoad stepKey="waitForEditUpdatePageLoad"/> |
| 101 | + |
| 102 | + <!-- Step 8: Change block update fields and save update --> |
| 103 | + <!-- 8.1: Test changing start date --> |
| 104 | + <generateDate date="+2 days" format="m/d/Y g:i A" stepKey="generateNewStartDate"/> |
| 105 | + <clearField selector="{{AdminStagingSlideOutSection.startDate}}" stepKey="clearStartDateField"/> |
| 106 | + <fillField selector="{{AdminStagingSlideOutSection.startDate}}" userInput="{$generateNewStartDate}" stepKey="fillNewStartDate"/> |
| 107 | + |
| 108 | + <!-- 8.2: Test changing end date --> |
| 109 | + <generateDate date="+2 weeks" format="m/d/Y g:i A" stepKey="generateNewEndDate"/> |
| 110 | + <clearField selector="{{AdminStagingSlideOutSection.endDate}}" stepKey="clearEndDateField"/> |
| 111 | + <fillField selector="{{AdminStagingSlideOutSection.endDate}}" userInput="{$generateNewEndDate}" stepKey="fillNewEndDate"/> |
| 112 | + |
| 113 | + <!-- 8.3: Test changing both dates together --> |
| 114 | + <generateDate date="+3 days" format="m/d/Y g:i A" stepKey="generateBothStartDate"/> |
| 115 | + <generateDate date="+3 weeks" format="m/d/Y g:i A" stepKey="generateBothEndDate"/> |
| 116 | + <clearField selector="{{AdminStagingSlideOutSection.startDate}}" stepKey="clearBothStartDate"/> |
| 117 | + <fillField selector="{{AdminStagingSlideOutSection.startDate}}" userInput="{$generateBothStartDate}" stepKey="fillBothStartDate"/> |
| 118 | + <clearField selector="{{AdminStagingSlideOutSection.endDate}}" stepKey="clearBothEndDate"/> |
| 119 | + <fillField selector="{{AdminStagingSlideOutSection.endDate}}" userInput="{$generateBothEndDate}" stepKey="fillBothEndDate"/> |
| 120 | + |
| 121 | + <!-- 8.4: Test clearing start date --> |
| 122 | + <clearField selector="{{AdminStagingSlideOutSection.startDate}}" stepKey="clearStartDateToEmpty"/> |
| 123 | + |
| 124 | + <!-- 8.5: Test clearing end date --> |
| 125 | + <clearField selector="{{AdminStagingSlideOutSection.endDate}}" stepKey="clearEndDateToEmpty"/> |
| 126 | + |
| 127 | + <!-- 8.6: Test changing block title --> |
| 128 | + <clearField selector="{{AdminCreateNewBlockSection.blockTitle}}" stepKey="clearBlockTitle"/> |
| 129 | + <fillField selector="{{AdminCreateNewBlockSection.blockTitle}}" userInput="Updated CMS Block A1 Title" stepKey="changeBlockTitle"/> |
| 130 | + |
| 131 | + <!-- 8.7: Test changing identifier --> |
| 132 | + <clearField selector="{{AdminCreateNewBlockSection.identifier}}" stepKey="clearBlockIdentifier"/> |
| 133 | + <fillField selector="{{AdminCreateNewBlockSection.identifier}}" userInput="updated_cms_block_a1_{{_unique}}" stepKey="changeBlockIdentifier"/> |
| 134 | + |
| 135 | + <!-- 8.8: Test adding different content --> |
| 136 | + <clearField selector="{{AdminCreateNewBlockSection.content}}" stepKey="clearBlockContent"/> |
| 137 | + <fillField selector="{{AdminCreateNewBlockSection.content}}" userInput="Updated CMS Block A1 Content for Staging Test" stepKey="changeBlockContent"/> |
| 138 | + |
| 139 | + <!-- 8.9: Test enable/disable page --> |
| 140 | + <click selector="{{AdminCreateNewBlockSection.isEnabled}}" stepKey="toggleBlockStatus"/> |
| 141 | + |
| 142 | + <!-- 8.10: Test design layout --> |
| 143 | + <click selector="{{CmsDesignSection.DesignTab}}" stepKey="clickDesignTab"/> |
| 144 | + <waitForElementVisible selector="{{CmsDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropdown"/> |
| 145 | + <selectOption selector="{{CmsDesignSection.LayoutDropdown}}" userInput="2columns-left" stepKey="changeDesignLayout"/> |
| 146 | + |
| 147 | + <!-- Test changing update name --> |
| 148 | + <clearField selector="{{AdminStagingSlideOutSection.updateName}}" stepKey="clearUpdateName"/> |
| 149 | + <fillField selector="{{AdminStagingSlideOutSection.updateName}}" userInput="Updated CMS Block A1 Scheduled Update" stepKey="fillNewUpdateName"/> |
| 150 | + |
| 151 | + <!-- Test changing description --> |
| 152 | + <clearField selector="{{AdminStagingSlideOutSection.updateDescription}}" stepKey="clearUpdateDescription"/> |
| 153 | + <fillField selector="{{AdminStagingSlideOutSection.updateDescription}}" userInput="Modified scheduled update for CMS Block A1 testing" stepKey="fillNewUpdateDescription"/> |
| 154 | + |
| 155 | + <!-- Save the updated scheduled update --> |
| 156 | + <click selector="{{AdminStagingSlideOutSection.save}}" stepKey="saveUpdatedScheduledUpdate"/> |
| 157 | + <waitForPageLoad stepKey="waitForUpdatedSave"/> |
| 158 | + <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the scheduled update." stepKey="seeUpdatedSuccessMessage"/> |
| 159 | + |
| 160 | + |
| 161 | + <!-- Verify update is visible in Scheduled Changes grid with updated details --> |
| 162 | + <waitForText selector="{{AdminScheduledChangesSection.scheduleDetails('Updated CMS Block A1 Scheduled Update')}}" userInput="Updated CMS Block A1 Scheduled Update" stepKey="seeUpdatedNameInGrid"/> |
| 163 | + <waitForText selector="{{AdminScheduledChangesSection.scheduleViewEdit('Updated CMS Block A1 Scheduled Update')}}" userInput="View/Edit" stepKey="seeViewEditLinkInGrid"/> |
| 164 | + <waitForText selector="{{AdminScheduledChangesSection.scheduleActions('Updated CMS Block A1 Scheduled Update', 'Preview')}}" userInput="Preview" stepKey="seePreviewLinkInGrid"/> |
| 165 | + |
| 166 | + <!-- Step 9: Click Preview link near created update --> |
| 167 | + <waitForElementClickable selector="{{AdminScheduledChangesSection.scheduleActions('Updated CMS Block A1 Scheduled Update', 'Preview')}}" stepKey="waitForPreviewLink"/> |
| 168 | + <click selector="{{AdminScheduledChangesSection.scheduleActions('Updated CMS Block A1 Scheduled Update', 'Preview')}}" stepKey="clickPreviewLink"/> |
| 169 | + <switchToNextTab stepKey="switchToPreviewTab"/> |
| 170 | + |
| 171 | + <!-- Verify preview page opens with updated block --> |
| 172 | + <waitForPageLoad stepKey="waitForPreviewPageLoad"/> |
| 173 | + <seeInCurrentUrl url="staging/update/preview" stepKey="verifyPreviewUrl"/> |
| 174 | + |
| 175 | + <!-- Verify updated block data in preview mode --> |
| 176 | + <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="Updated CMS Block A1 Content for Staging Test" stepKey="seeUpdatedContentInPreview"/> |
| 177 | + |
| 178 | + <!-- Close preview tab and return to main tab --> |
| 179 | + <closeTab stepKey="closePreviewTab"/> |
| 180 | + |
| 181 | + <!-- Step 10: Go to Content > Staging > Dashboard --> |
| 182 | + <amOnPage url="{{AdminStagingDashboardPage.url}}" stepKey="goToStagingDashboard"/> |
| 183 | + <waitForPageLoad stepKey="waitForStagingDashboardLoad"/> |
| 184 | + |
| 185 | + <!-- Verify created update is visible in grid mode --> |
| 186 | + <actionGroup ref="changeStagingView" stepKey="changeDashboardToGridView"> |
| 187 | + <argument name="view" value="grid"/> |
| 188 | + </actionGroup> |
| 189 | + <waitForPageLoad stepKey="waitForGridViewLoad"/> |
| 190 | + |
| 191 | + <!-- Search for the update --> |
| 192 | + <fillField selector="{{AdminAssignToExistingUpdateSection.searchStagingName}}" userInput="Updated CMS Block A1 Scheduled Update" stepKey="searchForUpdate"/> |
| 193 | + <click selector="{{AdminAssignToExistingUpdateSection.submitSearch}}" stepKey="clickSearchButton"/> |
| 194 | + <waitForPageLoad stepKey="waitForSearchResults"/> |
| 195 | + |
| 196 | + <!-- Verify update is visible in grid with correct details --> |
| 197 | + <waitForText selector="{{AdminContentStagingGridDashboardSection.updateNameColumnGrid}}" userInput="Updated CMS Block A1 Scheduled Update" stepKey="seeUpdateInDashboardGrid"/> |
| 198 | + <waitForText selector="{{AdminContentStagingGridDashboardSection.startDateColumnGrid('Updated CMS Block A1 Scheduled Update')}}" userInput="{$generateBothStartDate}" stepKey="seeStartDateInDashboardGrid"/> |
| 199 | + <waitForText selector="{{AdminContentStagingGridDashboardSection.endDateColumnGrid('Updated CMS Block A1 Scheduled Update')}}" userInput="{$generateBothEndDate}" stepKey="seeEndDateInDashboardGrid"/> |
| 200 | + |
| 201 | + <!-- Verify created update contains assigned entities --> |
| 202 | + <waitForText selector="{{AdminContentStagingGridDashboardSection.descriptionColumnGrid('Updated CMS Block A1 Scheduled Update')}}" userInput="Modified scheduled update for CMS Block A1 testing" stepKey="seeDescriptionInDashboardGrid"/> |
| 203 | + |
| 204 | + <!-- Verify CMS block entity is assigned to update --> |
| 205 | + <comment userInput="CMS block entity verification - specific entity column selector not available in current section" stepKey="commentBlockEntityVerification"/> |
| 206 | + |
| 207 | + <!-- Switch to timeline mode --> |
| 208 | + <actionGroup ref="changeStagingView" stepKey="changeDashboardToTimelineView"> |
| 209 | + <argument name="view" value="timeline"/> |
| 210 | + </actionGroup> |
| 211 | + <waitForPageLoad stepKey="waitForTimelineViewLoad"/> |
| 212 | + |
| 213 | + <!-- Verify update is visible in timeline --> |
| 214 | + <see selector="{{AdminContentStagingDashboardSection.timeLineEvent}}" userInput="Updated CMS Block A1 Scheduled Update" stepKey="seeUpdateInTimeline"/> |
| 215 | + |
| 216 | + <!-- Step 11: Click Preview link near created update in timeline --> |
| 217 | + <waitForElementClickable selector="{{AdminContentStagingGridDashboardSection.linkPreview('Updated CMS Block A1 Scheduled Update')}}" stepKey="waitForTimelinePreviewLink"/> |
| 218 | + <click selector="{{AdminContentStagingGridDashboardSection.linkPreview('Updated CMS Block A1 Scheduled Update')}}" stepKey="clickTimelinePreviewLink"/> |
| 219 | + <switchToNextTab stepKey="switchToTimelinePreviewTab"/> |
| 220 | + |
| 221 | + <!-- Verify preview page opens with updated block data --> |
| 222 | + <waitForPageLoad stepKey="waitForTimelinePreviewPageLoad"/> |
| 223 | + <seeInCurrentUrl url="staging/update/preview" stepKey="verifyTimelinePreviewUrl"/> |
| 224 | + |
| 225 | + <!-- Verify updated block content in preview --> |
| 226 | + <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="Updated CMS Block A1 Content for Staging Test" stepKey="seeUpdatedContentInTimelinePreview"/> |
| 227 | + |
| 228 | + <!-- Close preview tab and return to main tab --> |
| 229 | + <closeTab stepKey="closeTimelinePreviewTab"/> |
| 230 | + |
| 231 | + <!-- Step 12: Wait until update is applied and open created CMS block in admin --> |
| 232 | + <!-- Note: For testing purposes, we'll simulate the update application by moving the start time to past --> |
| 233 | + <amOnPage url="{{CmsBlocksPage.url}}" stepKey="goBackToBlocksPage"/> |
| 234 | + <waitForPageLoad stepKey="waitForBlocksPageReload"/> |
| 235 | + |
| 236 | + <actionGroup ref="AdminOpenCmsBlockActionGroup" stepKey="openUpdatedCmsBlock"> |
| 237 | + <argument name="block_id" value="$createCmsBlockA1.id$"/> |
| 238 | + </actionGroup> |
| 239 | + <waitForPageLoad stepKey="waitForUpdatedBlockPageLoad"/> |
| 240 | + |
| 241 | + <!-- Verify no created update in Scheduled Changes grid (would be empty after application) --> |
| 242 | + <!-- This step would normally check that the update is no longer in "future" state --> |
| 243 | + <waitForElementNotVisible selector="{{AdminScheduledChangesSection.scheduleDetails('Updated CMS Block A1 Scheduled Update')}}" stepKey="dontSeeExpiredUpdateInGrid"/> |
| 244 | + |
| 245 | + <!-- Verify form data matches what was set during update creation --> |
| 246 | + <seeInField selector="{{AdminCreateNewBlockSection.blockTitle}}" userInput="Updated CMS Block A1 Title" stepKey="seeUpdatedTitleInForm"/> |
| 247 | + <seeInField selector="{{AdminCreateNewBlockSection.identifier}}" userInput="updated_cms_block_a1_{{_unique}}" stepKey="seeUpdatedIdentifierInForm"/> |
| 248 | + <seeInField selector="{{AdminCreateNewBlockSection.content}}" userInput="Updated CMS Block A1 Content for Staging Test" stepKey="seeUpdatedContentInForm"/> |
| 249 | + |
| 250 | + <!-- Step 13: Open home page on storefront --> |
| 251 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="openStorefrontHomePage"/> |
| 252 | + <waitForPageLoad stepKey="waitForHomepageLoad"/> |
| 253 | + |
| 254 | + <!-- Verify page with updated block opens and block data is correct --> |
| 255 | + <!-- Verify the widget displays the updated block content --> |
| 256 | + <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="Updated CMS Block A1 Content for Staging Test" stepKey="seeUpdatedBlockContentOnStorefront"/> |
| 257 | + |
| 258 | + <!-- Verify block title is updated on storefront --> |
| 259 | + <waitForText selector="{{StorefrontWidgetsSection.widgetTitle}}" userInput="Updated CMS Block A1 Title" stepKey="seeUpdatedBlockTitleOnStorefront"/> |
| 260 | + |
| 261 | + <!-- Additional verification: Ensure block widget is displayed on homepage --> |
| 262 | + <seeElement selector="{{StorefrontBlockSection.mediaDescription}}" stepKey="seeBlockWidgetOnHomepage"/> |
| 263 | + </test> |
| 264 | +</tests> |
0 commit comments