mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-8058] [E2E] Updated selectMultiItem method (#3874)
* [ACS-8058] [E2E] Updated selectMultiItem method * [ACS-8058] review fixes 1
This commit is contained in:
parent
fc05a8b30c
commit
5a87c277f0
@ -134,10 +134,9 @@ 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.selectItem(file2);
|
||||
await personalFiles.page.waitForTimeout(1500);
|
||||
await personalFiles.dataTable.selectItem(file3);
|
||||
await personalFiles.dataTable.selectMultiItem(file2, file3);
|
||||
await personalFiles.acaHeader.clickMoreActions();
|
||||
await personalFiles.matMenu.clickMenuItem('Delete');
|
||||
await personalFiles.snackBar.verifySnackBarActionText(`Deleted 2 items`);
|
||||
@ -178,9 +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.selectItem(file4);
|
||||
await personalFiles.page.waitForTimeout(1500);
|
||||
await personalFiles.dataTable.selectItem(folder3);
|
||||
await personalFiles.dataTable.selectMultiItem(file4, folder3);
|
||||
await personalFiles.acaHeader.clickMoreActions();
|
||||
await personalFiles.matMenu.clickMenuItem('Delete');
|
||||
await personalFiles.snackBar.verifySnackBarActionText(`Deleted 1 item, 1 couldn't be deleted`);
|
||||
@ -189,9 +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.selectItem(folder4);
|
||||
await personalFiles.page.waitForTimeout(1500);
|
||||
await personalFiles.dataTable.selectItem(folder5);
|
||||
await personalFiles.dataTable.selectMultiItem(folder4, folder5);
|
||||
await personalFiles.acaHeader.clickMoreActions();
|
||||
await personalFiles.matMenu.clickMenuItem('Delete');
|
||||
await personalFiles.snackBar.verifySnackBarActionText(`2 items couldn't be deleted`);
|
||||
@ -224,9 +219,7 @@ test.describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
test('[C280504] undo delete of multiple files', async ({ personalFiles }) => {
|
||||
await personalFiles.dataTable.selectItem(file6);
|
||||
await personalFiles.page.waitForTimeout(1500);
|
||||
await personalFiles.dataTable.selectItem(file7);
|
||||
await personalFiles.dataTable.selectMultiItem(file6, file7);
|
||||
await personalFiles.acaHeader.clickMoreActions();
|
||||
await personalFiles.matMenu.clickMenuItem('Delete');
|
||||
await personalFiles.snackBar.clickSnackBarAction();
|
||||
|
@ -107,9 +107,7 @@ test.describe('Delete and undo delete', () => {
|
||||
});
|
||||
|
||||
test('[C280417] delete multiple items', async ({ trashPage }) => {
|
||||
await trashPage.dataTable.selectItem(file2);
|
||||
await trashPage.page.waitForTimeout(1500);
|
||||
await trashPage.dataTable.selectItem(folder2);
|
||||
await trashPage.dataTable.selectMultiItem(file2, folder2);
|
||||
await trashPage.acaHeader.permanentlyDeleteButton.click();
|
||||
await trashPage.deleteDialog.deleteButton.click();
|
||||
|
||||
|
@ -110,9 +110,7 @@ test.describe('Restore from Trash', () => {
|
||||
});
|
||||
|
||||
test('[C217182] restore multiple items', async ({ trashPage, personalFiles }) => {
|
||||
await trashPage.dataTable.selectItem(file2);
|
||||
await trashPage.page.waitForTimeout(1500);
|
||||
await trashPage.dataTable.selectItem(folder2);
|
||||
await trashPage.dataTable.selectMultiItem(file2, folder2);
|
||||
await trashPage.acaHeader.restoreButton.click();
|
||||
await trashPage.snackBar.verifySnackBarActionText(`Restore successful`);
|
||||
const action = await trashPage.snackBar.getSnackBarActionText();
|
||||
@ -225,19 +223,13 @@ test.describe('Restore from Trash', () => {
|
||||
});
|
||||
|
||||
test('[C217183] one failure', async ({ trashPage }) => {
|
||||
await trashPage.dataTable.selectItem(file1);
|
||||
await trashPage.page.waitForTimeout(1500);
|
||||
await trashPage.dataTable.selectItem(file2);
|
||||
await trashPage.dataTable.selectMultiItem(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.selectItem(file3);
|
||||
await trashPage.page.waitForTimeout(1500);
|
||||
await trashPage.dataTable.selectItem(file4);
|
||||
await trashPage.page.waitForTimeout(1500);
|
||||
await trashPage.dataTable.selectItem(file5);
|
||||
await trashPage.dataTable.selectMultiItem(file3, file4, file5);
|
||||
await trashPage.acaHeader.restoreButton.click();
|
||||
await trashPage.snackBar.verifySnackBarActionText('2 items not restored because of issues with the restore location');
|
||||
});
|
||||
|
@ -101,8 +101,7 @@ test.describe('Folders - available actions : ', () => {
|
||||
test('multiple folders - [C280459]', async ({ personalFiles }) => {
|
||||
await personalFiles.dataTable.selectMultiItem(testData.folderFavFile.name, testData.folderFile.name);
|
||||
await personalFiles.dataTable.getRowByName(testData.folderFavFile.name).click({ button: 'right' });
|
||||
await personalFiles.matMenu.verifyActualMoreActions(testData.multipleSelFile.contextMenu);
|
||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${parentId}` });
|
||||
await personalFiles.page.reload({ waitUntil: 'load' });
|
||||
await personalFiles.dataTable.selectMultiItem(testData.folderFavFile.name, testData.folderFile.name);
|
||||
await checkMultipleSelActionsAvailable(personalFiles, testData.multipleSelFile.toolbarPrimary, testData.multipleSelFile.toolbarMore);
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ export class DataTableComponent extends BaseComponent {
|
||||
}
|
||||
|
||||
public pagination = new PaginationComponent(this.page);
|
||||
body = this.getChild('.adf-datatable-body')
|
||||
body = this.getChild('.adf-datatable-body');
|
||||
getEmptyFolderLocator = this.getChild('.adf-empty-folder');
|
||||
getEmptyContentTitleLocator = this.getChild('adf-empty-content .adf-empty-content__title');
|
||||
getEmptyContentSubTitleLocator = this.getChild('adf-empty-content .adf-empty-content__subtitle');
|
||||
@ -241,19 +241,18 @@ export class DataTableComponent extends BaseComponent {
|
||||
const isSelected = await this.isRowSelected(name);
|
||||
if (!isSelected) {
|
||||
let row = this.getRowByName(name);
|
||||
await row.locator('[title="Size"]').click({ modifiers: ['Meta'] });
|
||||
await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').waitFor({ state: 'attached' });
|
||||
await row.locator('mat-checkbox').click();
|
||||
await row.locator('.mat-checkbox-checked').waitFor({ state: 'attached' });
|
||||
}
|
||||
}
|
||||
|
||||
async selectMultiItem(name: string, name2: string): Promise<void> {
|
||||
await this.page.keyboard.down('Meta');
|
||||
let row = this.getRowByName(name);
|
||||
await row.locator('[title="Size"]').click();
|
||||
await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').waitFor({ state: 'attached' });
|
||||
row = this.getRowByName(name2);
|
||||
await row.locator('[title="Size"]').click();
|
||||
await row.locator('.adf-datatable-checkbox .mat-checkbox-checked').waitFor({ state: 'attached' });
|
||||
async selectMultiItem(...names: string[]): Promise<void> {
|
||||
for (const name of names) {
|
||||
let row = this.getRowByName(name);
|
||||
await row.locator('mat-checkbox').click();
|
||||
await row.locator('.mat-checkbox-checked').waitFor({ state: 'attached' });
|
||||
await this.page.waitForTimeout(1000);
|
||||
}
|
||||
}
|
||||
|
||||
async isRowSelected(itemName: string): Promise<boolean> {
|
||||
@ -335,23 +334,23 @@ export class DataTableComponent extends BaseComponent {
|
||||
|
||||
async setPaginationTo50(): Promise<void> {
|
||||
await this.paginationButton.click();
|
||||
await this.paginationOptions.getByText("50").click();
|
||||
await this.paginationOptions.getByText('50').click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method used to create objects from names and visibility of sites from datatable
|
||||
*
|
||||
* @returns an object with sites' names and their corresponding visibility values
|
||||
*/
|
||||
*/
|
||||
async getSitesNameAndVisibility(): Promise<{ [siteName: string]: string }> {
|
||||
const rowsCount = await this.sitesName.count();
|
||||
let sitesInfo: { [siteName: string]: string } = {};
|
||||
for (let i = 0; i < rowsCount; i++) {
|
||||
let siteVisibilityText = await this.sitesVisibility.nth(i).textContent();
|
||||
let siteNameText = await this.sitesName.nth(i).textContent();
|
||||
siteVisibilityText = siteVisibilityText.trim().toUpperCase();
|
||||
siteNameText = siteNameText.trim();
|
||||
sitesInfo[siteNameText] = siteVisibilityText;
|
||||
let siteVisibilityText = await this.sitesVisibility.nth(i).textContent();
|
||||
let siteNameText = await this.sitesName.nth(i).textContent();
|
||||
siteVisibilityText = siteVisibilityText.trim().toUpperCase();
|
||||
siteNameText = siteNameText.trim();
|
||||
sitesInfo[siteNameText] = siteVisibilityText;
|
||||
}
|
||||
return sitesInfo;
|
||||
}
|
||||
@ -360,16 +359,16 @@ export class DataTableComponent extends BaseComponent {
|
||||
* Method used to create objects from names and roles of sites from datatable
|
||||
*
|
||||
* @returns an object with sites' names and their corresponding role values
|
||||
*/
|
||||
*/
|
||||
async getSitesNameAndRole(): Promise<{ [siteName: string]: string }> {
|
||||
const rowsCount = await this.sitesName.count();
|
||||
let sitesInfo: { [siteName: string]: string } = {};
|
||||
for (let i = 0; i < rowsCount; i++) {
|
||||
let siteNameText = await this.sitesName.nth(i).textContent();
|
||||
let siteRoleText = await this.sitesRole.nth(i).textContent();
|
||||
siteNameText = siteNameText.trim();
|
||||
siteRoleText = siteRoleText.trim();
|
||||
sitesInfo[siteNameText] = siteRoleText;
|
||||
let siteNameText = await this.sitesName.nth(i).textContent();
|
||||
let siteRoleText = await this.sitesRole.nth(i).textContent();
|
||||
siteNameText = siteNameText.trim();
|
||||
siteRoleText = siteRoleText.trim();
|
||||
sitesInfo[siteNameText] = siteRoleText;
|
||||
}
|
||||
return sitesInfo;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user