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 }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
@@ -96,6 +97,7 @@ test.describe('Copy actions', () => {
|
||||
});
|
||||
|
||||
test('[C291888] Copy a folder with content', async ({ personalFiles }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
@@ -107,11 +109,13 @@ test.describe('Copy actions', () => {
|
||||
});
|
||||
|
||||
test('[C291889] Copy multiple items', async ({ personalFiles }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder, sourceFile], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
await personalFiles.spinner.waitForReload();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).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 }) => {
|
||||
await nodesApi.createFile(sourceFile, destinationFolderId);
|
||||
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
@@ -131,6 +136,7 @@ test.describe('Copy actions', () => {
|
||||
const existingFolderId = (await nodesApi.createFolder(sourceFolder, destinationFolderId)).entry.id;
|
||||
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
||||
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
@@ -145,6 +151,7 @@ test.describe('Copy actions', () => {
|
||||
test('[C217139] Copy locked file', async ({ personalFiles }) => {
|
||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||
await nodesApi.lockNodes([sourceFileId], lockType);
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
@@ -155,6 +162,7 @@ test.describe('Copy actions', () => {
|
||||
test('[C217140] Copy folder that contains locked file', async ({ personalFiles }) => {
|
||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||
await nodesApi.lockNodes([sourceFileInsideFolderId], lockType);
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(destinationFolder);
|
||||
@@ -166,6 +174,7 @@ test.describe('Copy actions', () => {
|
||||
});
|
||||
|
||||
test('[C217171] Undo copy of files', async ({ personalFiles }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
await personalFiles.snackBar.actionButton.click();
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFile)).toBeTruthy();
|
||||
@@ -175,6 +184,7 @@ test.describe('Copy actions', () => {
|
||||
});
|
||||
|
||||
test('[C217172] Undo copy of folders', async ({ personalFiles }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
await personalFiles.snackBar.actionButton.click();
|
||||
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 }) => {
|
||||
await nodesApi.createFile(sourceFile, destinationFolderId);
|
||||
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
await personalFiles.snackBar.actionButton.click();
|
||||
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;
|
||||
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
||||
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await copyContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
await personalFiles.snackBar.actionButton.click();
|
||||
expect.soft(await personalFiles.dataTable.isItemPresent(sourceFolder)).toBeTruthy();
|
||||
|
@@ -22,21 +22,26 @@
|
||||
* 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';
|
||||
|
||||
test.describe('Move actions', () => {
|
||||
let nodesApi: NodesApi;
|
||||
let trashcanApi: TrashcanApi;
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
let sourceFileId: string;
|
||||
let sourceFileInsideFolderId: string;
|
||||
let destinationFolderId: string;
|
||||
|
||||
let sourceFile: string;
|
||||
let sourceFileInsideFolder: string;
|
||||
let sourceFolder: string;
|
||||
let destinationFolder: string;
|
||||
|
||||
let sourceFileId: string;
|
||||
let sourceFileInsideFolderId: string;
|
||||
let destinationFolderId: string;
|
||||
test.afterAll(async ({ nodesApiAction }) => {
|
||||
await Utils.deleteNodesSitesEmptyTrashcan(nodesApiAction, trashcanApi, 'afterAll failed');
|
||||
});
|
||||
|
||||
test.beforeAll(async () => {
|
||||
try {
|
||||
@@ -47,12 +52,6 @@ test.describe('Move actions', () => {
|
||||
} catch {}
|
||||
});
|
||||
|
||||
test.afterAll(async ({ nodesApiAction }) => {
|
||||
try {
|
||||
await nodesApiAction.deleteCurrentUserNodes();
|
||||
} catch {}
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ personalFiles, page }) => {
|
||||
sourceFile = `source-file-${Utils.random()}.txt`;
|
||||
sourceFileInsideFolder = `source-file-inside-folder-${Utils.random()}.txt`;
|
||||
@@ -60,21 +59,13 @@ test.describe('Move actions', () => {
|
||||
destinationFolder = `destination-folder-${Utils.random()}`;
|
||||
|
||||
const loginPage = new LoginPage(page);
|
||||
try {
|
||||
await loginPage.loginUser(
|
||||
{ username, password: username },
|
||||
{
|
||||
withNavigation: true,
|
||||
waitForLoading: true
|
||||
}
|
||||
);
|
||||
destinationFolderId = (await nodesApi.createFolder(destinationFolder)).entry.id;
|
||||
const sourceFolderId = (await nodesApi.createFolder(sourceFolder)).entry.id;
|
||||
sourceFileInsideFolderId = (await nodesApi.createFile(sourceFileInsideFolder, sourceFolderId)).entry.id;
|
||||
sourceFileId = (await nodesApi.createFile(sourceFile)).entry.id;
|
||||
await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed');
|
||||
destinationFolderId = (await nodesApi.createFolder(destinationFolder)).entry.id;
|
||||
const sourceFolderId = (await nodesApi.createFolder(sourceFolder)).entry.id;
|
||||
sourceFileInsideFolderId = (await nodesApi.createFile(sourceFileInsideFolder, sourceFolderId)).entry.id;
|
||||
sourceFileId = (await nodesApi.createFile(sourceFile)).entry.id;
|
||||
|
||||
await personalFiles.navigate();
|
||||
} catch {}
|
||||
await personalFiles.navigate();
|
||||
});
|
||||
|
||||
const moveContentInPersonalFiles = async (personalFilesPage: PersonalFilesPage, sourceFileList: string[], destinationName: string) => {
|
||||
@@ -83,6 +74,7 @@ test.describe('Move actions', () => {
|
||||
};
|
||||
|
||||
test('[C217316] Move a file', async ({ personalFiles }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
const msg = await personalFiles.snackBar.message.innerText();
|
||||
expect.soft(msg).toContain('Moved 1 item.');
|
||||
@@ -92,19 +84,8 @@ test.describe('Move actions', () => {
|
||||
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 }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder, sourceFile], destinationFolder);
|
||||
const msg = await personalFiles.snackBar.message.innerText();
|
||||
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 }) => {
|
||||
await nodesApi.createFile(sourceFile, destinationFolderId);
|
||||
const expectedNameForCopiedFile = sourceFile.replace('.', '-1.');
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
const msg = await personalFiles.snackBar.message.innerText();
|
||||
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;
|
||||
await nodesApi.createFile(sourceFileInsideFolder, existingFolderId);
|
||||
const expectedNameForCopiedFile = sourceFileInsideFolder.replace('.', '-1.');
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
const msg = await personalFiles.snackBar.message.innerText();
|
||||
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 }) => {
|
||||
const lockType = 'ALLOW_OWNER_CHANGES';
|
||||
await nodesApi.lockNodes([sourceFileId], lockType);
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
const msg = await personalFiles.snackBar.message.innerText();
|
||||
expect.soft(msg).toContain('Moved 1 item.');
|
||||
@@ -157,21 +141,8 @@ test.describe('Move actions', () => {
|
||||
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 }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFile);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFile], destinationFolder);
|
||||
await personalFiles.snackBar.actionButton.click();
|
||||
await personalFiles.spinner.waitForReload();
|
||||
@@ -183,6 +154,7 @@ test.describe('Move actions', () => {
|
||||
});
|
||||
|
||||
test('[C217325] Undo move of folders', async ({ personalFiles, trashPage }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, sourceFolder);
|
||||
await moveContentInPersonalFiles(personalFiles, [sourceFolder], destinationFolder);
|
||||
await personalFiles.snackBar.actionButton.click();
|
||||
await personalFiles.spinner.waitForReload();
|
||||
@@ -192,4 +164,38 @@ test.describe('Move actions', () => {
|
||||
await trashPage.navigate();
|
||||
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 fileActionsApi.waitForNodes(personalFolderName, { expect: 1 });
|
||||
await personalFiles.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, personalFolderName);
|
||||
await expect(personalFiles.dataTable.getRowByName(personalFolderName)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(personalFolderName).click();
|
||||
await personalFiles.acaHeader.viewDetails.click();
|
||||
|
@@ -57,6 +57,7 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
||||
await nodesApi.createFolder(defaultTabsFolderName);
|
||||
await fileActionsApi.waitForNodes(defaultTabsFolderName, { expect: 1 });
|
||||
await personalFiles.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, defaultTabsFolderName);
|
||||
await expect(personalFiles.dataTable.getRowByName(defaultTabsFolderName)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(defaultTabsFolderName).click();
|
||||
await personalFiles.acaHeader.viewDetails.click();
|
||||
@@ -72,6 +73,7 @@ test.describe('Info Drawer - File Folder Properties', () => {
|
||||
await nodesApi.createFolder(expandDetailsFolderName);
|
||||
await fileActionsApi.waitForNodes(expandDetailsFolderName, { expect: 1 });
|
||||
await personalFiles.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, expandDetailsFolderName);
|
||||
await expect(personalFiles.dataTable.getRowByName(expandDetailsFolderName)).toBeVisible();
|
||||
await personalFiles.dataTable.getRowByName(expandDetailsFolderName).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.waitForNodes(fileName, { expect: 1 });
|
||||
await personalFiles.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, fileName);
|
||||
await personalFiles.dataTable.getRowByName(fileName).click();
|
||||
await personalFiles.acaHeader.viewButton.click();
|
||||
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 fileActionsApi.waitForNodes(file1, { expect: 1 });
|
||||
await personalFiles.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(personalFiles, parentFolder);
|
||||
await expect(personalFiles.dataTable.getRowByName(parentFolder)).toBeVisible();
|
||||
await personalFiles.dataTable.performClickFolderOrFileToOpen(parentFolder);
|
||||
await personalFiles.dataTable.selectItem(file1);
|
||||
|
@@ -182,6 +182,7 @@ test.describe('Library properties', () => {
|
||||
});
|
||||
|
||||
test('[C289343] Site description too long', async ({ myLibrariesPage }) => {
|
||||
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, site.name);
|
||||
await myLibrariesPage.dataTable.getRowByName(site.name).click();
|
||||
await myLibrariesPage.acaHeader.viewDetails.click();
|
||||
await expect(myLibrariesPage.libraryDetails.infoDrawerPanel).toBeVisible();
|
||||
|
@@ -34,9 +34,7 @@ const config: PlaywrightTestConfig<CustomConfig> = {
|
||||
{
|
||||
name: 'Library Actions',
|
||||
testDir: './src/tests',
|
||||
use: {
|
||||
users: ['hruser']
|
||||
}
|
||||
use: {}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@@ -90,7 +90,7 @@ test.describe('Library actions ', () => {
|
||||
let user2SitesApi: SitesApi;
|
||||
|
||||
test.beforeAll(async () => {
|
||||
test.setTimeout(timeouts.extendedLongTest);
|
||||
test.setTimeout(timeouts.globalSpec);
|
||||
const apiClientFactory = new ApiClientFactory();
|
||||
const username1 = `user-${Utils.random()}`;
|
||||
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 libraryTable.performActionFromExpandableMenu(user1Library1, leaveLibraryButton);
|
||||
await expect.soft(confirmDialog.getDialogTitle('Leave this library?')).toBeVisible();
|
||||
@@ -196,14 +197,16 @@ test.describe('Library actions ', () => {
|
||||
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 libraryTable.performActionFromExpandableMenu(user1Library5, leaveLibraryButton);
|
||||
await confirmDialog.cancelButton.click();
|
||||
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 libraryTable.performActionFromExpandableMenu(user2Library1, leaveLibraryButton);
|
||||
await confirmDialog.okButton.click();
|
||||
@@ -211,7 +214,8 @@ test.describe('Library actions ', () => {
|
||||
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 libraryTable.getCellByColumnNameAndRowItem(adminLibrary3, contributorRole).click();
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
@@ -221,7 +225,7 @@ test.describe('Library actions ', () => {
|
||||
});
|
||||
|
||||
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 libraryTable.getRowByName(user2Library2).click();
|
||||
await myLibrariesPage.page.waitForTimeout(1000);
|
||||
@@ -232,9 +236,10 @@ test.describe('Library actions ', () => {
|
||||
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;
|
||||
|
||||
await Utils.reloadPageIfRowNotVisible(myLibrariesPage, user2Library5Delete);
|
||||
await expect(libraryTable.getRowByName(user2Library5Delete)).toBeVisible();
|
||||
await libraryTable.getRowByName(user2Library5Delete).click();
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
@@ -264,6 +269,7 @@ test.describe('Library actions ', () => {
|
||||
test('[C290105] Join a public library from Favorite Libraries', async ({ favoriteLibrariesPage }) => {
|
||||
await favoritesApi.addFavoriteById(siteString, adminLibrary1);
|
||||
await favoriteLibrariesPage.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, adminLibrary1);
|
||||
await libraryTable.performActionFromExpandableMenu(adminLibrary1, joinButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(libraryJoinedMessage)).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 }) => {
|
||||
await favoritesApi.addFavoriteById(siteString, adminModerateLibrary1);
|
||||
await favoriteLibrariesPage.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, adminModerateLibrary1);
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
|
||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary1, joinButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible();
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, notMemberString)).toBeVisible();
|
||||
await adminSitesApi.approveSiteMembershipRequest(adminModerateLibrary1, username2);
|
||||
await favoriteLibrariesPage.navigate();
|
||||
await favoriteLibrariesPage.page.reload({ waitUntil: 'load' });
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary1, consumerRole)).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -285,6 +292,7 @@ test.describe('Library actions ', () => {
|
||||
const confirmDialog = favoriteLibrariesPage.confirmDialogComponent;
|
||||
await favoritesApi.addFavoriteById(siteString, user1Library2);
|
||||
await favoriteLibrariesPage.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, user1Library2);
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library2, contributorRole)).toBeVisible();
|
||||
await libraryTable.performActionFromExpandableMenu(user1Library2, leaveLibraryButton);
|
||||
await confirmDialog.okButton.click();
|
||||
@@ -297,6 +305,7 @@ test.describe('Library actions ', () => {
|
||||
await favoritesApi.addFavoriteById(siteString, adminModerateLibrary3);
|
||||
await favoriteLibrariesPage.navigate();
|
||||
|
||||
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, adminModerateLibrary3);
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary3, notMemberString)).toBeVisible();
|
||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary3, cancelJoinRequestButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible();
|
||||
@@ -309,6 +318,7 @@ test.describe('Library actions ', () => {
|
||||
const libraryMenu = favoriteLibrariesPage.matMenu;
|
||||
|
||||
await favoriteLibrariesPage.navigate({ waitUntil: domContentLoadedString });
|
||||
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, user2Library3);
|
||||
await expect(libraryTable.getRowByName(user2Library3)).toBeVisible();
|
||||
await libraryTable.getRowByName(user2Library3).click();
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
@@ -322,6 +332,7 @@ test.describe('Library actions ', () => {
|
||||
const trashTable = trashPage.dataTable;
|
||||
|
||||
await favoriteLibrariesPage.navigate();
|
||||
await Utils.reloadPageIfRowNotVisible(favoriteLibrariesPage, user2Library6Delete);
|
||||
await expect(libraryTable.getRowByName(user2Library6Delete)).toBeVisible();
|
||||
await libraryTable.getRowByName(user2Library6Delete).click();
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
@@ -349,6 +360,7 @@ test.describe('Library actions ', () => {
|
||||
test('[C306959] Join a public library from Search Results', async ({ searchPage }) => {
|
||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminLibrary2}` });
|
||||
await searchPage.reload({ waitUntil: loadString });
|
||||
await Utils.reloadPageIfRowNotVisible(searchPage, adminLibrary2);
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminLibrary2, notMemberString)).toBeVisible();
|
||||
await libraryTable.performActionFromExpandableMenu(adminLibrary2, joinButton);
|
||||
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 }) => {
|
||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${adminModerateLibrary2}` });
|
||||
await Utils.reloadPageIfRowNotVisible(searchPage, adminModerateLibrary2);
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(adminModerateLibrary2, notMemberString)).toBeVisible();
|
||||
await libraryTable.performActionFromExpandableMenu(adminModerateLibrary2, joinButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(requestToJoinMessage)).toBeVisible();
|
||||
@@ -370,6 +383,7 @@ test.describe('Library actions ', () => {
|
||||
const confirmDialog = searchPage.confirmDialogComponent;
|
||||
await searchPage.navigate({ remoteUrl: `#/search-libraries;q=${user1Library3}` });
|
||||
|
||||
await Utils.reloadPageIfRowNotVisible(searchPage, user1Library3);
|
||||
await expect(libraryTable.getCellByColumnNameAndRowItem(user1Library3, 'Collaborator')).toBeVisible();
|
||||
await libraryTable.performActionFromExpandableMenu(user1Library3, leaveLibraryButton);
|
||||
await confirmDialog.okButton.click();
|
||||
@@ -380,7 +394,7 @@ test.describe('Library actions ', () => {
|
||||
test('[C306962] Cancel join from Search Results', async ({ searchPage }) => {
|
||||
await user2SitesApi.createSiteMembershipRequestForPerson(username2, 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 libraryTable.performActionFromExpandableMenu(adminModerateLibrary4, cancelJoinRequestButton);
|
||||
await expect.soft(snackBar.getByMessageLocator(cancelJoinRequestMessage)).toBeVisible();
|
||||
@@ -397,6 +411,7 @@ test.describe('Library actions ', () => {
|
||||
await searchPage.searchOverlay.searchLibrariesOption.click();
|
||||
await searchPage.searchOverlay.searchFor(adminLibrary4);
|
||||
|
||||
await Utils.reloadPageIfRowNotVisible(searchPage, adminLibrary4);
|
||||
await expect(libraryTable.getRowByName(adminLibrary4)).toBeVisible();
|
||||
await libraryTable.getRowByName(adminLibrary4).click();
|
||||
await myLibrariesHeader.clickMoreActions();
|
||||
@@ -414,6 +429,7 @@ test.describe('Library actions ', () => {
|
||||
await searchPage.searchOverlay.searchLibrariesOption.click();
|
||||
await searchPage.searchOverlay.searchFor(user2Library4);
|
||||
|
||||
await Utils.reloadPageIfRowNotVisible(searchPage, user2Library4);
|
||||
await expect(libraryTable.getRowByName(user2Library4)).toBeVisible();
|
||||
await searchPage.reload({ waitUntil: domContentLoadedString });
|
||||
await libraryTable.getRowByName(user2Library4).click();
|
||||
@@ -430,7 +446,7 @@ test.describe('Library actions ', () => {
|
||||
const trashTable = trashPage.dataTable;
|
||||
|
||||
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 libraryTable.getRowByName(user2Library7Delete).click();
|
||||
await searchHeader.clickMoreActions();
|
||||
|
Reference in New Issue
Block a user