Update/Migrate tests for Restore from Archive #1923 - #1925
Conversation
Codacy's Analysis Summary0 new issue (≤ 0 issue)
|
There was a problem hiding this comment.
Pull request overview
This PR migrates a set of WDIO page objects and specs to the newer Content Studio UI structure (shadow DOM / data-component selectors), focusing on “Restore from Archive”, filter panels, and publishing report widgets/dialogs.
Changes:
- Updated multiple specs to use new page-object methods and revised UI labels (e.g., “results” counters, widget selector behavior).
- Refactored/added page objects for Publish Report UI, Archive dialogs/panels, and shared confirmation dialogs (new
ConfirmValueDialog, newDiffStatusBadge). - Reworked widget selector dropdown interactions and several dialog/panel selectors to match the newer component markup.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| testing/specs/publish.report.widget.spec.js | Updates widget-opening call sites to openPublishingReportWidget(). |
| testing/specs/publish.report.dialog.spec.js | Enables the suite and updates selectors/expectations for the Publish Report dialog flow. |
| testing/specs/layers.content.tree.widget.spec.js | Switches to the new confirm dialog page object import. |
| testing/specs/folder.variants.spec.js | Fixes a test title typo (“butoon” → “button”). |
| testing/specs/archive.restore.content.dependant.items.spec.js | Migrates archive/restore dependent-item tests and updates “hits” → “results” expectations. |
| testing/specs/archive.muiltiselect.restore.spec.js | Migrates multi-select restore tests to new confirm dialog and context window APIs. |
| testing/specs/archive.content.spec.js | Re-enables notification assertions after restore/delete flows. |
| testing/specs/archive.browse.panel.spec.js | Migrates archive browse panel tests to updated selection and details widgets. |
| testing/page_objects/wizardpanel/details/wizard.context.window.panel.js | Adds publish report widget open helper and workarounds. |
| testing/page_objects/wizardpanel/content.wizard.panel.js | Adds openPublishingReportWidget() and adjusts wizard open detection. |
| testing/page_objects/publish.report.dialog.js | Rewrites Publish Report dialog page object using data-component + shadow DOM selectors. |
| testing/page_objects/details_panel/publish.report.widget.js | Rewrites Publish Report widget page object to the new markup and aria-disabled behavior. |
| testing/page_objects/details_panel/base.versions.widget.js | Adjusts versions widget load wait call. |
| testing/page_objects/details_panel/base.context.window.panel.js | Refactors widget selector operations and adds publish report widget open flow. |
| testing/page_objects/content.unpublish.dialog.js | Migrates Unpublish dialog page object to new structure + DiffStatusBadge. |
| testing/page_objects/content.publish.dialog.js | Migrates Publish dialog page object to new structure + DiffStatusBadge, adds comment/schedule helpers. |
| testing/page_objects/confirm.value.dialog.js | Introduces shared gated-confirmation dialog page object. |
| testing/page_objects/confirm.content.delete.dialog.js | Removes the legacy confirm-delete-specific page object in favor of shared confirm dialog. |
| testing/page_objects/components/selectors/widget.selector.dropdown.js | Reimplements widget selector dropdown as a combobox/listbox component. |
| testing/page_objects/components/diff.status.badge.js | Adds a component helper for reading diff/workflow status badges. |
| testing/page_objects/browsepanel/content.filter.panel.js | Migrates Content filter panel to new SearchField/Combobox structures. |
| testing/page_objects/base.browse.panel.js | Updates “select all / clear selection” behavior with new checkbox state handling. |
| testing/page_objects/archive/archived.content.status.widget.js | Removes legacy archived status widget page object. |
| testing/page_objects/archive/archive.widget.item.view.js | Removes legacy archive widget item view page object. |
| testing/page_objects/archive/archive.restore.dialog.js | Migrates Restore dialog page object to new dialog/content list structures. |
| testing/page_objects/archive/archive.item.statistics.panel.js | Updates archive item stats panel behavior and version-history button access. |
| testing/page_objects/archive/archive.filter.panel.js | Migrates archive filter panel to new BrowseFilter structure and “results” counter. |
| testing/page_objects/archive/archive.details.widget.content.section.js | Adds a new page object for the archive details widget content section. |
| testing/page_objects/archive/archive.delete.dialog.js | Migrates Archive delete dialog page object to new dialog/content list structures. |
| testing/page_objects/archive/archive.browse.panel.js | Updates archive browse panel toolbar/buttons, selection clearing, and context panel toggling. |
| testing/libs/studio.utils.js | Updates utilities to use shared confirm dialog and adjusts some navigation flows. |
| testing/libs/project.utils.js | Updates project utilities to use the shared confirm dialog. |
| testing/libs/elements.js | Adds selector helpers for “select all” by toolbar id and wizard display name control. |
| testing/libs/app_const.js | Updates/extends constants for new UI labels/options and normalizes many strings. |
Suppressed comments (2)
testing/page_objects/content.publish.dialog.js:145
- clickOnLogMessageLink uses
this.logMessageLink, but there is nologMessageLinkgetter/property on this class, so this will fail when called. Use the XPATH constant directly (or add a getter).
async clickOnLogMessageLink() {
try {
await this.waitForElementDisplayed(this.logMessageLink, appConst.mediumTimeout);
return await this.clickOnElement(this.logMessageLink);
} catch (err) {
await this.handleError(`Publish Dialog, log message input `, 'err_log_message_input', err);
}
}
testing/page_objects/wizardpanel/content.wizard.panel.js:272
- openPublishingReportWidget reports "Versions History panel" and uses
err_open_versions_panel, which is misleading for troubleshooting Publishing report widget failures. Update the message/id to match the actual action.
async openPublishingReportWidget() {
try {
let wizardContextWindow = new WizardContextPanel();
await this.openContextWindow();
await wizardContextWindow.openPublishReportWidget();
return await this.pause(200);
} catch (err) {
await this.handleError('Versions History panel should be opened in Wizard', 'err_open_versions_panel', err);
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| get cancelSelectionButton() { | ||
| return XPATH.container + lib.DEPENDANTS.EDIT_ENTRY + lib.actionButton('Cancel'); | ||
| } |
| async openPublishReportWidget() { | ||
| try { | ||
| let widgetSelectorDropdown = new WidgetSelectorDropdown(); | ||
| await widgetSelectorDropdown.clickOnDropdownHandle(); | ||
| await widgetSelectorDropdown.selectFilteredWidgetItem(appConst.WIDGET_TITLE.VERSION_HISTORY); | ||
| await this.clickOnWidgetSelectorDropdownHandle(); | ||
| await widgetSelectorDropdown.typeTextInSearchInput(appConst.WIDGET_SELECTOR_OPTIONS.PUBLISHING_REPORT) | ||
| await widgetSelectorDropdown.clickOnOptionByDisplayName(appConst.WIDGET_SELECTOR_OPTIONS.PUBLISHING_REPORT); | ||
| await this.pause(900); | ||
| } catch (err) { | ||
| let screenshot = await this.saveScreenshotUniqueName('err_open_versions'); | ||
| throw new Error(`Error occurred in widget selector dropdown, Version History, screenshot ${screenshot}: ` + err); | ||
| } |
| async openPublishReportWidget() { | ||
| try { | ||
| return await super.openPublishReportWidget(); | ||
| } catch (err) { | ||
| //Workaround for issue with the empty selector: | ||
| await this.saveScreenshotUniqueName('err_widget'); | ||
| } | ||
| } |
| await publishReportDialog.waitForPrintButtonEnabled(); | ||
| // 5. 'Show entire content' checkbox should not be displayed: | ||
| await publishReportDialog.waitForShowEntireContentCheckboxNotDisplayed(); | ||
| //await publishReportDialog.waitForShowEntireContentCheckboxNotDisplayed(); | ||
| // 6. Verify the 'Item went online' in the header of the single comparison block: |
Migrate Page Objects
Migrate tests for Restore from Archive modal dialog and Filter Panel