mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-5014] Migrated Copy Move actions E2Es from protractor to playwright (#3531)
* [ACS-5014] Added Playwright E2E tests for copy-move actions * [ACS-5014] Fixed missing import in tsconfig.e2e.json * [ACS-5014] Removed unneeded method from utils.ts * [ACS-5014] Updated playwright.config.ts * [ACS-5014] Copy and Move tests are now working * [ACS-5014] Removed unneeded test.only * [ACS-5014] Added test case IDs to E2E tests * [ACS-6211] Removed TODO note. Removed protractor test case files * [ACS-5014] Added E2E tests for Destination Picker in copy-move actions * [ACS-5014] Removed unneded only from test suite * [ACS-5014] Updated import of logger from @alfresco/adf-cli to @alfresco/adf-testing * [ACS-5014] Addressed code review findings. Moved objects to beforeAll/beforeEach wherever applicable. Added missing await. * [ACS-5014] Addressed code review findings. Removed unused methods/objects from content-node-selector-dialog.ts * [ACS-5014] Addressed code review findings. Removed unused methods/objects from content-node-selector-dialog.ts * [ACS-5014] SonarLint fix * [ACS-5014] Fixed breaking change for other E2Es * [ACS-5014] Updated E2Es to use correct locator for more actions button
This commit is contained in:
@@ -192,18 +192,22 @@ export class DataTableComponent extends BaseComponent {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((await this.pagination.currentPageLocator.textContent()) !== ' Page 1 ') {
|
||||
await this.pagination.navigateToPage(1);
|
||||
}
|
||||
|
||||
const maxPages = (await this.pagination.totalPageLocator.textContent()).match(/\d/)[0];
|
||||
for (let page = 1; page <= Number(maxPages); page++) {
|
||||
if (await this.getRowByName(name).isVisible()) {
|
||||
break;
|
||||
if (await this.pagination.currentPageLocator.isVisible()) {
|
||||
if ((await this.pagination.currentPageLocator.textContent()) !== ' Page 1 ') {
|
||||
await this.pagination.navigateToPage(1);
|
||||
}
|
||||
}
|
||||
if (await this.pagination.totalPageLocator.isVisible()) {
|
||||
const maxPages = (await this.pagination.totalPageLocator?.textContent())?.match(/\d/)[0];
|
||||
for (let page = 1; page <= Number(maxPages); page++) {
|
||||
if (await this.getRowByName(name).isVisible()) {
|
||||
break;
|
||||
}
|
||||
if (await this.pagination.getArrowLocatorFor(PaginationActionsType.NextPageSelector).isEnabled()) {
|
||||
await this.pagination.getArrowLocatorFor(PaginationActionsType.NextPageSelector).click();
|
||||
}
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
await this.pagination.getArrowLocatorFor(PaginationActionsType.NextPageSelector).isEnabled();
|
||||
await this.pagination.getArrowLocatorFor(PaginationActionsType.NextPageSelector).click();
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@ export class ContentNodeSelectorDialog extends BaseComponent {
|
||||
private selectedRow = this.getChild('.adf-is-selected');
|
||||
getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-select-panel .mat-option-text', { hasText: optionName });
|
||||
private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() });
|
||||
getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text });
|
||||
getDialogTitle = (text: string) => this.getChild('[data-automation-id="content-node-selector-title"]', { hasText: text });
|
||||
getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text });
|
||||
getFolderIcon = this.getChild('mat-icon[role="img"]', { hasText: "folder" });
|
||||
|
||||
|
@@ -28,7 +28,11 @@ import { BaseComponent } from '../base.component';
|
||||
export class SnackBarComponent extends BaseComponent {
|
||||
private static rootElement = 'adf-snackbar-content';
|
||||
|
||||
public message = this.getChild(' [data-automation-id=\'adf-snackbar-message-content\']').first();
|
||||
public message = this.getChild('[data-automation-id="adf-snackbar-message-content"]').first();
|
||||
|
||||
public actionButton = this.getChild('[data-automation-id="adf-snackbar-message-content-action-button"]')
|
||||
|
||||
public closeIcon = this.getChild('.adf-snackbar-message-content-action-icon');
|
||||
public getByMessageLocator = (message: string) => this.getChild(`[data-automation-id='adf-snackbar-message-content']`,
|
||||
{ hasText: message }).first();
|
||||
|
||||
|
Reference in New Issue
Block a user