a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a'];
+
+ for (const specialFolderName of nameWithSpecialChars) {
+ await createFolderFromTemplateDialog.getDialogLabel(nameLabel).fill(specialFolderName);
+ await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString);
+ await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(specialFolderName);
+ expect
+ .soft(
+ await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameWithSpecialCharactersError),
+ errorStrings.errorMessageNotPresent
+ )
+ .toBe(true);
+ await expect(createFolderFromTemplateDialog.createButton).toBeDisabled();
+ }
+ });
+
+ test('[C325145] Folder name ending with a dot', async () => {
+ await createFolderFromTemplateDialog.getDialogLabel(nameLabel).type(dotString);
+ await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString);
+ await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(templateFolder1 + dotString);
+ expect
+ .soft(await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameEndWithDotError), errorStrings.errorMessageNotPresent)
+ .toBe(true);
+ await expect(createFolderFromTemplateDialog.createButton).toBeDisabled();
+ });
+
+ test('[C325146] Folder name containing only spaces', async () => {
+ await createFolderFromTemplateDialog.getDialogLabel(nameLabel).clear();
+ await createFolderFromTemplateDialog.getDialogLabel(nameLabel).fill(spaceString);
+ await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString);
+ await expect(createFolderFromTemplateDialog.getDialogLabel(nameLabel)).toHaveValue(spaceString);
+ expect
+ .soft(
+ await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.nameContainOnlySpacesError),
+ errorStrings.errorMessageNotPresent
+ )
+ .toBe(true);
+ await expect(createFolderFromTemplateDialog.createButton).toBeDisabled();
+ });
+
+ test('[C325141] Title too long', async () => {
+ await createFolderFromTemplateDialog.getDialogLabel(titleLabel).fill(Utils.string257Long);
+ await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString);
+ await expect(createFolderFromTemplateDialog.getDialogLabel(titleLabel)).toHaveValue(Utils.string257Long);
+ expect
+ .soft(await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.titleLengthLimitError), errorStrings.errorMessageNotPresent)
+ .toBe(true);
+ await expect(createFolderFromTemplateDialog.createButton).toBeDisabled();
+ });
+
+ test('[C325140] Description too long', async () => {
+ await createFolderFromTemplateDialog.getDialogLabel(descriptionLabel).fill(Utils.string513Long);
+ await createFolderFromTemplateDialog.page.keyboard.press(tabKeyString);
+ await expect(createFolderFromTemplateDialog.getDialogLabel(descriptionLabel)).toHaveValue(Utils.string513Long);
+ expect
+ .soft(
+ await createFolderFromTemplateDialog.isErrorMessageDisplayed(errorStrings.descriptionLengthLimitError),
+ errorStrings.errorMessageNotPresent
+ )
+ .toBe(true);
+ await expect(createFolderFromTemplateDialog.createButton).toBeDisabled();
+ });
+
+ test('[C325156] Create a folder with a duplicate name', async ({ personalFiles }) => {
+ const snackBar = personalFiles.snackBar;
+
+ await createFolderFromTemplateDialog.createNewFolderFromTemplate(commonFolderName);
+ await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible();
+ await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
+ });
+
+ test('[C325155] Cancel folder creation', async () => {
+ await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
+ await createFolderFromTemplateDialog.cancelButton.click();
+ await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible();
+ });
+ });
+
+ test.describe('Folder created from template on Personal Files', () => {
+ test.beforeEach(async ({ personalFiles }) => {
+ randomFolderName = `playwright-folder-${Utils.random()}`;
+ randomFolderTitle = `folder-title-${Utils.random()}`;
+ randomFolderDescription = `folder-description-${Utils.random()}`;
+ createFolderFromTemplateDialog = personalFiles.createFromTemplateDialogComponent;
+ await dataTable.getRowByName(templateFolder1).click();
+ await selectFolderTemplateDialog.actionButton.click();
+ });
+
+ test.afterEach(async () => {
+ const nodesApi = await NodesApi.initialize('hruser');
+ folderId = await nodesApi.getNodeIdFromParent(randomFolderName, '-my-');
+ await nodesApi.deleteNodeById(folderId);
+ });
+
+ test('[C325157] Create a folder from a template - with a new Name', async () => {
+ await createFolderFromTemplateDialog.createNewFolderFromTemplate(randomFolderName);
+ await dataTable.goThroughPagesLookingForRowWithName(randomFolderName);
+ await expect(dataTable.getRowByName(randomFolderName)).toBeVisible();
+
+ await dataTable.getRowByName(randomFolderName).dblclick();
+ await expect(dataTable.getRowByName(templateSubFolder)).toBeVisible();
+ await expect(dataTable.getRowByName(fileInFolder1)).toBeVisible();
+ });
+
+ test('[C325154] Create a folder from a template - with a Name, Title and Description', async () => {
+ await createFolderFromTemplateDialog.createNewFolderFromTemplate(randomFolderName, randomFolderTitle, randomFolderDescription);
+ await dataTable.goThroughPagesLookingForRowWithName(randomFolderName);
+ await expect(dataTable.getCellLinkByName(randomFolderName)).toHaveAttribute(titleLabel, randomFolderTitle + `\n` + randomFolderDescription);
+ });
+
+ test('[C325158] Trim spaces from folder Name', async () => {
+ await createFolderFromTemplateDialog.createNewFolderFromTemplate(' ' + randomFolderName + ' ');
+ await dataTable.goThroughPagesLookingForRowWithName(randomFolderName);
+ await expect(dataTable.getRowByName(randomFolderName)).toBeVisible();
+ });
+ });
+ });
+
+ test.describe('Folder created from template on Personal Files Libraries', () => {
+ const randomLibraryName = `playwright-library-${Utils.random()}`;
+
+ test.beforeAll(async ({ sitesApiAction, nodesApiAction }) => {
+ await sitesApiAction.createSite(randomLibraryName);
+ const libraryGuId = await sitesApiAction.getDocLibId(randomLibraryName);
+ await nodesApiAction.createFolder(commonFolderName, libraryGuId);
+ });
+
+ test.beforeEach(async ({ myLibrariesPage }) => {
+ randomFolderName = `playwright-folder-${Utils.random()}`;
+ randomFolderTitle = `folder-title-${Utils.random()}`;
+ randomFolderDescription = `folder-description-${Utils.random()}`;
+ await myLibrariesPage.navigate();
+ selectFolderTemplateDialog = myLibrariesPage.contentNodeSelector;
+ createFolderFromTemplateDialog = myLibrariesPage.createFromTemplateDialogComponent;
+ dataTable = myLibrariesPage.dataTable;
+ toolbar = myLibrariesPage.acaHeader;
+ await dataTable.goThroughPagesLookingForRowWithName(randomLibraryName);
+ await dataTable.getRowByName(randomLibraryName).dblclick();
+ await dataTable.spinnerWaitForReload();
+ await toolbar.clickCreateFolderFromTemplate();
+ await dataTable.getRowByName(templateFolder1).click();
+ await selectFolderTemplateDialog.actionButton.click();
+ });
+
+ test.afterAll(async ({ sitesApiAction }) => {
+ await sitesApiAction.deleteSites([randomLibraryName]);
+ });
+
+ test('[C325161] Create a folder from a template from library - with Name, Title and Description', async () => {
+ await createFolderFromTemplateDialog.createNewFolderFromTemplate(randomFolderName, randomFolderTitle, randomFolderDescription);
+ await expect
+ .soft(dataTable.getCellLinkByName(randomFolderName))
+ .toHaveAttribute(titleLabel, randomFolderTitle + `\n` + randomFolderDescription);
+
+ await dataTable.getRowByName(randomFolderName).dblclick();
+ await expect(dataTable.getRowByName(templateSubFolder)).toBeVisible();
+ await expect(dataTable.getRowByName(fileInFolder1)).toBeVisible();
+ });
+
+ test('[C325162] Cancel folder creation in a library', async () => {
+ await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
+ await createFolderFromTemplateDialog.cancelButton.click();
+ await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).not.toBeVisible();
+ await expect(dataTable.getRowByName(randomFolderName)).not.toBeVisible();
+ });
+
+ test('[C325163] Create a folder with a duplicate name in a library', async ({ myLibrariesPage }) => {
+ const snackBar = myLibrariesPage.snackBar;
+
+ await createFolderFromTemplateDialog.createNewFolderFromTemplate(commonFolderName);
+ await expect(snackBar.getByMessageLocator(errorStrings.nameAlreadyUsedError)).toBeVisible();
+ await expect(createFolderFromTemplateDialog.getDialogTitle(createDialogTitle)).toBeVisible();
+ });
+ });
+});
diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json
index effe33632b..62a5082678 100644
--- a/e2e/protractor/protractor.excludes.json
+++ b/e2e/protractor/protractor.excludes.json
@@ -17,5 +17,27 @@
"C279220": "will be fixed after protractor to playwright migration, see https://alfresco.atlassian.net/browse/ACS-5007",
"C279221": "will be fixed after protractor to playwright migration, see https://alfresco.atlassian.net/browse/ACS-5007",
"C325006": "will be fixed after protractor to playwright migration, see https://alfresco.atlassiana.net/browse/ACS-5007",
- "C213097": "https://alfresco.atlassian.net/browse/ACS-5479"
+ "C213097": "https://alfresco.atlassian.net/browse/ACS-5479",
+ "C325147" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325148" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325149" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325150" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325153" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325151" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325139" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325142" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325143" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325144" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325145" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325146" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325141" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325140" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325157" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325154" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325156" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325155" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325158" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325161" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325162" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678",
+ "C325163" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5678"
}
diff --git a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html
index 993f504035..f05cda4add 100644
--- a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html
+++ b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.html
@@ -42,7 +42,7 @@
-