Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-8561] [E2E] Merge-selectItem-and-selectMultiItem-into-one-method #4011

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test.describe('Copy Move actions', () => {

const copyContentInMyLibraries = async (myLibrariesPage: MyLibrariesPage) => {
await myLibrariesPage.dataTable.performClickFolderOrFileToOpen(site);
await myLibrariesPage.dataTable.selectItem(sourceFile);
await myLibrariesPage.dataTable.selectItems(sourceFile);
await myLibrariesPage.clickMoreActionsButton('Copy');
await myLibrariesPage.contentNodeSelector.selectDestination(destinationFolder);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test.describe('Delete and undo delete', () => {

test('[C217125] delete a file and check notification', async ({ personalFiles, trashPage }) => {
let items = await personalFiles.dataTable.getRowsCount();
await personalFiles.dataTable.selectItem(file1);
await personalFiles.dataTable.selectItems(file1);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
const message = await personalFiles.snackBar.getSnackBarMessage();
Expand All @@ -136,7 +136,7 @@ test.describe('Delete and undo delete', () => {
test('[C280502] delete multiple files and check notification', async ({ personalFiles, trashPage }) => {
await personalFiles.page.reload({ waitUntil: 'load' });
let items = await personalFiles.dataTable.getRowsCount();
await personalFiles.dataTable.selectMultiItem(file2, file3);
await personalFiles.dataTable.selectItems(file2, file3);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.verifySnackBarActionText(`Deleted 2 items`);
Expand All @@ -152,7 +152,7 @@ test.describe('Delete and undo delete', () => {

test('[C217126] delete a folder with content', async ({ personalFiles, trashPage }) => {
let items = await personalFiles.dataTable.getRowsCount();
await personalFiles.dataTable.selectItem(folder1);
await personalFiles.dataTable.selectItems(folder1);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.closeIcon.click();
Expand All @@ -165,7 +165,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C217127] delete a folder containing locked files', async ({ personalFiles, trashPage }) => {
await personalFiles.dataTable.selectItem(folder2);
await personalFiles.dataTable.selectItems(folder2);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.verifySnackBarActionText(`${folder2} couldn't be deleted`);
Expand All @@ -177,7 +177,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C217129] notification on multiple items deletion - some items fail to delete', async ({ personalFiles }) => {
await personalFiles.dataTable.selectMultiItem(file4, folder3);
await personalFiles.dataTable.selectItems(file4, folder3);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.verifySnackBarActionText(`Deleted 1 item, 1 couldn't be deleted`);
Expand All @@ -186,7 +186,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C217130] notification on multiple items deletion - all items fail to delete', async ({ personalFiles }) => {
await personalFiles.dataTable.selectMultiItem(folder4, folder5);
await personalFiles.dataTable.selectItems(folder4, folder5);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.verifySnackBarActionText(`2 items couldn't be deleted`);
Expand All @@ -196,7 +196,7 @@ test.describe('Delete and undo delete', () => {
test('[C217132] undo delete of file', async ({ personalFiles }) => {
const items = await personalFiles.dataTable.getRowsCount();

await personalFiles.dataTable.selectItem(file5);
await personalFiles.dataTable.selectItems(file5);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');

Expand All @@ -207,7 +207,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C280503] undo delete of folder with content', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folder6);
await personalFiles.dataTable.selectItems(folder6);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.clickSnackBarAction();
Expand All @@ -219,7 +219,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C280504] undo delete of multiple files', async ({ personalFiles }) => {
await personalFiles.dataTable.selectMultiItem(file6, file7);
await personalFiles.dataTable.selectItems(file6, file7);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.clickSnackBarAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C217091] delete a file', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(file1);
await trashPage.dataTable.selectItems(file1);
await trashPage.acaHeader.permanentlyDeleteButton.click();
await trashPage.deleteDialog.deleteButton.click();

Expand All @@ -89,7 +89,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C280416] delete a folder', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(folder1);
await trashPage.dataTable.selectItems(folder1);
await trashPage.acaHeader.permanentlyDeleteButton.click();
await trashPage.deleteDialog.deleteButton.click();

Expand All @@ -98,7 +98,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C290103] delete a library', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(site);
await trashPage.dataTable.selectItems(site);
await trashPage.acaHeader.permanentlyDeleteButton.click();
await trashPage.deleteDialog.deleteButton.click();

Expand All @@ -107,7 +107,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C280417] delete multiple items', async ({ trashPage }) => {
await trashPage.dataTable.selectMultiItem(file2, folder2);
await trashPage.dataTable.selectItems(file2, folder2);
await trashPage.acaHeader.permanentlyDeleteButton.click();
await trashPage.deleteDialog.deleteButton.click();

Expand All @@ -117,7 +117,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C269113] Confirmation dialog UI', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(file3);
await trashPage.dataTable.selectItems(file3);
await trashPage.acaHeader.permanentlyDeleteButton.click();
await trashPage.deleteDialog.waitForDialog();

Expand All @@ -129,7 +129,7 @@ test.describe('Delete and undo delete', () => {
});

test('[C269115] Keep action cancels the deletion', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(file3);
await trashPage.dataTable.selectItems(file3);
await trashPage.acaHeader.permanentlyDeleteButton.click();
await trashPage.deleteDialog.waitForDialog();

Expand Down
14 changes: 7 additions & 7 deletions e2e/playwright/delete-actions/src/tests/restore.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test.describe('Restore from Trash', () => {
});

async function restoreNode(trashPage: TrashPage, nodeName: string) {
await trashPage.dataTable.selectItem(nodeName);
await trashPage.dataTable.selectItems(nodeName);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText(`${nodeName} restored`);
const action = await trashPage.snackBar.getSnackBarActionText();
Expand All @@ -110,7 +110,7 @@ test.describe('Restore from Trash', () => {
});

test('[C217182] restore multiple items', async ({ trashPage, personalFiles }) => {
await trashPage.dataTable.selectMultiItem(file2, folder2);
await trashPage.dataTable.selectItems(file2, folder2);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText(`Restore successful`);
const action = await trashPage.snackBar.getSnackBarActionText();
Expand All @@ -123,7 +123,7 @@ test.describe('Restore from Trash', () => {
});

test('[C217181] View from notification', async ({ trashPage, personalFiles }) => {
await trashPage.dataTable.selectItem(file3);
await trashPage.dataTable.selectItems(file3);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.clickSnackBarAction();
await trashPage.dataTable.spinnerWaitForReload();
Expand Down Expand Up @@ -163,13 +163,13 @@ test.describe('Restore from Trash', () => {
});

test('[C217178] Restore a file when another file with same name exists on the restore location', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(file1);
await trashPage.dataTable.selectItems(file1);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText(`Can't restore, ${file1} already exists`);
});

test('[C217179] Restore a file when original location no longer exists', async ({ trashPage }) => {
await trashPage.dataTable.selectItem(file2);
await trashPage.dataTable.selectItems(file2);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText(`Can't restore ${file2}, the original location no longer exists`);
});
Expand Down Expand Up @@ -223,13 +223,13 @@ test.describe('Restore from Trash', () => {
});

test('[C217183] one failure', async ({ trashPage }) => {
await trashPage.dataTable.selectMultiItem(file1, file2);
await trashPage.dataTable.selectItems(file1, file2);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText(`Can't restore ${file1}, the original location no longer exists`);
});

test('[C217184] multiple failures', async ({ trashPage }) => {
await trashPage.dataTable.selectMultiItem(file3, file4, file5);
await trashPage.dataTable.selectItems(file3, file4, file5);
await trashPage.acaHeader.restoreButton.click();
await trashPage.snackBar.verifySnackBarActionText('2 items not restored because of issues with the restore location');
});
Expand Down
16 changes: 8 additions & 8 deletions e2e/playwright/edit-actions/src/tests/edit-folder.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.describe('Edit folder', () => {

test.describe('on Personal Files', () => {
test('[XAT-5089] "Edit folder" dialog UI', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');

Expand All @@ -84,7 +84,7 @@ test.describe('Edit folder', () => {
});

test('[XAT-5093] Properties are modified when clicking Update button', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderNameToEdit);
await personalFiles.dataTable.selectItems(folderNameToEdit);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');
await personalFiles.editDialog.descriptionInput.fill(folderDescriptionEdited);
Expand All @@ -98,7 +98,7 @@ test.describe('Edit folder', () => {
});

test('[XAT-5090] Empty folder name', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');
await personalFiles.editDialog.nameInput.fill('');
Expand All @@ -110,7 +110,7 @@ test.describe('Edit folder', () => {
test('[XAT-5091] Folder name with special characters', async ({ personalFiles }) => {
const namesWithSpecialChars = ['a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a'];

await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');

Expand All @@ -122,7 +122,7 @@ test.describe('Edit folder', () => {
});

test('[XAT-5092] Folder name ending with a dot', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');
await personalFiles.editDialog.nameInput.fill(`${folderName}.`);
Expand All @@ -132,7 +132,7 @@ test.describe('Edit folder', () => {
});

test('[XAT-5094] Cancel editing properties', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');
await personalFiles.editDialog.cancelButton.click();
Expand All @@ -141,7 +141,7 @@ test.describe('Edit folder', () => {
});

test('[XAT-5095] Duplicated folder name', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');
await personalFiles.editDialog.nameInput.fill(duplicateFolderName);
Expand All @@ -152,7 +152,7 @@ test.describe('Edit folder', () => {
});

test('[XAT-5096] Trim ending spaces', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(folderName);
await personalFiles.dataTable.selectItems(folderName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Edit');
await personalFiles.editDialog.nameInput.fill(`${folderName} `);
Expand Down
5 changes: 2 additions & 3 deletions e2e/playwright/edit-actions/src/tests/edit-offline.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test.describe('Edit offline - on Personal Files', () => {
});

test('[XAT-5304] File is locked and downloaded when clicking Edit offline', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(file1);
await personalFiles.dataTable.selectItems(file1);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItem('Edit Offline');
const [download] = await Promise.all([personalFiles.page.waitForEvent('download')]);
Expand All @@ -84,10 +84,9 @@ test.describe('Edit offline - on Personal Files', () => {
});

test('[XAT-5306] Cancel Editing unlocks the file', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(fileLocked);
await personalFiles.dataTable.selectItems(fileLocked);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.matMenu.clickMenuItemFromHeaderMenu('Cancel Editing');
await personalFiles.dataTable.selectItem(fileLocked);

expect(await nodesApi.isFileLockedWrite(fileLockedId), `${fileLocked} is still locked`).not.toEqual('WRITE_LOCK');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ test.describe('Mark items as favorites', () => {
});

test('[XAT-5042] Favorite action has empty star icon for an item not marked as favorite', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(fileNotFavUI);
await personalFiles.dataTable.selectItems(fileNotFavUI);
await personalFiles.acaHeader.clickMoreActions();
expect(await personalFiles.matMenu.isMenuItemVisible('Favorite')).toBe(true);
});

test('[XAT-5043] Favorite action has empty star icon for multiple selection of items when some are not favorite', async ({ personalFiles }) => {
await personalFiles.dataTable.selectMultiItem(fileNotFavUI, fileFavUI);
await personalFiles.dataTable.selectItems(fileNotFavUI, fileFavUI);
await personalFiles.acaHeader.clickMoreActions();
expect(await personalFiles.matMenu.isMenuItemVisible('Favorite')).toBe(true);
});

test('[XAT-5044] Favorite action has full star icon for items marked as favorite', async ({ personalFiles }) => {
await personalFiles.dataTable.selectItem(fileFavUI);
await personalFiles.dataTable.selectItems(fileFavUI);
await personalFiles.acaHeader.clickMoreActions();
expect(await personalFiles.matMenu.isMenuItemVisible('Remove Favorite')).toBe(true);
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/folder-rules/src/tests/create-rules.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ test.describe('Folder Rules Actions', () => {
await nodesPage.manageRules.checkIfRuleIsOnTheList(randomRuleName);

await personalFiles.navigate({ remoteUrl: `#/personal-files/${randomFolderName1Id}` });
await personalFiles.dataTable.selectItem(copyFileName);
await personalFiles.dataTable.selectItems(copyFileName);
await personalFiles.acaHeader.clickMoreActions();
await personalFiles.acaHeader.matMenu.clickMenuItem('Delete');
await personalFiles.snackBar.message.waitFor({ state: 'visible' });
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/info-drawer/src/tests/comments.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test.describe('Info Drawer - Comments', () => {
await fileActionsApi.waitForNodes(recentFile, { expect: 1 });
await recentFilesPage.navigate();
await expect(recentFilesPage.dataTable.getRowByName(recentFile)).toBeVisible();
await recentFilesPage.dataTable.selectItem(recentFile);
await recentFilesPage.dataTable.selectItems(recentFile);
await recentFilesPage.acaHeader.viewDetails.click();
await recentFilesPage.infoDrawer.commentsTab.click();
await expect(recentFilesPage.infoDrawer.commentInputField).toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions e2e/playwright/info-drawer/src/tests/general.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ test.describe('Info Drawer - General', () => {
await Utils.reloadPageIfRowNotVisible(personalFiles, parentFolder);
await expect(personalFiles.dataTable.getRowByName(parentFolder)).toBeVisible();
await personalFiles.dataTable.performClickFolderOrFileToOpen(parentFolder);
await personalFiles.dataTable.selectItem(file1);
await personalFiles.dataTable.selectItems(file1);
await personalFiles.acaHeader.viewDetails.click();
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeVisible();

await personalFiles.reload({ waitUntil: 'load' });
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeHidden();
await personalFiles.dataTable.selectItem(file1);
await personalFiles.dataTable.selectItems(file1);
await personalFiles.acaHeader.viewDetails.click();
await expect(personalFiles.infoDrawer.infoDrawerPanel).toBeVisible();

Expand Down
Loading
Loading