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-8058] [E2E] Updated selectMultiItem method #3874

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
17 changes: 5 additions & 12 deletions e2e/playwright/delete-actions/src/tests/delete-undo-delete.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down Expand Up @@ -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`);
Expand All @@ -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`);
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
14 changes: 3 additions & 11 deletions e2e/playwright/delete-actions/src/tests/restore.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

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');
Expand Down Expand Up @@ -193,7 +193,7 @@
* @param name of the data table element with which we want to double click
*/
async performClickFolderOrFileToOpen(name: string): Promise<void> {
await this.getCellLinkByName(name).click();

Check failure on line 196 in projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts

View workflow job for this annotation

GitHub Actions / E2E Playwright - copy-move-actions

[Copy Move Actions] › src/tests/destination-picker-dialog.e2e.ts:89:7 › Copy Move actions › [C263877] Contributor user can select the folder as destination

1) [Copy Move Actions] › src/tests/destination-picker-dialog.e2e.ts:89:7 › Copy Move actions › [C263877] Contributor user can select the folder as destination Error: locator.click: Test timeout of 150000ms exceeded. Call log: - waiting for locator('adf-datatable .adf-cell-value span[role="link"]').filter({ hasText: 'site-1a3vc' }) at ../../../projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts:196 194 | */ 195 | async performClickFolderOrFileToOpen(name: string): Promise<void> { > 196 | await this.getCellLinkByName(name).click(); | ^ 197 | await this.spinnerWaitForReload(); 198 | } 199 | at DataTableComponent.performClickFolderOrFileToOpen (/home/runner/work/alfresco-content-app/alfresco-content-app/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts:196:40) at copyContentInMyLibraries (/home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/copy-move-actions/src/tests/destination-picker-dialog.e2e.ts:76:37) at /home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/copy-move-actions/src/tests/destination-picker-dialog.e2e.ts:92:11
await this.spinnerWaitForReload();
}

Expand Down Expand Up @@ -241,19 +241,18 @@
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> {
Expand All @@ -276,7 +275,7 @@
}

async getItemLocationText(name: string): Promise<string> {
await this.getItemLocationEl(name).locator('a').waitFor({ state: 'attached' });

Check failure on line 278 in projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts

View workflow job for this annotation

GitHub Actions / E2E Playwright - list-views

[List Views] › src/tests/trash.e2e.ts:92:9 › Trash › Regular user's personal files › [C280500] Location column is empty if parent folder no longer exists

1) [List Views] › src/tests/trash.e2e.ts:92:9 › Trash › Regular user's personal files › [C280500] Location column is empty if parent folder no longer exists Error: locator.waitFor: Test timeout of 85000ms exceeded. Call log: - waiting for locator('adf-datatable adf-datatable-row').filter({ hasText: 'file-tdf0j.txt' }).locator('.aca-location-link').locator('a') at ../../../projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts:278 276 | 277 | async getItemLocationText(name: string): Promise<string> { > 278 | await this.getItemLocationEl(name).locator('a').waitFor({ state: 'attached' }); | ^ 279 | return this.getItemLocationEl(name).innerText(); 280 | } 281 | at DataTableComponent.getItemLocationText (/home/runner/work/alfresco-content-app/alfresco-content-app/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts:278:53) at /home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/list-views/src/tests/trash.e2e.ts:93:40
return this.getItemLocationEl(name).innerText();
}

Expand All @@ -287,7 +286,7 @@
}

async clickItemLocation(name: string): Promise<void> {
await this.getItemLocationEl(name).click();

Check failure on line 289 in projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts

View workflow job for this annotation

GitHub Actions / E2E Playwright - search

[Search] › src/tests/search-results-files-folders.e2e.ts:63:7 › Search results - files and folders › [C279177] Location column redirect - file in user Home

2) [Search] › src/tests/search-results-files-folders.e2e.ts:63:7 › Search results - files and folders › [C279177] Location column redirect - file in user Home Error: locator.click: Test timeout of 85000ms exceeded. Call log: - waiting for locator('adf-datatable adf-datatable-row').filter({ hasText: 'test-file-1ygsc.txt' }).locator('.aca-location-link') at ../../../projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts:289 287 | 288 | async clickItemLocation(name: string): Promise<void> { > 289 | await this.getItemLocationEl(name).click(); | ^ 290 | } 291 | 292 | async getSortingOrder(): Promise<string> { at DataTableComponent.clickItemLocation (/home/runner/work/alfresco-content-app/alfresco-content-app/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts:289:40) at /home/runner/work/alfresco-content-app/alfresco-content-app/e2e/playwright/search/src/tests/search-results-files-folders.e2e.ts:70:32
}

async getSortingOrder(): Promise<string> {
Expand Down Expand Up @@ -335,23 +334,23 @@

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;
}
Expand All @@ -360,16 +359,16 @@
* 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;
}
Expand Down
Loading