From 5bb7c210a5fa71776d32d13ff48b21d1baf96889 Mon Sep 17 00:00:00 2001 From: Akash Rathod <41251473+akashrathod28@users.noreply.github.com> Date: Tue, 2 Jan 2024 15:11:22 +0530 Subject: [PATCH] [ACS-6535]add e2e test suite for copy-move-actions (#3576) * add e2e test suite for copy-action * code fix * [ACS-6457] Migrated unshare-file e2es to playwright (#3575) * [ACS-6457] Migrated unshare-file e2es to playwright * Removed only * [ACS-6457] Removed protractor file * Updated timeout * Updated timeout * Removed clickClose method * Addressed review comments * Addressed review comments * Created a separate test suit for share-actions * Remove only * rebase * code fix * code fix --------- --- .github/workflows/pull-request.yml | 2 ++ projects/aca-playwright-shared/src/api/file-actions.ts | 4 ++-- projects/aca-playwright-shared/src/api/nodes-api.ts | 4 ++-- projects/aca-playwright-shared/src/api/search-api.ts | 2 +- projects/aca-playwright-shared/src/api/shared-links-api.ts | 2 +- .../src/page-objects/components/conditions.component.ts | 6 +----- .../components/dataTable/data-table.component.ts | 6 +++--- 7 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 86d0e8afa..812f8ec0a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -176,6 +176,8 @@ jobs: id: 8 - name: "share-action" id: 9 + - name: "copy-move-actions" + id: 10 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/projects/aca-playwright-shared/src/api/file-actions.ts b/projects/aca-playwright-shared/src/api/file-actions.ts index 1e67b1957..870ef93aa 100644 --- a/projects/aca-playwright-shared/src/api/file-actions.ts +++ b/projects/aca-playwright-shared/src/api/file-actions.ts @@ -43,7 +43,7 @@ export class FileActionsApi { async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise { const file = fs.createReadStream(fileLocation); - return this.apiService.upload.uploadFile(file, '', parentFolderId, null, { + return await this.apiService.upload.uploadFile(file, '', parentFolderId, null, { name: fileName, nodeType: 'cm:content', renditions: 'doclib' @@ -149,7 +149,7 @@ export class FileActionsApi { }; try { - return this.apiService.search.search(data); + return await this.apiService.search.search(data); } catch (error) { Logger.error(`SearchApi queryNodesNames : catch : `, error); return new ResultSetPaging(); diff --git a/projects/aca-playwright-shared/src/api/nodes-api.ts b/projects/aca-playwright-shared/src/api/nodes-api.ts index 3ef94b088..50d9609ea 100755 --- a/projects/aca-playwright-shared/src/api/nodes-api.ts +++ b/projects/aca-playwright-shared/src/api/nodes-api.ts @@ -130,7 +130,7 @@ export class NodesApi { async renameNode(nodeId: string, newName: string): Promise { try { - return this.apiService.nodes.updateNode(nodeId, { name: newName }); + return await this.apiService.nodes.updateNode(nodeId, { name: newName }); } catch (error) { console.error(`${this.constructor.name} ${this.renameNode.name}`, error); return null; @@ -335,7 +335,7 @@ export class NodesApi { private async addAspects(nodeId: string, aspectNames: string[]): Promise { try { - return this.apiService.nodes.updateNode(nodeId, { aspectNames }); + return await this.apiService.nodes.updateNode(nodeId, { aspectNames }); } catch (error) { console.error(`${this.constructor.name} ${this.addAspects.name}`, error); return null; diff --git a/projects/aca-playwright-shared/src/api/search-api.ts b/projects/aca-playwright-shared/src/api/search-api.ts index ecc90b2b3..28b92a5c1 100755 --- a/projects/aca-playwright-shared/src/api/search-api.ts +++ b/projects/aca-playwright-shared/src/api/search-api.ts @@ -53,7 +53,7 @@ export class SearchPageApi { }; try { - return this.apiService.search.search(data); + return await this.apiService.search.search(data); } catch (error) { Logger.error(`SearchApi queryRecentFiles : catch : `, error); return new ResultSetPaging; diff --git a/projects/aca-playwright-shared/src/api/shared-links-api.ts b/projects/aca-playwright-shared/src/api/shared-links-api.ts index 0a551213e..7687036e3 100755 --- a/projects/aca-playwright-shared/src/api/shared-links-api.ts +++ b/projects/aca-playwright-shared/src/api/shared-links-api.ts @@ -89,7 +89,7 @@ export class SharedLinksApi { } }; - return Utils.retryCall(sharedFile); + return await Utils.retryCall(sharedFile); } catch (error) { console.error(`SharedLinksApi waitForFilesToBeShared : catch : ${error}`); console.error(`\tWait timeout reached waiting for files to be shared`); diff --git a/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts b/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts index a3bb86c5a..659ed03b3 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts @@ -22,7 +22,7 @@ * from Hyland Software. If not, see . */ -import { Locator, Page } from '@playwright/test'; +import { Locator } from '@playwright/test'; import { ManageRulesDialogComponent } from './manageRules/manage-rules-dialog.component'; export enum Field { @@ -41,10 +41,6 @@ export enum Comparator { export class ConditionComponent extends ManageRulesDialogComponent { private getOptionLocator = (optionName: string): Locator => this.page.locator(`.cdk-overlay-pane .mat-option span`, { hasText: optionName }); - constructor(page: Page) { - super(page); - } - private async selectField(fields: Partial, index: number): Promise { await this.fieldDropDown.nth(index).click(); const option = this.getOptionLocator(fields); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts index 8bdd991e2..4e51c8a41 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dataTable/data-table.component.ts @@ -201,13 +201,13 @@ export class DataTableComponent extends BaseComponent { async goThroughPagesLookingForRowWithName(name: string | number): Promise { await this.spinnerWaitForReload(); - if ((await this.getRowByName(name).isVisible()) || (await this.pagination.totalPageLocator.textContent()) === ' of 1 ') { + if (await this.getRowByName(name).isVisible()) { return null; } if (await this.pagination.currentPageLocator.isVisible()) { - if ((await this.pagination.currentPageLocator.textContent()) !== ' Page 1 ') { - await this.pagination.navigateToPage(1); + if ((await this.pagination.currentPageLocator.textContent()) === ' of 1 ') { + return null; } } if (await this.pagination.totalPageLocator.isVisible()) {