@alfresco/aca-playwright-shared 8.1.0-39733206398 → 8.1.0-39947705724

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -740,6 +740,75 @@ async function verifyDataTableAccessibility(page, tableSelector = 'adf-datatable
740
740
  }
741
741
  }
742
742
 
743
+ /*!
744
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
745
+ *
746
+ * Alfresco Example Content Application
747
+ *
748
+ * This file is part of the Alfresco Example Content Application.
749
+ * If the software was purchased under a paid Alfresco license, the terms of
750
+ * the paid license agreement will prevail. Otherwise, the software is
751
+ * provided under the following open source license terms:
752
+ *
753
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
754
+ * it under the terms of the GNU Lesser General Public License as published by
755
+ * the Free Software Foundation, either version 3 of the License, or
756
+ * (at your option) any later version.
757
+ *
758
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
759
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
760
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
761
+ * GNU Lesser General Public License for more details.
762
+ *
763
+ * You should have received a copy of the GNU Lesser General Public License
764
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
765
+ */
766
+ const MANAGE_VERSIONS_MENU_ITEM = 'Manage Versions';
767
+ const UPLOAD_NEW_VERSION_MENU_ITEM = 'Upload New Version';
768
+ class VersionManagerActions {
769
+ static async openManageVersionsFromList(context, fileName) {
770
+ await context.dataTable.getRowByName(fileName).waitFor({ state: 'visible', timeout: timeouts.large });
771
+ await context.dataTable.selectItems(fileName);
772
+ await context.acaHeader.clickMoreActions();
773
+ await context.acaHeader.matMenu.clickMenuItem(MANAGE_VERSIONS_MENU_ITEM);
774
+ await context.manageVersionsDialog.waitForDialog();
775
+ await context.manageVersionsDialog.waitForVersionListToLoad();
776
+ }
777
+ static async openManageVersionsFromViewer(context) {
778
+ await context.viewer.toolbar.clickMoreActions();
779
+ await context.matMenu.clickMenuItem(MANAGE_VERSIONS_MENU_ITEM);
780
+ await context.manageVersionsDialog.waitForDialog();
781
+ await context.manageVersionsDialog.waitForVersionListToLoad();
782
+ }
783
+ static async selectFileForNewVersion(context, fileName, filePath) {
784
+ await context.dataTable.selectItems(fileName);
785
+ await context.acaHeader.clickMoreActions();
786
+ const [fileChooser] = await Promise.all([
787
+ context.page.waitForEvent('filechooser', { timeout: timeouts.extraLarge }),
788
+ context.acaHeader.matMenu.clickMenuItem(UPLOAD_NEW_VERSION_MENU_ITEM)
789
+ ]);
790
+ await fileChooser.setFiles(filePath);
791
+ await context.uploadNewVersionDialog.title.waitFor();
792
+ }
793
+ static async uploadNewVersion(context, fileName, filePath, options = {}) {
794
+ const { major = false, comment, cancel = false } = options;
795
+ await this.selectFileForNewVersion(context, fileName, filePath);
796
+ if (major) {
797
+ await context.uploadNewVersionDialog.majorOption.click();
798
+ }
799
+ if (comment) {
800
+ await context.uploadNewVersionDialog.description.fill(comment);
801
+ }
802
+ if (cancel) {
803
+ await context.uploadNewVersionDialog.cancelButton.click();
804
+ }
805
+ else {
806
+ await context.uploadNewVersionDialog.uploadButton.click();
807
+ }
808
+ await context.uploadNewVersionDialog.cancelButton.waitFor({ state: 'detached' });
809
+ }
810
+ }
811
+
743
812
  /*!
744
813
  * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
745
814
  *
@@ -1994,32 +2063,107 @@ class UploadNewVersionDialog extends BaseComponent {
1994
2063
  * You should have received a copy of the GNU Lesser General Public License
1995
2064
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
1996
2065
  */
1997
- class ManageVersionsDialog extends BaseComponent {
1998
- static { this.rootElement = '.adf-new-version-uploader-dialog'; }
1999
- async clickListActionButtonForVersion(version) {
2000
- await this.getChild(`[id="adf-version-list-action-menu-button-${version}"]`).click();
2066
+ class VersionListComponent extends BaseComponent {
2067
+ static { this.rootElement = 'adf-version-list'; }
2068
+ constructor(page, rootElement = VersionListComponent.rootElement) {
2069
+ super(page, rootElement);
2070
+ this.loadingBar = this.getChild('[data-automation-id="version-history-loading-bar"]');
2071
+ this.rows = this.getChild('.adf-version-list-item');
2001
2072
  }
2002
- async isVersionPresent(version) {
2003
- return this.getChild(`[id="adf-version-list-item-version-${version}"]`).isVisible();
2073
+ versionLabel(version) {
2074
+ return this.getChild(`[id="adf-version-list-item-version-${version}"]`);
2004
2075
  }
2005
- async isDescriptionPresent(version) {
2006
- return this.getChild(`[id="adf-version-list-item-comment-${version}"]`).isVisible();
2076
+ versionComment(version) {
2077
+ return this.getChild(`[id="adf-version-list-item-comment-${version}"]`);
2007
2078
  }
2008
- async waitForProgressBarToDisappear(attachedTimeout = 5000) {
2009
- const loadingBar = this.getChild('[data-automation-id="version-history-loading-bar"]');
2010
- try {
2011
- await loadingBar.waitFor({ state: 'attached', timeout: attachedTimeout });
2012
- }
2013
- catch {
2014
- return;
2015
- }
2016
- await loadingBar.waitFor({ state: 'detached' });
2079
+ versionModifiedBy(version) {
2080
+ return this.getChild(`[data-automation-id="adf-version-list-item-modified-by-${version}"]`);
2017
2081
  }
2018
- async waitForDialog() {
2019
- await this.page.locator('[data-automation-id="new-version-uploader-dialog-title"]').waitFor();
2082
+ actionMenuButton(version) {
2083
+ return this.getChild(`[id="adf-version-list-action-menu-button-${version}"]`);
2084
+ }
2085
+ restoreAction(version) {
2086
+ return this.page.locator(`[id="adf-version-list-action-restore-${version}"]`);
2020
2087
  }
2088
+ downloadAction(version) {
2089
+ return this.page.locator(`[id="adf-version-list-action-download-${version}"]`);
2090
+ }
2091
+ deleteAction(version) {
2092
+ return this.page.locator(`[id="adf-version-list-action-delete-${version}"]`);
2093
+ }
2094
+ async openActionMenuForVersion(version) {
2095
+ await this.actionMenuButton(version).click();
2096
+ }
2097
+ async clickDownloadForVersion(version) {
2098
+ await this.openActionMenuForVersion(version);
2099
+ await this.downloadAction(version).click();
2100
+ }
2101
+ async clickDeleteForVersion(version) {
2102
+ await this.openActionMenuForVersion(version);
2103
+ await this.deleteAction(version).click();
2104
+ }
2105
+ async waitForVersionListToLoad() {
2106
+ await this.loadingBar.waitFor({ state: 'detached' });
2107
+ await this.rows.first().waitFor({ state: 'visible', timeout: timeouts.large });
2108
+ }
2109
+ }
2110
+
2111
+ /*!
2112
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
2113
+ *
2114
+ * Alfresco Example Content Application
2115
+ *
2116
+ * This file is part of the Alfresco Example Content Application.
2117
+ * If the software was purchased under a paid Alfresco license, the terms of
2118
+ * the paid license agreement will prevail. Otherwise, the software is
2119
+ * provided under the following open source license terms:
2120
+ *
2121
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
2122
+ * it under the terms of the GNU Lesser General Public License as published by
2123
+ * the Free Software Foundation, either version 3 of the License, or
2124
+ * (at your option) any later version.
2125
+ *
2126
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
2127
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2128
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2129
+ * GNU Lesser General Public License for more details.
2130
+ *
2131
+ * You should have received a copy of the GNU Lesser General Public License
2132
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
2133
+ */
2134
+ class ManageVersionsDialog extends BaseComponent {
2135
+ static { this.rootElement = '.adf-new-version-uploader-dialog'; }
2021
2136
  constructor(page) {
2022
2137
  super(page, ManageVersionsDialog.rootElement);
2138
+ this.versionList = new VersionListComponent(this.page, `${ManageVersionsDialog.rootElement} ${VersionListComponent.rootElement}`);
2139
+ this.title = this.getChild('[data-automation-id="new-version-uploader-dialog-title"]');
2140
+ }
2141
+ versionLabel(version) {
2142
+ return this.versionList.versionLabel(version);
2143
+ }
2144
+ versionComment(version) {
2145
+ return this.versionList.versionComment(version);
2146
+ }
2147
+ versionModifiedBy(version) {
2148
+ return this.versionList.versionModifiedBy(version);
2149
+ }
2150
+ restoreAction(version) {
2151
+ return this.versionList.restoreAction(version);
2152
+ }
2153
+ async openActionMenuForVersion(version) {
2154
+ await this.versionList.openActionMenuForVersion(version);
2155
+ }
2156
+ async clickDownloadForVersion(version) {
2157
+ await this.versionList.clickDownloadForVersion(version);
2158
+ }
2159
+ async clickDeleteForVersion(version) {
2160
+ await this.versionList.clickDeleteForVersion(version);
2161
+ }
2162
+ async waitForVersionListToLoad() {
2163
+ await this.versionList.waitForVersionListToLoad();
2164
+ }
2165
+ async waitForDialog() {
2166
+ await this.title.waitFor();
2023
2167
  }
2024
2168
  }
2025
2169
 
@@ -7599,5 +7743,5 @@ const TEST_FILES = {
7599
7743
  * Generated bundle index. Do not edit.
7600
7744
  */
7601
7745
 
7602
- export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, DetailsPageComponent, EditDialog, EditModeComponent, ErrorComponent, FavoritesApi, FavoritesLibrariesPage, FavoritesPage, Field, FolderInformationDialogComponent, InfoDrawerComponent, LinkRulesDialog, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RepositoryPage, RulesApi, RulesToolbarComponent, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchApi, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchMenuCard, SearchPage, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, ViewerToolbarComponent, cleanupRepositoryTestData, createSuiteProjects, errorStrings, file, flattenNodeContentTree, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, hasAccessibleAttribute, hasAccessibleName, isInteractiveElement, libraryErrors, logger, multipleSelFile, paths, seedRepositoryTestData, test, testEmailDomain, timeouts, users, verifyDataTableAccessibility, verifyElementsHaveNames, verifyRegionAccessibleNames, waitForApi };
7746
+ export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, DetailsPageComponent, EditDialog, EditModeComponent, ErrorComponent, FavoritesApi, FavoritesLibrariesPage, FavoritesPage, Field, FolderInformationDialogComponent, InfoDrawerComponent, LinkRulesDialog, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RepositoryPage, RulesApi, RulesToolbarComponent, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchApi, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchMenuCard, SearchPage, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, VersionListComponent, VersionManagerActions, ViewerComponent, ViewerOverlayDialogComponent, ViewerToolbarComponent, cleanupRepositoryTestData, createSuiteProjects, errorStrings, file, flattenNodeContentTree, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, hasAccessibleAttribute, hasAccessibleName, isInteractiveElement, libraryErrors, logger, multipleSelFile, paths, seedRepositoryTestData, test, testEmailDomain, timeouts, users, verifyDataTableAccessibility, verifyElementsHaveNames, verifyRegionAccessibleNames, waitForApi };
7603
7747
  //# sourceMappingURL=alfresco-aca-playwright-shared.mjs.map