@alfresco/aca-playwright-shared 8.1.0-34198623639 → 8.1.0-34207320192

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.
@@ -5380,6 +5380,9 @@ class FileActionsApi {
5380
5380
  }
5381
5381
  catch { }
5382
5382
  }
5383
+ async checkoutNode(nodeId) {
5384
+ return this.apiService.nodes.checkoutNode(nodeId);
5385
+ }
5383
5386
  async getNodeById(id) {
5384
5387
  try {
5385
5388
  return this.apiService.nodes.getNode(id);
@@ -5388,44 +5391,22 @@ class FileActionsApi {
5388
5391
  return null;
5389
5392
  }
5390
5393
  }
5391
- async getNodeProperty(nodeId, property) {
5392
- try {
5393
- const node = await this.getNodeById(nodeId);
5394
- return node?.entry?.properties?.[property] || '';
5395
- }
5396
- catch {
5397
- return '';
5398
- }
5399
- }
5400
- async getLockType(nodeId) {
5394
+ async isFileCheckedOutWithRetry(nodeId, expect) {
5395
+ const data = { expect, retry: 5 };
5396
+ let isCheckedOut = false;
5401
5397
  try {
5402
- const lockType = await this.getNodeProperty(nodeId, 'cm:lockType');
5403
- return lockType || '';
5404
- }
5405
- catch {
5406
- return '';
5407
- }
5408
- }
5409
- async isFileLockedWriteWithRetry(nodeId, expect) {
5410
- const data = {
5411
- expect: expect,
5412
- retry: 5
5413
- };
5414
- let isLocked = false;
5415
- try {
5416
- const locked = async () => {
5417
- isLocked = (await this.getLockType(nodeId)) === 'WRITE_LOCK';
5418
- if (isLocked !== data.expect) {
5419
- return Promise.reject(isLocked);
5420
- }
5421
- else {
5422
- return Promise.resolve(isLocked);
5398
+ const check = async () => {
5399
+ const node = await this.getNodeById(nodeId);
5400
+ isCheckedOut = (node?.entry?.aspectNames ?? []).includes('cm:checkedOut');
5401
+ if (isCheckedOut !== data.expect) {
5402
+ return Promise.reject(new Error(`Checked-out state mismatch: expected=${data.expect}, actual=${isCheckedOut}`));
5423
5403
  }
5404
+ return Promise.resolve(isCheckedOut);
5424
5405
  };
5425
- return await Utils.retryCall(locked, data.retry);
5406
+ return await Utils.retryCall(check, data.retry);
5426
5407
  }
5427
5408
  catch { }
5428
- return isLocked;
5409
+ return isCheckedOut;
5429
5410
  }
5430
5411
  async queryNodesNames(searchTerm) {
5431
5412
  const data = {
@@ -7317,6 +7298,7 @@ const searchConsumerSharedToolbarPrimary = ['Shared Link Settings', 'Download',
7317
7298
  const consumerToolbarMore = ['Favorite', 'Copy', 'Manage Versions'];
7318
7299
  const consumerFavToolbarMore = ['Remove Favorite', 'Copy', 'Manage Versions'];
7319
7300
  const collaboratorToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
7301
+ const collaboratorWorkingCopyToolbarPrimary = ['View', 'View Details', 'More Actions'];
7320
7302
  const collaboratorEditRowToolbarMore = [
7321
7303
  'Edit Offline',
7322
7304
  'Upload New Version',
@@ -7326,6 +7308,7 @@ const collaboratorEditRowToolbarMore = [
7326
7308
  'Edit Aspects',
7327
7309
  'Permissions'
7328
7310
  ];
7311
+ const favoritesCheckedOutCollaboratorToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Information'];
7329
7312
  const favoritesCollaboratorToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
7330
7313
  const collaboratorSharedToolbarPrimary = [
7331
7314
  'Activate full-screen mode',
@@ -7345,14 +7328,28 @@ const collaboratorDocToolbarMore = [
7345
7328
  'Edit Aspects',
7346
7329
  'Permissions'
7347
7330
  ];
7331
+ const collaboratorSharedWorkingCopyToolbarPrimary = ['Activate full-screen mode', 'View Details', 'More Actions'];
7332
+ const collaboratorLockedToolbarPrimary = ['Shared Link Settings', 'View', 'View Details', 'More Actions'];
7333
+ const collaboratorLockedOriginalSharedViewerToolbarPrimary = [
7334
+ 'Activate full-screen mode',
7335
+ 'Shared Link Settings',
7336
+ 'View Details',
7337
+ 'More Actions'
7338
+ ];
7339
+ const collaboratorLockedSharedViewerToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy'];
7348
7340
  const collaboratorLockCurrentUserToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
7341
+ const collaboratorLockWorkingCopyToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy'];
7342
+ const lockedWorkingCopyToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Information', 'Permissions'];
7349
7343
  const collaboratorLockOtherUserToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions'];
7350
7344
  const collaboratorLockOtherUserSearchToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
7351
7345
  // ---- VIEWER ----
7352
7346
  const consumerViewerSharedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions'];
7353
7347
  const consumerViewerToolbarPrimary = ['Activate full-screen mode', 'Share', 'Download', 'Print', 'View Details', 'More Actions'];
7348
+ const consumerViewerLockedToolbarPrimary = ['Activate full-screen mode', 'View Details', 'More Actions'];
7354
7349
  const consumerViewerFavToolbarMore = ['Remove Favorite', 'Copy', 'Manage Versions'];
7355
7350
  const consumerViewerToolbarMore = ['Favorite', 'Copy', 'Manage Versions'];
7351
+ const consumerViewerLockedToolbarMore = ['Favorite', 'Copy'];
7352
+ const consumerViewerLockedFavToolbarMore = ['Remove Favorite', 'Copy'];
7356
7353
  // ---- FAVORITES workarounds ----
7357
7354
  const favoritesConsumerToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions'];
7358
7355
  const favoritesConsumerContextMenu = [
@@ -7502,46 +7499,52 @@ const fileSharedFav = {
7502
7499
  };
7503
7500
  const fileLocked = {
7504
7501
  name: `file-${random$1}-locked.txt`,
7502
+ workingCopyName: `file-${random$1}-locked (Working Copy).txt`,
7505
7503
  description: 'file not shared, not fav, not office, locked',
7506
7504
  contextMenu: consumerContextMenu,
7507
7505
  toolbarPrimary: consumerToolbarPrimary,
7508
7506
  toolbarMore: consumerToolbarMore,
7509
- viewerToolbarPrimary: consumerViewerToolbarPrimary,
7510
- viewerToolbarMore: consumerViewerToolbarMore,
7507
+ viewerToolbarPrimary: consumerViewerLockedToolbarPrimary,
7508
+ viewerToolbarMore: consumerViewerLockedToolbarMore,
7511
7509
  searchToolbarPrimary: searchConsumerToolbarPrimary
7512
7510
  };
7513
7511
  const fileFavLocked = {
7514
7512
  name: `file-${random$1}-fav-locked.txt`,
7513
+ workingCopyName: `file-${random$1}-fav-locked (Working Copy).txt`,
7515
7514
  description: 'file not shared, fav, not office, locked',
7516
7515
  contextMenu: consumerFavContextMenu,
7517
7516
  toolbarPrimary: consumerToolbarPrimary,
7518
7517
  toolbarMore: consumerFavToolbarMore,
7519
- viewerToolbarPrimary: consumerViewerToolbarPrimary,
7520
- viewerToolbarMore: consumerViewerFavToolbarMore,
7518
+ viewerToolbarPrimary: consumerViewerLockedToolbarPrimary,
7519
+ viewerToolbarMore: consumerViewerLockedFavToolbarMore,
7520
+ workingCopyViewerToolbarMore: consumerViewerLockedToolbarMore,
7521
7521
  favoritesToolbarMore: favoritesConsumerToolbarMore,
7522
7522
  favoritesContextMenu: favoritesConsumerContextMenu,
7523
7523
  searchToolbarPrimary: searchConsumerToolbarPrimary
7524
7524
  };
7525
7525
  const fileSharedLocked = {
7526
7526
  name: `file-${random$1}-shared-locked.txt`,
7527
+ workingCopyName: `file-${random$1}-shared-locked (Working Copy).txt`,
7527
7528
  description: 'file shared, not fav, not office, locked',
7528
7529
  contextMenu: consumerSharedContextMenu,
7529
7530
  toolbarPrimary: consumerSharedToolbarPrimary,
7530
7531
  toolbarMore: consumerToolbarMore,
7531
- viewerToolbarPrimary: consumerViewerSharedToolbarPrimary,
7532
- viewerToolbarMore: consumerViewerToolbarMore,
7532
+ viewerToolbarPrimary: consumerViewerLockedToolbarPrimary,
7533
+ viewerToolbarMore: consumerViewerLockedToolbarMore,
7533
7534
  sharedToolbarMore: sharedConsumerLockedToolbarMore,
7534
7535
  sharedContextMenu: sharedConsumerLockedContextMenu,
7535
7536
  searchToolbarPrimary: searchConsumerSharedToolbarPrimary
7536
7537
  };
7537
7538
  const fileSharedFavLocked = {
7538
7539
  name: `file-${random$1}-shared-fav-locked.txt`,
7540
+ workingCopyName: `file-${random$1}-shared-fav-locked (Working Copy).txt`,
7539
7541
  description: 'file shared, fav, not office, locked',
7540
7542
  contextMenu: consumerSharedFavContextMenu,
7541
7543
  toolbarPrimary: consumerSharedToolbarPrimary,
7542
7544
  toolbarMore: consumerFavToolbarMore,
7543
- viewerToolbarPrimary: consumerViewerSharedToolbarPrimary,
7544
- viewerToolbarMore: consumerViewerFavToolbarMore,
7545
+ viewerToolbarPrimary: consumerViewerLockedToolbarPrimary,
7546
+ viewerToolbarMore: consumerViewerLockedFavToolbarMore,
7547
+ workingCopyViewerToolbarMore: consumerViewerLockedToolbarMore,
7545
7548
  favoritesToolbarMore: favoritesConsumerToolbarMore,
7546
7549
  favoritesContextMenu: favoritesConsumerSharedContextMenu,
7547
7550
  sharedToolbarMore: sharedConsumerFavLockedToolbarMore,
@@ -7550,6 +7553,7 @@ const fileSharedFavLocked = {
7550
7553
  };
7551
7554
  const fileGranularPermission = `file-${random$1}-granular.txt`;
7552
7555
  const fileLockedByUser = `file-${random$1}-my-locked.txt`;
7556
+ const fileLockedByUserWorkingCopyName = `file-${random$1}-my-locked (Working Copy).txt`;
7553
7557
  // ---- non-versionable file (no cm:versionable aspect) ----
7554
7558
  const consumerNotVersionableToolbarMore = ['Favorite', 'Copy'];
7555
7559
  const consumerNotVersionableContextMenu = ['Share', 'Download', 'View', 'Favorite', 'Copy'];
@@ -7871,5 +7875,5 @@ const TEST_FILES = {
7871
7875
  * Generated bundle index. Do not edit.
7872
7876
  */
7873
7877
 
7874
- export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, EditDialog, EditModeComponent, ErrorComponent, FavoritesLibrariesPage, FavoritesPage, FavoritesPageApi, Field, FileActionsApi, FolderInformationDialogComponent, InfoDrawerComponent, LinkRulesDialog, 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, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, ViewerToolbarComponent, cleanupRepositoryTestData, collaboratorDocToolbarMore, collaboratorEditRowToolbarMore, collaboratorLockCurrentUserToolbarMore, collaboratorLockOtherUserSearchToolbarMore, collaboratorLockOtherUserToolbarMore, collaboratorSharedToolbarPrimary, collaboratorToolbarPrimary, createSuiteProjects, errorStrings, favoritesCollaboratorToolbarMore, file, fileDocx, fileDocxFav, fileDocxShared, fileDocxSharedFav, fileFav, fileFavLocked, fileGranularPermission, fileLocked, fileLockedByUser, fileNotVersionable, fileShared, fileSharedFav, fileSharedFavLocked, fileSharedLocked, flattenNodeContentTree, folder, folderFav, folderFav2, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, hasAccessibleAttribute, hasAccessibleName, isInteractiveElement, libraryErrors, logger, multipleSel, multipleSelAllFav, multipleSelFile, paths, random$1 as random, seedRepositoryTestData, test, testEmailDomain, timeouts, users, verifyDataTableAccessibility, verifyElementsHaveNames, verifyRegionAccessibleNames, waitForApi };
7878
+ export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, EditDialog, EditModeComponent, ErrorComponent, FavoritesLibrariesPage, FavoritesPage, FavoritesPageApi, Field, FileActionsApi, FolderInformationDialogComponent, InfoDrawerComponent, LinkRulesDialog, 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, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, ViewerToolbarComponent, cleanupRepositoryTestData, collaboratorDocToolbarMore, collaboratorEditRowToolbarMore, collaboratorLockCurrentUserToolbarMore, collaboratorLockOtherUserSearchToolbarMore, collaboratorLockOtherUserToolbarMore, collaboratorLockWorkingCopyToolbarMore, collaboratorLockedOriginalSharedViewerToolbarPrimary, collaboratorLockedSharedViewerToolbarMore, collaboratorLockedToolbarPrimary, collaboratorSharedToolbarPrimary, collaboratorSharedWorkingCopyToolbarPrimary, collaboratorToolbarPrimary, collaboratorWorkingCopyToolbarPrimary, createSuiteProjects, errorStrings, favoritesCheckedOutCollaboratorToolbarMore, favoritesCollaboratorToolbarMore, file, fileDocx, fileDocxFav, fileDocxShared, fileDocxSharedFav, fileFav, fileFavLocked, fileGranularPermission, fileLocked, fileLockedByUser, fileLockedByUserWorkingCopyName, fileNotVersionable, fileShared, fileSharedFav, fileSharedFavLocked, fileSharedLocked, flattenNodeContentTree, folder, folderFav, folderFav2, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, hasAccessibleAttribute, hasAccessibleName, isInteractiveElement, libraryErrors, lockedWorkingCopyToolbarMore, logger, multipleSel, multipleSelAllFav, multipleSelFile, paths, random$1 as random, seedRepositoryTestData, test, testEmailDomain, timeouts, users, verifyDataTableAccessibility, verifyElementsHaveNames, verifyRegionAccessibleNames, waitForApi };
7875
7879
  //# sourceMappingURL=alfresco-aca-playwright-shared.mjs.map