@alfresco/aca-playwright-shared 7.4.0-23644208372 → 7.4.0-23733497981

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.
@@ -30,6 +30,7 @@ export declare class NodesApi {
30
30
  createFolder(name: string, parentId?: string, title?: string, description?: string, author?: string, aspectNames?: string[]): Promise<NodeEntry | null>;
31
31
  createFile(name: string, parentId?: string, title?: string, description?: string, author?: string, majorVersion?: boolean, aspectNames?: string[]): Promise<NodeEntry>;
32
32
  createFiles(names: string[], relativePath?: string): Promise<NodePaging>;
33
+ createMultipleFiles(count: number, parentId?: string): Promise<NodeEntry[]>;
33
34
  createFolders(names: string[], relativePath?: string): Promise<NodePaging>;
34
35
  deleteDeletedNode(name: string): Promise<void>;
35
36
  private createNode;
@@ -21,13 +21,16 @@
21
21
  * You should have received a copy of the GNU Lesser General Public License
22
22
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
23
23
  */
24
- export declare class SearchPageApi {
24
+ export declare class SearchApi {
25
25
  private readonly apiService;
26
26
  constructor();
27
- static initialize(userName: string, password?: string): Promise<SearchPageApi>;
27
+ static initialize(userName: string, password?: string): Promise<SearchApi>;
28
28
  private querySearchFiles;
29
29
  getTotalItems(username: string): Promise<number>;
30
30
  waitForApi(username: string, data: {
31
31
  expect: number;
32
32
  }): Promise<any>;
33
+ waitForFolderPathIndexing(folderId: string, options: {
34
+ nodesExpected: number;
35
+ }, maxRetries?: number): Promise<number>;
33
36
  }
@@ -31,6 +31,7 @@ export declare const getReportPortalConfig: () => {
31
31
  skipPassed: boolean;
32
32
  restClientConfig: {
33
33
  timeout: number;
34
+ retry: number;
34
35
  };
35
36
  attributes: {
36
37
  key: string;
@@ -1,4 +1,4 @@
1
- import { AlfrescoApi, SitesApi as SitesApi$1, UploadApi, NodesApi as NodesApi$1, PeopleApi, AdminUsersApi, AdminTenantsApi, GroupsApi, QueriesApi as QueriesApi$1, SearchApi, SecurityGroupsApi, SecurityMarksApi, SharedlinksApi, FavoritesApi, TrashcanApi as TrashcanApi$1, CommentsApi, CategoriesApi as CategoriesApi$1, TagsApi as TagsApi$1, ResultSetPaging, SharedLinkPaging, FavoritePaging, Site, SiteMemberEntry } from '@alfresco/js-api';
1
+ import { AlfrescoApi, SitesApi as SitesApi$1, UploadApi, NodesApi as NodesApi$1, PeopleApi, AdminUsersApi, AdminTenantsApi, GroupsApi, QueriesApi as QueriesApi$1, SearchApi as SearchApi$1, SecurityGroupsApi, SecurityMarksApi, SharedlinksApi, FavoritesApi, TrashcanApi as TrashcanApi$1, CommentsApi, CategoriesApi as CategoriesApi$1, TagsApi as TagsApi$1, ResultSetPaging, SharedLinkPaging, FavoritePaging, Site, SiteMemberEntry } from '@alfresco/js-api';
2
2
  import { expect, chromium, devices, test as test$1 } from '@playwright/test';
3
3
  import * as path from 'path';
4
4
  import { resolve } from 'path';
@@ -321,6 +321,9 @@ class Utils {
321
321
  static async waitForApiResponse(contentPage, urlSubstring, statusCode) {
322
322
  await contentPage.page.waitForResponse((response) => response.url().includes(urlSubstring) && response.status() === statusCode);
323
323
  }
324
+ static async delayInSeconds(seconds) {
325
+ await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
326
+ }
324
327
  }
325
328
 
326
329
  /*!
@@ -997,6 +1000,7 @@ class DataTableComponent extends BaseComponent {
997
1000
  this.searchFileName = '.search-file-name';
998
1001
  this.searchFileDescription = '[data-automation-id="search-results-entry-description"]';
999
1002
  this.searchFileContent = '.aca-result-content';
1003
+ this.noPermissionsView = this.page.locator('aca-generic-error');
1000
1004
  /** Locator for row (or rows) */
1001
1005
  this.getRowLocator = this.page.getByRole('rowgroup').nth(1).locator('adf-datatable-row');
1002
1006
  /** Locator to get "No results found" message */
@@ -1818,9 +1822,27 @@ class UploadNewVersionDialog extends BaseComponent {
1818
1822
  */
1819
1823
  class ManageVersionsDialog extends BaseComponent {
1820
1824
  static { this.rootElement = '.adf-new-version-uploader-dialog'; }
1821
- async viewFileVersion(version) {
1822
- const versionActionsButton = this.getChild(`[id="adf-version-list-action-menu-button-${version}"]`);
1823
- await versionActionsButton.click();
1825
+ async clickListActionButtonForVersion(version) {
1826
+ await this.getChild(`[id="adf-version-list-action-menu-button-${version}"]`).click();
1827
+ }
1828
+ async isVersionPresent(version) {
1829
+ return this.getChild(`[id="adf-version-list-item-version-${version}"]`).isVisible();
1830
+ }
1831
+ async isDescriptionPresent(version) {
1832
+ return this.getChild(`[id="adf-version-list-item-comment-${version}"]`).isVisible();
1833
+ }
1834
+ async waitForProgressBarToDisappear(attachedTimeout = 5000) {
1835
+ const loadingBar = this.getChild('[data-automation-id="version-history-loading-bar"]');
1836
+ try {
1837
+ await loadingBar.waitFor({ state: 'attached', timeout: attachedTimeout });
1838
+ }
1839
+ catch {
1840
+ return;
1841
+ }
1842
+ await loadingBar.waitFor({ state: 'detached' });
1843
+ }
1844
+ async waitForDialog() {
1845
+ await this.page.locator('[data-automation-id="new-version-uploader-dialog-title"]').waitFor();
1824
1846
  }
1825
1847
  constructor(page) {
1826
1848
  super(page, ManageVersionsDialog.rootElement);
@@ -2750,7 +2772,7 @@ class ViewerComponent extends BaseComponent {
2750
2772
  super(page, ViewerComponent.rootElement);
2751
2773
  this.viewerLocator = this.getChild('adf-viewer-render');
2752
2774
  this.closeButtonLocator = this.getChild('.adf-viewer-close-button');
2753
- this.fileTitleButtonLocator = this.getChild('.adf-viewer__file-title');
2775
+ this.fileTitleButtonLocator = this.getChild('#adf-viewer-display-name');
2754
2776
  this.pdfViewerContentPages = this.getChild('.adf-pdf-viewer__content .page');
2755
2777
  this.shareButton = this.getChild('button[id="share-action-button"]');
2756
2778
  this.downloadButton = this.getChild('button[id="app.viewer.download"]');
@@ -2768,6 +2790,9 @@ class ViewerComponent extends BaseComponent {
2768
2790
  this.zoomScale = this.getChild('[data-automation-id="adf-page-scale"]');
2769
2791
  this.zoomResetButton = this.getChild('#viewer-reset-button');
2770
2792
  this.fitToPageButton = this.getChild('#viewer-scale-page-button');
2793
+ this.nextFileButton = this.getChild('[data-automation-id="adf-toolbar-next-file"]');
2794
+ this.previousFileButton = this.getChild('[data-automation-id="adf-toolbar-pref-file"]');
2795
+ this.noPermissionsView = this.getChild('aca-generic-error');
2771
2796
  this.toolbar = new AcaHeader(this.page);
2772
2797
  }
2773
2798
  async isPdfViewerContentDisplayed() {
@@ -2778,10 +2803,8 @@ class ViewerComponent extends BaseComponent {
2778
2803
  await this.waitForViewerToOpen();
2779
2804
  return this.viewerLocator.isVisible();
2780
2805
  }
2781
- async waitForViewerToOpen(waitForViewerContent) {
2782
- if (waitForViewerContent) {
2783
- await this.waitForViewerLoaderToFinish();
2784
- }
2806
+ async waitForViewerToOpen() {
2807
+ await this.waitForViewerLoaderToFinish();
2785
2808
  await this.viewerLocator.waitFor({ state: 'visible', timeout: timeouts.large });
2786
2809
  }
2787
2810
  async waitForViewerLoaderToFinish(customTimeout) {
@@ -4417,7 +4440,8 @@ const getReportPortalConfig = () => {
4417
4440
  includeTestSteps: true,
4418
4441
  skipPassed: true,
4419
4442
  restClientConfig: {
4420
- timeout: timeouts.extendedTest
4443
+ timeout: timeouts.sixtySeconds,
4444
+ retry: 0
4421
4445
  },
4422
4446
  attributes,
4423
4447
  description: `[Run ${env$1.GITHUB_RUN_ID}](${env$1.GITHUB_SERVER_URL}/${env$1.GITHUB_REPOSITORY}/actions/runs/${env$1.GITHUB_RUN_ID}) - ${browser} - Failures only`
@@ -4688,7 +4712,7 @@ class ApiClientFactory {
4688
4712
  this.adminTenant = new AdminTenantsApi(this.alfrescoApi);
4689
4713
  this.groups = new GroupsApi(this.alfrescoApi);
4690
4714
  this.queries = new QueriesApi$1(this.alfrescoApi);
4691
- this.search = new SearchApi(this.alfrescoApi);
4715
+ this.search = new SearchApi$1(this.alfrescoApi);
4692
4716
  this.securityGroupsApi = new SecurityGroupsApi(this.alfrescoApi);
4693
4717
  this.securityMarksApi = new SecurityMarksApi(this.alfrescoApi);
4694
4718
  this.share = new SharedlinksApi(this.alfrescoApi);
@@ -5136,10 +5160,10 @@ class FileActionsApi {
5136
5160
  };
5137
5161
  try {
5138
5162
  await waitForApi(apiCall, predicate, 30, 2500);
5139
- console.log(`waitForNodes: Found ${data.expect} nodes with search term "${searchTerm}"`);
5140
5163
  }
5141
- catch (error) {
5142
- console.error(`Error: ${error}`);
5164
+ catch {
5165
+ const actual = await apiCall();
5166
+ throw new Error(`waitForNodes: Timed out waiting for "${searchTerm}" — expected ${data.expect} nodes, found ${actual}`);
5143
5167
  }
5144
5168
  }
5145
5169
  async queryNodesSearchHighlight(searchTerm) {
@@ -5597,6 +5621,16 @@ class NodesApi {
5597
5621
  return null;
5598
5622
  }
5599
5623
  }
5624
+ async createMultipleFiles(count, parentId = '-my-') {
5625
+ const createdFiles = [];
5626
+ for (let i = 0; i < count; i++) {
5627
+ const file = await this.createFile(`file-${Utils.random()}-${i}`, parentId);
5628
+ if (file) {
5629
+ createdFiles.push(file);
5630
+ }
5631
+ }
5632
+ return createdFiles;
5633
+ }
5600
5634
  async createFolders(names, relativePath = '/') {
5601
5635
  try {
5602
5636
  return await this.createContent({ folders: names }, relativePath);
@@ -6148,12 +6182,12 @@ class SitesApi {
6148
6182
  * You should have received a copy of the GNU Lesser General Public License
6149
6183
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
6150
6184
  */
6151
- class SearchPageApi {
6185
+ class SearchApi {
6152
6186
  constructor() {
6153
6187
  this.apiService = new ApiClientFactory();
6154
6188
  }
6155
6189
  static async initialize(userName, password) {
6156
- const classObj = new SearchPageApi();
6190
+ const classObj = new SearchApi();
6157
6191
  await classObj.apiService.setUpAcaBackend(userName, password);
6158
6192
  return classObj;
6159
6193
  }
@@ -6194,6 +6228,39 @@ class SearchPageApi {
6194
6228
  }
6195
6229
  catch { }
6196
6230
  }
6231
+ async waitForFolderPathIndexing(folderId, options, maxRetries) {
6232
+ try {
6233
+ const query = {
6234
+ query: {
6235
+ query: `ANCESTOR:'workspace://SpacesStore/${folderId}' and TYPE:content`,
6236
+ language: 'afts'
6237
+ }
6238
+ };
6239
+ const retryLimit = maxRetries ?? 100;
6240
+ let retryCount = 0;
6241
+ let result;
6242
+ do {
6243
+ result = await this.apiService.search.search(query);
6244
+ const currentCount = result.list.pagination.count;
6245
+ if (currentCount !== options.nodesExpected) {
6246
+ retryCount++;
6247
+ if (retryCount % 30 === 0) {
6248
+ console.info(`waitForFolderPathIndexing: After ${retryCount} seconds, expected ${options.nodesExpected} nodes but found ${currentCount} in folder ${folderId}`);
6249
+ }
6250
+ if (retryCount >= retryLimit) {
6251
+ throw new Error(`Expected ${options.nodesExpected} nodes but found ${currentCount} after ${retryLimit} retries`);
6252
+ }
6253
+ await Utils.delayInSeconds(1);
6254
+ }
6255
+ } while (result.list.pagination.count !== options.nodesExpected);
6256
+ console.info(`waitForFolderPathIndexing: Found expected ${options.nodesExpected} nodes in folder ${folderId}`);
6257
+ return result.list.pagination.count;
6258
+ }
6259
+ catch (error) {
6260
+ console.error(`waitForFolderPathIndexing failed for folderId "${folderId}": ${error}`);
6261
+ throw error;
6262
+ }
6263
+ }
6197
6264
  }
6198
6265
 
6199
6266
  /*!
@@ -7291,5 +7358,5 @@ const TEST_FILES = {
7291
7358
  * Generated bundle index. Do not edit.
7292
7359
  */
7293
7360
 
7294
- export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfInfoDrawerComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, EditDialog, ErrorComponent, FavoritesLibrariesPage, FavoritesPage, FavoritesPageApi, Field, FileActionsApi, FolderInformationDialogComponent, GenericLogger, LinkRulesDialog, LogLevelsEnum, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RulesApi, RulesToolbarComponent, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchMenuCard, SearchPage, SearchPageApi, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, SpinnerComponent, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, collaboratorDocToolbarMore, collaboratorEditRowToolbarMore, collaboratorLockCurrentUserToolbarMore, collaboratorLockOtherUserSearchToolbarMore, collaboratorLockOtherUserToolbarMore, collaboratorSharedToolbarPrimary, collaboratorToolbarPrimary, createSuiteProjects, errorColor, errorStrings, favoritesCollaboratorToolbarMore, file, fileDocx, fileDocxFav, fileDocxShared, fileDocxSharedFav, fileFav, fileFavLocked, fileGranularPermission, fileLocked, fileLockedByUser, fileShared, fileSharedFav, fileSharedFavLocked, fileSharedLocked, flattenNodeContentTree, folder, folderFav, folderFav2, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, infoColor, libraryErrors, logColor, logLevels, multipleSel, multipleSelAllFav, multipleSelFile, paths, random$1 as random, test, testEmailDomain, timeouts, users, waitForApi, warnColor };
7361
+ export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfInfoDrawerComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, EditDialog, ErrorComponent, FavoritesLibrariesPage, FavoritesPage, FavoritesPageApi, Field, FileActionsApi, FolderInformationDialogComponent, GenericLogger, LinkRulesDialog, LogLevelsEnum, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, 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, SpinnerComponent, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, collaboratorDocToolbarMore, collaboratorEditRowToolbarMore, collaboratorLockCurrentUserToolbarMore, collaboratorLockOtherUserSearchToolbarMore, collaboratorLockOtherUserToolbarMore, collaboratorSharedToolbarPrimary, collaboratorToolbarPrimary, createSuiteProjects, errorColor, errorStrings, favoritesCollaboratorToolbarMore, file, fileDocx, fileDocxFav, fileDocxShared, fileDocxSharedFav, fileFav, fileFavLocked, fileGranularPermission, fileLocked, fileLockedByUser, fileShared, fileSharedFav, fileSharedFavLocked, fileSharedLocked, flattenNodeContentTree, folder, folderFav, folderFav2, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, infoColor, libraryErrors, logColor, logLevels, multipleSel, multipleSelAllFav, multipleSelFile, paths, random$1 as random, test, testEmailDomain, timeouts, users, waitForApi, warnColor };
7295
7362
  //# sourceMappingURL=alfresco-aca-playwright-shared.mjs.map