mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Build(deps-dev): Bump @playwright/test from 1.37.1 to 1.42.1 (#3682)
* Build(deps-dev): Bump @playwright/test from 1.37.1 to 1.42.1 Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.37.1 to 1.42.1. - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.37.1...v1.42.1) --- updated-dependencies: - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Playwright 1.42.1 upstream - fixed info-drawer tests * Playwright 1.42.1 upstream - fixed copy-move-actions tests * @datguychen Playwright 1.42.1 upstream - fixed library-actions tests * Playwright 1.42.1 upstream - SonarCloud fix 1 * Playwright 1.42.1 upstream - review fix 1 * Playwright 1.42.1 upstream - review fix 2 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: datguychen <adam.swiderski@hyland.com>
This commit is contained in:
@@ -88,6 +88,7 @@ test.describe('Copy actions', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test('[C217135] Copy a file', async ({ personalFiles }) => {
|
test('[C217135] Copy a file', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
@@ -96,6 +97,7 @@ test.describe('Copy actions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C291888] Copy a folder with content', async ({ personalFiles }) => {
|
test('[C291888] Copy a folder with content', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
@@ -107,11 +109,13 @@ test.describe('Copy actions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C291889] Copy multiple items', async ({ personalFiles }) => {
|
test('[C291889] Copy multiple items', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder, sourceFile], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFolder, sourceFile], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
await personalFiles.spinner.waitForReload();
|
await personalFiles.spinner.waitForReload();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
expect(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
});
|
});
|
||||||
@@ -119,6 +123,7 @@ test.describe('Copy actions', () => {
|
|||||||
test('[C217137] Copy a file with a name that already exists on the destination', async ({ personalFiles }) => {
|
test('[C217137] Copy a file with a name that already exists on the destination', async ({ personalFiles }) => {
|
||||||
await nodesApi.createFile(sourceFile, destinationFolderId);
|
await nodesApi.createFile(sourceFile, destinationFolderId);
|
||||||
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
@@ -131,6 +136,7 @@ test.describe('Copy actions', () => {
|
|||||||
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
||||||
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
||||||
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
@@ -145,6 +151,7 @@ test.describe('Copy actions', () => {
|
|||||||
test('[C217139] Copy locked file', async ({ personalFiles }) => {
|
test('[C217139] Copy locked file', async ({ personalFiles }) => {
|
||||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||||
await nodesApi.lockNodes([sourceFileId], lockType);
|
await nodesApi.lockNodes([sourceFileId], lockType);
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
@@ -155,6 +162,7 @@ test.describe('Copy actions', () => {
|
|||||||
test('[C217140] Copy folder that contains locked file', async ({ personalFiles }) => {
|
test('[C217140] Copy folder that contains locked file', async ({ personalFiles }) => {
|
||||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||||
await nodesApi.lockNodes([sourceFileInsideFolderId], lockType);
|
await nodesApi.lockNodes([sourceFileInsideFolderId], lockType);
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
@@ -166,6 +174,7 @@ test.describe('Copy actions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C217171] Undo copy of files', async ({ personalFiles }) => {
|
test('[C217171] Undo copy of files', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
await personalFiles.snackBar.actionButton.click();
|
await personalFiles.snackBar.actionButton.click();
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
@@ -175,6 +184,7 @@ test.describe('Copy actions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C217172] Undo copy of folders', async ({ personalFiles }) => {
|
test('[C217172] Undo copy of folders', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
await personalFiles.snackBar.actionButton.click();
|
await personalFiles.snackBar.actionButton.click();
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
@@ -186,6 +196,7 @@ test.describe('Copy actions', () => {
|
|||||||
test('[C217173] Undo copy of a file when a file with same name already exists on the destination', async ({ personalFiles }) => {
|
test('[C217173] Undo copy of a file when a file with same name already exists on the destination', async ({ personalFiles }) => {
|
||||||
await nodesApi.createFile(sourceFile, destinationFolderId);
|
await nodesApi.createFile(sourceFile, destinationFolderId);
|
||||||
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
await personalFiles.snackBar.actionButton.click();
|
await personalFiles.snackBar.actionButton.click();
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
@@ -199,6 +210,7 @@ test.describe('Copy actions', () => {
|
|||||||
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
||||||
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
||||||
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
await personalFiles.snackBar.actionButton.click();
|
await personalFiles.snackBar.actionButton.click();
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
|
@@ -22,21 +22,26 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ApiClientFactory, test, Utils, PersonalFilesPage, NodesApi, LoginPage } from '@alfresco/playwright-shared';
|
import { ApiClientFactory, test, Utils, PersonalFilesPage, NodesApi, LoginPage, TrashcanApi } from '@alfresco/playwright-shared';
|
||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
|
|
||||||
test.describe('Move actions', () => {
|
test.describe('Move actions', () => {
|
||||||
let nodesApi: NodesApi;
|
let nodesApi: NodesApi;
|
||||||
|
let trashcanApi: TrashcanApi;
|
||||||
const username = `user-${Utils.random()}`;
|
const username = `user-${Utils.random()}`;
|
||||||
|
|
||||||
|
let sourceFileId: string;
|
||||||
|
let sourceFileInsideFolderId: string;
|
||||||
|
let destinationFolderId: string;
|
||||||
|
|
||||||
let sourceFile: string;
|
let sourceFile: string;
|
||||||
let sourceFileInsideFolder: string;
|
let sourceFileInsideFolder: string;
|
||||||
let sourceFolder: string;
|
let sourceFolder: string;
|
||||||
let destinationFolder: string;
|
let destinationFolder: string;
|
||||||
|
|
||||||
let sourceFileId: string;
|
test.afterAll(async ({ nodesApiAction }) => {
|
||||||
let sourceFileInsideFolderId: string;
|
await Utils.deleteNodesSitesEmptyTrashcan(nodesApiAction, trashcanApi, 'afterAll failed');
|
||||||
let destinationFolderId: string;
|
});
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
try {
|
try {
|
||||||
@@ -47,12 +52,6 @@ test.describe('Move actions', () => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ nodesApiAction }) => {
|
|
||||||
try {
|
|
||||||
await nodesApiAction.deleteCurrentUserNodes();
|
|
||||||
} catch {}
|
|
||||||
});
|
|
||||||
|
|
||||||
test.beforeEach(async ({ personalFiles, page }) => {
|
test.beforeEach(async ({ personalFiles, page }) => {
|
||||||
sourceFile = `source-file-${Utils.random()}.txt`;
|
sourceFile = `source-file-${Utils.random()}.txt`;
|
||||||
sourceFileInsideFolder = `source-file-inside-folder-${Utils.random()}.txt`;
|
sourceFileInsideFolder = `source-file-inside-folder-${Utils.random()}.txt`;
|
||||||
@@ -60,21 +59,13 @@ test.describe('Move actions', () => {
|
|||||||
destinationFolder = `destination-folder-${Utils.random()}`;
|
destinationFolder = `destination-folder-${Utils.random()}`;
|
||||||
|
|
||||||
const loginPage = new LoginPage(page);
|
const loginPage = new LoginPage(page);
|
||||||
try {
|
await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed');
|
||||||
await loginPage.loginUser(
|
|
||||||
{ username, password: username },
|
|
||||||
{
|
|
||||||
withNavigation: true,
|
|
||||||
waitForLoading: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
destinationFolderId = (await nodesApi.createFolder(destinationFolder)).entry.id;
|
destinationFolderId = (await nodesApi.createFolder(destinationFolder)).entry.id;
|
||||||
const sourceFolderId = (await nodesApi.createFolder(sourceFolder)).entry.id;
|
const sourceFolderId = (await nodesApi.createFolder(sourceFolder)).entry.id;
|
||||||
sourceFileInsideFolderId = (await nodesApi.createFile(sourceFileInsideFolder, sourceFolderId)).entry.id;
|
sourceFileInsideFolderId = (await nodesApi.createFile(sourceFileInsideFolder, sourceFolderId)).entry.id;
|
||||||
sourceFileId = (await nodesApi.createFile(sourceFile)).entry.id;
|
sourceFileId = (await nodesApi.createFile(sourceFile)).entry.id;
|
||||||
|
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
} catch {}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const moveContentInPersonalFiles = async (personalFilesPage: PersonalFilesPage, sourceFileList: string[], destinationName: string) => {
|
const moveContentInPersonalFiles = async (personalFilesPage: PersonalFilesPage, sourceFileList: string[], destinationName: string) => {
|
||||||
@@ -83,6 +74,7 @@ test.describe('Move actions', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test('[C217316] Move a file', async ({ personalFiles }) => {
|
test('[C217316] Move a file', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
const msg = await personalFiles.snackBar.message.innerText();
|
||||||
expect.soft(msg).toContain('Moved 1 item.');
|
expect.soft(msg).toContain('Moved 1 item.');
|
||||||
@@ -92,19 +84,8 @@ test.describe('Move actions', () => {
|
|||||||
expect(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C217317] Move a folder with content', async ({ personalFiles }) => {
|
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
|
||||||
expect.soft(msg).toContain('Moved 1 item.');
|
|
||||||
await personalFiles.snackBar.closeIcon.click();
|
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeFalsy();
|
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(sourceFolder);
|
|
||||||
expect(await personalFiles.dataTable.isItemPresent(sourceFileInsideFolder)).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('[C291958] Move multiple items', async ({ personalFiles }) => {
|
test('[C291958] Move multiple items', async ({ personalFiles }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder, sourceFile], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFolder, sourceFile], destinationFolder);
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
const msg = await personalFiles.snackBar.message.innerText();
|
||||||
expect.soft(msg).toContain('Moved 2 items.');
|
expect.soft(msg).toContain('Moved 2 items.');
|
||||||
@@ -119,6 +100,7 @@ test.describe('Move actions', () => {
|
|||||||
test('[C217318] Move a file with a name that already exists on the destination', async ({ personalFiles }) => {
|
test('[C217318] Move a file with a name that already exists on the destination', async ({ personalFiles }) => {
|
||||||
await nodesApi.createFile(sourceFile, destinationFolderId);
|
await nodesApi.createFile(sourceFile, destinationFolderId);
|
||||||
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
const msg = await personalFiles.snackBar.message.innerText();
|
||||||
expect.soft(msg).toContain('Move unsuccessful, a file with the same name already exists.');
|
expect.soft(msg).toContain('Move unsuccessful, a file with the same name already exists.');
|
||||||
@@ -133,6 +115,7 @@ test.describe('Move actions', () => {
|
|||||||
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
||||||
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
||||||
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
const msg = await personalFiles.snackBar.message.innerText();
|
||||||
expect.soft(msg).toContain('Move unsuccessful, a file with the same name already exists.');
|
expect.soft(msg).toContain('Move unsuccessful, a file with the same name already exists.');
|
||||||
@@ -148,6 +131,7 @@ test.describe('Move actions', () => {
|
|||||||
test('[C217320] Move locked file', async ({ personalFiles }) => {
|
test('[C217320] Move locked file', async ({ personalFiles }) => {
|
||||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||||
await nodesApi.lockNodes([sourceFileId], lockType);
|
await nodesApi.lockNodes([sourceFileId], lockType);
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
const msg = await personalFiles.snackBar.message.innerText();
|
||||||
expect.soft(msg).toContain('Moved 1 item.');
|
expect.soft(msg).toContain('Moved 1 item.');
|
||||||
@@ -157,21 +141,8 @@ test.describe('Move actions', () => {
|
|||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C217321] Move folder that contains locked file', async ({ personalFiles }) => {
|
|
||||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
|
||||||
await nodesApi.lockNodes([sourceFileInsideFolderId], lockType);
|
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
|
||||||
const msg = await personalFiles.snackBar.message.innerText();
|
|
||||||
expect.soft(msg).toContain('Moved 1 item.');
|
|
||||||
await personalFiles.snackBar.closeIcon.click();
|
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeFalsy();
|
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
|
||||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(sourceFolder);
|
|
||||||
expect(await personalFiles.dataTable.isItemPresent(sourceFileInsideFolder)).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('[C217324] Undo move files', async ({ personalFiles, trashPage }) => {
|
test('[C217324] Undo move files', async ({ personalFiles, trashPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||||
await personalFiles.snackBar.actionButton.click();
|
await personalFiles.snackBar.actionButton.click();
|
||||||
await personalFiles.spinner.waitForReload();
|
await personalFiles.spinner.waitForReload();
|
||||||
@@ -183,6 +154,7 @@ test.describe('Move actions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C217325] Undo move of folders', async ({ personalFiles, trashPage }) => {
|
test('[C217325] Undo move of folders', async ({ personalFiles, trashPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
await personalFiles.snackBar.actionButton.click();
|
await personalFiles.snackBar.actionButton.click();
|
||||||
await personalFiles.spinner.waitForReload();
|
await personalFiles.spinner.waitForReload();
|
||||||
@@ -192,4 +164,38 @@ test.describe('Move actions', () => {
|
|||||||
await trashPage.navigate();
|
await trashPage.navigate();
|
||||||
expect(await trashPage.dataTable.isItemPresent(sourceFolder)).toBeFalsy();
|
expect(await trashPage.dataTable.isItemPresent(sourceFolder)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function moveFolderWithContent(personalFiles: PersonalFilesPage, lockedFile: boolean) {
|
||||||
|
if (lockedFile) {
|
||||||
|
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||||
|
await nodesApi.lockNodes([sourceFileInsideFolderId], lockType);
|
||||||
|
}
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||||
|
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||||
|
const msg = await personalFiles.snackBar.message.innerText();
|
||||||
|
expect.soft(msg).toContain('Moved 1 item.');
|
||||||
|
await personalFiles.snackBar.closeIcon.click();
|
||||||
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeFalsy();
|
||||||
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||||
|
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||||
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(sourceFolder);
|
||||||
|
expect(await personalFiles.dataTable.isItemPresent(sourceFileInsideFolder)).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
id: 'C217317',
|
||||||
|
testTitle: `Move a folder with content`,
|
||||||
|
lockedFile: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'C217321',
|
||||||
|
testTitle: 'Move folder that contains locked file',
|
||||||
|
lockedFile: true
|
||||||
|
}
|
||||||
|
].forEach((testCase) => {
|
||||||
|
test(`[${testCase.id}] ${testCase.testTitle}`, async ({ personalFiles }) => {
|
||||||
|
await moveFolderWithContent(personalFiles, testCase.lockedFile);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -60,6 +60,7 @@ test.describe('Info Drawer - Comments', () => {
|
|||||||
await nodesApi.createFolder(personalFolderName);
|
await nodesApi.createFolder(personalFolderName);
|
||||||
await fileActionsApi.waitForNodes(personalFolderName, { expect: 1 });
|
await fileActionsApi.waitForNodes(personalFolderName, { expect: 1 });
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, personalFolderName);
|
||||||
await expect(personalFiles.dataTable.getRowByName(personalFolderName)).toBeVisible();
|
await expect(personalFiles.dataTable.getRowByName(personalFolderName)).toBeVisible();
|
||||||
await personalFiles.dataTable.getRowByName(personalFolderName).click();
|
await personalFiles.dataTable.getRowByName(personalFolderName).click();
|
||||||
await personalFiles.acaHeader.viewDetails.click();
|
await personalFiles.acaHeader.viewDetails.click();
|
||||||
|
@@ -57,6 +57,7 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
|||||||
await nodesApi.createFolder(defaultTabsFolderName);
|
await nodesApi.createFolder(defaultTabsFolderName);
|
||||||
await fileActionsApi.waitForNodes(defaultTabsFolderName, { expect: 1 });
|
await fileActionsApi.waitForNodes(defaultTabsFolderName, { expect: 1 });
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, defaultTabsFolderName);
|
||||||
await expect(personalFiles.dataTable.getRowByName(defaultTabsFolderName)).toBeVisible();
|
await expect(personalFiles.dataTable.getRowByName(defaultTabsFolderName)).toBeVisible();
|
||||||
await personalFiles.dataTable.getRowByName(defaultTabsFolderName).click();
|
await personalFiles.dataTable.getRowByName(defaultTabsFolderName).click();
|
||||||
await personalFiles.acaHeader.viewDetails.click();
|
await personalFiles.acaHeader.viewDetails.click();
|
||||||
@@ -72,6 +73,7 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
|||||||
await nodesApi.createFolder(expandDetailsFolderName);
|
await nodesApi.createFolder(expandDetailsFolderName);
|
||||||
await fileActionsApi.waitForNodes(expandDetailsFolderName, { expect: 1 });
|
await fileActionsApi.waitForNodes(expandDetailsFolderName, { expect: 1 });
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, expandDetailsFolderName);
|
||||||
await expect(personalFiles.dataTable.getRowByName(expandDetailsFolderName)).toBeVisible();
|
await expect(personalFiles.dataTable.getRowByName(expandDetailsFolderName)).toBeVisible();
|
||||||
await personalFiles.dataTable.getRowByName(expandDetailsFolderName).click();
|
await personalFiles.dataTable.getRowByName(expandDetailsFolderName).click();
|
||||||
await personalFiles.acaHeader.viewDetails.click();
|
await personalFiles.acaHeader.viewDetails.click();
|
||||||
|
@@ -70,6 +70,7 @@ test.describe('File preview', () => {
|
|||||||
await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileName, '-my-');
|
await fileActionsApi.uploadFileWithRename(TEST_FILES.PDF.path, fileName, '-my-');
|
||||||
await fileActionsApi.waitForNodes(fileName, { expect: 1 });
|
await fileActionsApi.waitForNodes(fileName, { expect: 1 });
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, fileName);
|
||||||
await personalFiles.dataTable.getRowByName(fileName).click();
|
await personalFiles.dataTable.getRowByName(fileName).click();
|
||||||
await personalFiles.acaHeader.viewButton.click();
|
await personalFiles.acaHeader.viewButton.click();
|
||||||
await checkFileContent(personalFiles.page, 1, 'This is a small demonstration');
|
await checkFileContent(personalFiles.page, 1, 'This is a small demonstration');
|
||||||
|
@@ -63,6 +63,7 @@ test.describe('Info Drawer - General', () => {
|
|||||||
await nodesApi.createFolder(folder1, parentId);
|
await nodesApi.createFolder(folder1, parentId);
|
||||||
await fileActionsApi.waitForNodes(file1, { expect: 1 });
|
await fileActionsApi.waitForNodes(file1, { expect: 1 });
|
||||||
await personalFiles.navigate();
|
await personalFiles.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(personalFiles, parentFolder);
|
||||||
await expect(personalFiles.dataTable.getRowByName(parentFolder)).toBeVisible();
|
await expect(personalFiles.dataTable.getRowByName(parentFolder)).toBeVisible();
|
||||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(parentFolder);
|
await personalFiles.dataTable.performClickFolderOrFileToOpen(parentFolder);
|
||||||
await personalFiles.dataTable.selectItem(file1);
|
await personalFiles.dataTable.selectItem(file1);
|
||||||
|
@@ -182,6 +182,7 @@ test.describe('Library properties', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C289343] Site description too long', async ({ myLibrariesPage }) => {
|
test('[C289343] Site description too long', async ({ myLibrariesPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, site.name);
|
||||||
await myLibrariesPage.dataTable.getRowByName(site.name).click();
|
await myLibrariesPage.dataTable.getRowByName(site.name).click();
|
||||||
await myLibrariesPage.acaHeader.viewDetails.click();
|
await myLibrariesPage.acaHeader.viewDetails.click();
|
||||||
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
|
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
|
||||||
|
@@ -34,9 +34,7 @@ const config: PlaywrightTestConfig<CustomConfig> = {
|
|||||||
{
|
{
|
||||||
name: 'Library Actions',
|
name: 'Library Actions',
|
||||||
testDir: './src/tests',
|
testDir: './src/tests',
|
||||||
use: {
|
use: {}
|
||||||
users: ['hruser']
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@@ -90,7 +90,7 @@ test.describe('Library actions ', () => {
|
|||||||
let user2SitesApi: SitesApi;
|
let user2SitesApi: SitesApi;
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
test.setTimeout(timeouts.extendedLongTest);
|
test.setTimeout(timeouts.globalSpec);
|
||||||
const apiClientFactory = new ApiClientFactory();
|
const apiClientFactory = new ApiClientFactory();
|
||||||
const username1 = `user-${Utils.random()}`;
|
const username1 = `user-${Utils.random()}`;
|
||||||
const siteRoles = [
|
const siteRoles = [
|
||||||
@@ -184,7 +184,8 @@ test.describe('Library actions ', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C290106] Leave a library from My Libraries', async () => {
|
test('[C290106] Leave a library from My Libraries', async ({ myLibrariesPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, user1Library1);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library1, managerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library1, managerRole)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(user1Library1, leaveLibraryButton);
|
await libraryTable.performActionFromExpandableMenu(user1Library1, leaveLibraryButton);
|
||||||
await expect.soft(confirmDialog.getDialogTitle('Leave this library?')).toBeVisible();
|
await expect.soft(confirmDialog.getDialogTitle('Leave this library?')).toBeVisible();
|
||||||
@@ -196,14 +197,16 @@ test.describe('Library actions ', () => {
|
|||||||
await expect(libraryTable.getRowByName(user1Library1)).not.toBeVisible();
|
await expect(libraryTable.getRowByName(user1Library1)).not.toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C290111] Cancel Leave Library', async () => {
|
test('[C290111] Cancel Leave Library', async ({ myLibrariesPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, user1Library5);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library5, managerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library5, managerRole)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(user1Library5, leaveLibraryButton);
|
await libraryTable.performActionFromExpandableMenu(user1Library5, leaveLibraryButton);
|
||||||
await confirmDialog.cancelButton.click();
|
await confirmDialog.cancelButton.click();
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library5, managerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library5, managerRole)).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C290107] Leave a library - failure notification', async () => {
|
test('[C290107] Leave a library - failure notification', async ({ myLibrariesPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, user2Library1);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(user2Library1, leaveLibraryButton);
|
await libraryTable.performActionFromExpandableMenu(user2Library1, leaveLibraryButton);
|
||||||
await confirmDialog.okButton.click();
|
await confirmDialog.okButton.click();
|
||||||
@@ -211,7 +214,8 @@ test.describe('Library actions ', () => {
|
|||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user2Library1, managerRole)).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C289974] Mark library as favorite from My Libraries', async () => {
|
test('[C289974] Mark library as favorite from My Libraries', async ({ myLibrariesPage }) => {
|
||||||
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, adminLibrary3);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary3, contributorRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary3, contributorRole)).toBeVisible();
|
||||||
await libraryTable.getCellByColumnNameAndRowItem(adminLibrary3, contributorRole).click();
|
await libraryTable.getCellByColumnNameAndRowItem(adminLibrary3, contributorRole).click();
|
||||||
await myLibrariesHeader.clickMoreActions();
|
await myLibrariesHeader.clickMoreActions();
|
||||||
@@ -221,7 +225,7 @@ test.describe('Library actions ', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('[C289975] Remove library from favorites from My Libraries', async ({ myLibrariesPage }) => {
|
test('[C289975] Remove library from favorites from My Libraries', async ({ myLibrariesPage }) => {
|
||||||
await myLibrariesPage.reload({ waitUntil: domContentLoadedString });
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, user2Library2);
|
||||||
await expect(libraryTable.getRowByName(user2Library2)).toBeVisible();
|
await expect(libraryTable.getRowByName(user2Library2)).toBeVisible();
|
||||||
await libraryTable.getRowByName(user2Library2).click();
|
await libraryTable.getRowByName(user2Library2).click();
|
||||||
await myLibrariesPage.page.waitForTimeout(1000);
|
await myLibrariesPage.page.waitForTimeout(1000);
|
||||||
@@ -232,9 +236,10 @@ test.describe('Library actions ', () => {
|
|||||||
expect(await libraryMenu.isMenuItemVisible(favoriteButton)).toBe(true);
|
expect(await libraryMenu.isMenuItemVisible(favoriteButton)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C289988] Delete a library from My Libraries', async ({ trashPage }) => {
|
test('[C289988] Delete a library from My Libraries', async ({ trashPage, myLibrariesPage }) => {
|
||||||
const trashTable = trashPage.dataTable;
|
const trashTable = trashPage.dataTable;
|
||||||
|
|
||||||
|
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, user2Library5Delete);
|
||||||
await expect(libraryTable.getRowByName(user2Library5Delete)).toBeVisible();
|
await expect(libraryTable.getRowByName(user2Library5Delete)).toBeVisible();
|
||||||
await libraryTable.getRowByName(user2Library5Delete).click();
|
await libraryTable.getRowByName(user2Library5Delete).click();
|
||||||
await myLibrariesHeader.clickMoreActions();
|
await myLibrariesHeader.clickMoreActions();
|
||||||
@@ -264,6 +269,7 @@ test.describe('Library actions ', () => {
|
|||||||
test('[C290105] Join a public library from Favorite Libraries', async ({ favoriteLibrariesPage }) => {
|
test('[C290105] Join a public library from Favorite Libraries', async ({ favoriteLibrariesPage }) => {
|
||||||
await favoritesApi.addFavoriteById(siteString, adminLibrary1);
|
await favoritesApi.addFavoriteById(siteString, adminLibrary1);
|
||||||
await favoriteLibrariesPage.navigate();
|
await favoriteLibrariesPage.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, adminLibrary1);
|
||||||
await libraryTable.performActionFromExpandableMenu(adminLibrary1, joinButton);
|
await libraryTable.performActionFromExpandableMenu(adminLibrary1, joinButton);
|
||||||
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).toBeVisible();
|
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).toBeVisible();
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary1, consumerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary1, consumerRole)).toBeVisible();
|
||||||
@@ -272,12 +278,13 @@ test.describe('Library actions ', () => {
|
|||||||
test('[C290109] Join a moderated library from Favorite Libraries', async ({ favoriteLibrariesPage }) => {
|
test('[C290109] Join a moderated library from Favorite Libraries', async ({ favoriteLibrariesPage }) => {
|
||||||
await favoritesApi.addFavoriteById(siteString, adminModerateLibrary1);
|
await favoritesApi.addFavoriteById(siteString, adminModerateLibrary1);
|
||||||
await favoriteLibrariesPage.navigate();
|
await favoriteLibrariesPage.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, adminModerateLibrary1);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary1, joinButton);
|
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary1, joinButton);
|
||||||
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible();
|
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible();
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
|
||||||
await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary1, username2);
|
await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary1, username2);
|
||||||
await favoriteLibrariesPage.navigate();
|
await favoriteLibrariesPage.page.reload({ waitUntil: 'load' });
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, consumerRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, consumerRole)).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -285,6 +292,7 @@ test.describe('Library actions ', () => {
|
|||||||
const confirmDialog = favoriteLibrariesPage.confirmDialogComponent;
|
const confirmDialog = favoriteLibrariesPage.confirmDialogComponent;
|
||||||
await favoritesApi.addFavoriteById(siteString, user1Library2);
|
await favoritesApi.addFavoriteById(siteString, user1Library2);
|
||||||
await favoriteLibrariesPage.navigate();
|
await favoriteLibrariesPage.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, user1Library2);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, contributorRole)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, contributorRole)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(user1Library2, leaveLibraryButton);
|
await libraryTable.performActionFromExpandableMenu(user1Library2, leaveLibraryButton);
|
||||||
await confirmDialog.okButton.click();
|
await confirmDialog.okButton.click();
|
||||||
@@ -297,6 +305,7 @@ test.describe('Library actions ', () => {
|
|||||||
await favoritesApi.addFavoriteById(siteString, adminModerateLibrary3);
|
await favoritesApi.addFavoriteById(siteString, adminModerateLibrary3);
|
||||||
await favoriteLibrariesPage.navigate();
|
await favoriteLibrariesPage.navigate();
|
||||||
|
|
||||||
|
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, adminModerateLibrary3);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary3, notMemberString)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary3, notMemberString)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary3, cancelJoinRequestButton);
|
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary3, cancelJoinRequestButton);
|
||||||
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible();
|
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible();
|
||||||
@@ -309,6 +318,7 @@ test.describe('Library actions ', () => {
|
|||||||
const libraryMenu = favoriteLibrariesPage.matMenu;
|
const libraryMenu = favoriteLibrariesPage.matMenu;
|
||||||
|
|
||||||
await favoriteLibrariesPage.navigate({ waitUntil: domContentLoadedString });
|
await favoriteLibrariesPage.navigate({ waitUntil: domContentLoadedString });
|
||||||
|
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, user2Library3);
|
||||||
await expect(libraryTable.getRowByName(user2Library3)).toBeVisible();
|
await expect(libraryTable.getRowByName(user2Library3)).toBeVisible();
|
||||||
await libraryTable.getRowByName(user2Library3).click();
|
await libraryTable.getRowByName(user2Library3).click();
|
||||||
await myLibrariesHeader.clickMoreActions();
|
await myLibrariesHeader.clickMoreActions();
|
||||||
@@ -322,6 +332,7 @@ test.describe('Library actions ', () => {
|
|||||||
const trashTable = trashPage.dataTable;
|
const trashTable = trashPage.dataTable;
|
||||||
|
|
||||||
await favoriteLibrariesPage.navigate();
|
await favoriteLibrariesPage.navigate();
|
||||||
|
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, user2Library6Delete);
|
||||||
await expect(libraryTable.getRowByName(user2Library6Delete)).toBeVisible();
|
await expect(libraryTable.getRowByName(user2Library6Delete)).toBeVisible();
|
||||||
await libraryTable.getRowByName(user2Library6Delete).click();
|
await libraryTable.getRowByName(user2Library6Delete).click();
|
||||||
await myLibrariesHeader.clickMoreActions();
|
await myLibrariesHeader.clickMoreActions();
|
||||||
@@ -349,6 +360,7 @@ test.describe('Library actions ', () => {
|
|||||||
test('[C306959] Join a public library from Search Results', async ({ searchPage }) => {
|
test('[C306959] Join a public library from Search Results', async ({ searchPage }) => {
|
||||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminLibrary2}` });
|
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminLibrary2}` });
|
||||||
await searchPage.reload({ waitUntil: loadString });
|
await searchPage.reload({ waitUntil: loadString });
|
||||||
|
await Utils.reloadPageIfRowNotVisible(searchPage, adminLibrary2);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, notMemberString)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, notMemberString)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(adminLibrary2, joinButton);
|
await libraryTable.performActionFromExpandableMenu(adminLibrary2, joinButton);
|
||||||
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).toBeVisible();
|
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).toBeVisible();
|
||||||
@@ -357,6 +369,7 @@ test.describe('Library actions ', () => {
|
|||||||
|
|
||||||
test('[C306960] Join a moderated library from Search Results', async ({ myLibrariesPage, searchPage }) => {
|
test('[C306960] Join a moderated library from Search Results', async ({ myLibrariesPage, searchPage }) => {
|
||||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminModerateLibrary2}` });
|
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminModerateLibrary2}` });
|
||||||
|
await Utils.reloadPageIfRowNotVisible(searchPage, adminModerateLibrary2);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary2, joinButton);
|
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary2, joinButton);
|
||||||
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible();
|
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible();
|
||||||
@@ -370,6 +383,7 @@ test.describe('Library actions ', () => {
|
|||||||
const confirmDialog = searchPage.confirmDialogComponent;
|
const confirmDialog = searchPage.confirmDialogComponent;
|
||||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${user1Library3}` });
|
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${user1Library3}` });
|
||||||
|
|
||||||
|
await Utils.reloadPageIfRowNotVisible(searchPage, user1Library3);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, 'Collaborator')).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, 'Collaborator')).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(user1Library3, leaveLibraryButton);
|
await libraryTable.performActionFromExpandableMenu(user1Library3, leaveLibraryButton);
|
||||||
await confirmDialog.okButton.click();
|
await confirmDialog.okButton.click();
|
||||||
@@ -380,7 +394,7 @@ test.describe('Library actions ', () => {
|
|||||||
test('[C306962] Cancel join from Search Results', async ({ searchPage }) => {
|
test('[C306962] Cancel join from Search Results', async ({ searchPage }) => {
|
||||||
await user2SitesApi.createSiteMembershipRequestForPerson(username2, adminModerateLibrary4);
|
await user2SitesApi.createSiteMembershipRequestForPerson(username2, adminModerateLibrary4);
|
||||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminModerateLibrary4}` });
|
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminModerateLibrary4}` });
|
||||||
await searchPage.reload({ waitUntil: loadString });
|
await Utils.reloadPageIfRowNotVisible(searchPage, adminModerateLibrary4);
|
||||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary4, notMemberString)).toBeVisible();
|
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary4, notMemberString)).toBeVisible();
|
||||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary4, cancelJoinRequestButton);
|
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary4, cancelJoinRequestButton);
|
||||||
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible();
|
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible();
|
||||||
@@ -397,6 +411,7 @@ test.describe('Library actions ', () => {
|
|||||||
await searchPage.searchOverlay.searchLibrariesOption.click();
|
await searchPage.searchOverlay.searchLibrariesOption.click();
|
||||||
await searchPage.searchOverlay.searchFor(adminLibrary4);
|
await searchPage.searchOverlay.searchFor(adminLibrary4);
|
||||||
|
|
||||||
|
await Utils.reloadPageIfRowNotVisible(searchPage, adminLibrary4);
|
||||||
await expect(libraryTable.getRowByName(adminLibrary4)).toBeVisible();
|
await expect(libraryTable.getRowByName(adminLibrary4)).toBeVisible();
|
||||||
await libraryTable.getRowByName(adminLibrary4).click();
|
await libraryTable.getRowByName(adminLibrary4).click();
|
||||||
await myLibrariesHeader.clickMoreActions();
|
await myLibrariesHeader.clickMoreActions();
|
||||||
@@ -414,6 +429,7 @@ test.describe('Library actions ', () => {
|
|||||||
await searchPage.searchOverlay.searchLibrariesOption.click();
|
await searchPage.searchOverlay.searchLibrariesOption.click();
|
||||||
await searchPage.searchOverlay.searchFor(user2Library4);
|
await searchPage.searchOverlay.searchFor(user2Library4);
|
||||||
|
|
||||||
|
await Utils.reloadPageIfRowNotVisible(searchPage, user2Library4);
|
||||||
await expect(libraryTable.getRowByName(user2Library4)).toBeVisible();
|
await expect(libraryTable.getRowByName(user2Library4)).toBeVisible();
|
||||||
await searchPage.reload({ waitUntil: domContentLoadedString });
|
await searchPage.reload({ waitUntil: domContentLoadedString });
|
||||||
await libraryTable.getRowByName(user2Library4).click();
|
await libraryTable.getRowByName(user2Library4).click();
|
||||||
@@ -430,7 +446,7 @@ test.describe('Library actions ', () => {
|
|||||||
const trashTable = trashPage.dataTable;
|
const trashTable = trashPage.dataTable;
|
||||||
|
|
||||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${user2Library7Delete}` });
|
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${user2Library7Delete}` });
|
||||||
await searchPage.reload({ waitUntil: loadString });
|
await Utils.reloadPageIfRowNotVisible(searchPage, user2Library7Delete);
|
||||||
await expect(libraryTable.getRowByName(user2Library7Delete)).toBeVisible();
|
await expect(libraryTable.getRowByName(user2Library7Delete)).toBeVisible();
|
||||||
await libraryTable.getRowByName(user2Library7Delete).click();
|
await libraryTable.getRowByName(user2Library7Delete).click();
|
||||||
await searchHeader.clickMoreActions();
|
await searchHeader.clickMoreActions();
|
||||||
|
38
package-lock.json
generated
38
package-lock.json
generated
@@ -58,7 +58,7 @@
|
|||||||
"@nx/angular": "17.0.2",
|
"@nx/angular": "17.0.2",
|
||||||
"@nx/eslint-plugin": "17.0.2",
|
"@nx/eslint-plugin": "17.0.2",
|
||||||
"@nx/workspace": "17.0.2",
|
"@nx/workspace": "17.0.2",
|
||||||
"@playwright/test": "^1.37.1",
|
"@playwright/test": "^1.42.1",
|
||||||
"@schematics/angular": "14.1.2",
|
"@schematics/angular": "14.1.2",
|
||||||
"@types/event-emitter": "^0.3.3",
|
"@types/event-emitter": "^0.3.3",
|
||||||
"@types/jasmine": "~3.6.0",
|
"@types/jasmine": "~3.6.0",
|
||||||
@@ -9327,22 +9327,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@playwright/test": {
|
"node_modules/@playwright/test": {
|
||||||
"version": "1.37.1",
|
"version": "1.42.1",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.37.1.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz",
|
||||||
"integrity": "sha512-bq9zTli3vWJo8S3LwB91U0qDNQDpEXnw7knhxLM0nwDvexQAwx9tO8iKDZSqqneVq+URd/WIoz+BALMqUTgdSg==",
|
"integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*",
|
"playwright": "1.42.1"
|
||||||
"playwright-core": "1.37.1"
|
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=16"
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"fsevents": "2.3.2"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/plugin-json": {
|
"node_modules/@rollup/plugin-json": {
|
||||||
@@ -25321,10 +25317,28 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/playwright": {
|
||||||
|
"version": "1.42.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz",
|
||||||
|
"integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"playwright-core": "1.42.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"playwright": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/playwright-core": {
|
"node_modules/playwright-core": {
|
||||||
"version": "1.37.1",
|
"version": "1.42.1",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.37.1.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz",
|
||||||
"integrity": "sha512-17EuQxlSIYCmEMwzMqusJ2ztDgJePjrbttaefgdsiqeLWidjYz9BxXaTaZWxH1J95SHGk6tjE+dwgWILJoUZfA==",
|
"integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright-core": "cli.js"
|
"playwright-core": "cli.js"
|
||||||
|
@@ -82,7 +82,7 @@
|
|||||||
"@nx/angular": "17.0.2",
|
"@nx/angular": "17.0.2",
|
||||||
"@nx/eslint-plugin": "17.0.2",
|
"@nx/eslint-plugin": "17.0.2",
|
||||||
"@nx/workspace": "17.0.2",
|
"@nx/workspace": "17.0.2",
|
||||||
"@playwright/test": "^1.37.1",
|
"@playwright/test": "^1.42.1",
|
||||||
"@schematics/angular": "14.1.2",
|
"@schematics/angular": "14.1.2",
|
||||||
"@types/event-emitter": "^0.3.3",
|
"@types/event-emitter": "^0.3.3",
|
||||||
"@types/jasmine": "~3.6.0",
|
"@types/jasmine": "~3.6.0",
|
||||||
|
@@ -160,7 +160,9 @@ export class FileActionsApi {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await waitForApi(apiCall, predicate, 30, 2500);
|
await waitForApi(apiCall, predicate, 30, 2500);
|
||||||
} catch {}
|
} catch (error) {
|
||||||
|
console.error(`Error: ${error}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateNodeContent(nodeId: string, content: string, majorVersion: boolean = true, comment?: string, newName?: string): Promise<NodeEntry> {
|
async updateNodeContent(nodeId: string, content: string, majorVersion: boolean = true, comment?: string, newName?: string): Promise<NodeEntry> {
|
||||||
|
@@ -241,7 +241,7 @@ export class DataTableComponent extends BaseComponent {
|
|||||||
const isSelected = await this.hasCheckMarkIcon(name);
|
const isSelected = await this.hasCheckMarkIcon(name);
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
let row = this.getRowByName(name);
|
let row = this.getRowByName(name);
|
||||||
await row.locator('[title="Size"]').click();
|
await row.locator('[title="Size"]').click({ modifiers: ['Meta'] });
|
||||||
await row.locator('.adf-datatable-selected').waitFor({ state: 'attached' });
|
await row.locator('.adf-datatable-selected').waitFor({ state: 'attached' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { LoginPage, PersonalFilesPage } from '../';
|
import { LoginPage, MyLibrariesPage, PersonalFilesPage, FavoritesLibrariesPage, SearchPage } from '../';
|
||||||
import { NodesApi, TrashcanApi, SitesApi } from '@alfresco/playwright-shared';
|
import { NodesApi, TrashcanApi, SitesApi } from '@alfresco/playwright-shared';
|
||||||
|
|
||||||
export class Utils {
|
export class Utils {
|
||||||
@@ -98,4 +98,18 @@ export class Utils {
|
|||||||
const fileInput = await personalFilesPage.page.$('#app-upload-file-version');
|
const fileInput = await personalFilesPage.page.$('#app-upload-file-version');
|
||||||
await fileInput.setInputFiles(path.join(__dirname, `../resources/test-files/${fileFromOS}.docx`));
|
await fileInput.setInputFiles(path.join(__dirname, `../resources/test-files/${fileFromOS}.docx`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async reloadPageIfRowNotVisible(
|
||||||
|
pageContext: PersonalFilesPage | MyLibrariesPage | FavoritesLibrariesPage | SearchPage,
|
||||||
|
nodeName: string,
|
||||||
|
errorMessage = 'Error '
|
||||||
|
): Promise<void> {
|
||||||
|
try {
|
||||||
|
if (!await pageContext.dataTable.getRowByName(nodeName).isVisible()) {
|
||||||
|
await pageContext.page.reload({ waitUntil: 'load' });
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`${errorMessage}: ${error}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user