[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

---------
This commit is contained in:
Akash Rathod
2024-01-02 15:11:22 +05:30
committed by GitHub
parent 381ce2faba
commit 5bb7c210a5
7 changed files with 12 additions and 14 deletions

View File

@@ -176,6 +176,8 @@ jobs:
id: 8 id: 8
- name: "share-action" - name: "share-action"
id: 9 id: 9
- name: "copy-move-actions"
id: 10
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@@ -43,7 +43,7 @@ export class FileActionsApi {
async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<NodeEntry> { async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<NodeEntry> {
const file = fs.createReadStream(fileLocation); const file = fs.createReadStream(fileLocation);
return this.apiService.upload.uploadFile(file, '', parentFolderId, null, { return await this.apiService.upload.uploadFile(file, '', parentFolderId, null, {
name: fileName, name: fileName,
nodeType: 'cm:content', nodeType: 'cm:content',
renditions: 'doclib' renditions: 'doclib'
@@ -149,7 +149,7 @@ export class FileActionsApi {
}; };
try { try {
return this.apiService.search.search(data); return await this.apiService.search.search(data);
} catch (error) { } catch (error) {
Logger.error(`SearchApi queryNodesNames : catch : `, error); Logger.error(`SearchApi queryNodesNames : catch : `, error);
return new ResultSetPaging(); return new ResultSetPaging();

View File

@@ -130,7 +130,7 @@ export class NodesApi {
async renameNode(nodeId: string, newName: string): Promise<NodeEntry | null> { async renameNode(nodeId: string, newName: string): Promise<NodeEntry | null> {
try { try {
return this.apiService.nodes.updateNode(nodeId, { name: newName }); return await this.apiService.nodes.updateNode(nodeId, { name: newName });
} catch (error) { } catch (error) {
console.error(`${this.constructor.name} ${this.renameNode.name}`, error); console.error(`${this.constructor.name} ${this.renameNode.name}`, error);
return null; return null;
@@ -335,7 +335,7 @@ export class NodesApi {
private async addAspects(nodeId: string, aspectNames: string[]): Promise<NodeEntry> { private async addAspects(nodeId: string, aspectNames: string[]): Promise<NodeEntry> {
try { try {
return this.apiService.nodes.updateNode(nodeId, { aspectNames }); return await this.apiService.nodes.updateNode(nodeId, { aspectNames });
} catch (error) { } catch (error) {
console.error(`${this.constructor.name} ${this.addAspects.name}`, error); console.error(`${this.constructor.name} ${this.addAspects.name}`, error);
return null; return null;

View File

@@ -53,7 +53,7 @@ export class SearchPageApi {
}; };
try { try {
return this.apiService.search.search(data); return await this.apiService.search.search(data);
} catch (error) { } catch (error) {
Logger.error(`SearchApi queryRecentFiles : catch : `, error); Logger.error(`SearchApi queryRecentFiles : catch : `, error);
return new ResultSetPaging; return new ResultSetPaging;

View File

@@ -89,7 +89,7 @@ export class SharedLinksApi {
} }
}; };
return Utils.retryCall(sharedFile); return await Utils.retryCall(sharedFile);
} catch (error) { } catch (error) {
console.error(`SharedLinksApi waitForFilesToBeShared : catch : ${error}`); console.error(`SharedLinksApi waitForFilesToBeShared : catch : ${error}`);
console.error(`\tWait timeout reached waiting for files to be shared`); console.error(`\tWait timeout reached waiting for files to be shared`);

View File

@@ -22,7 +22,7 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>. * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { Locator, Page } from '@playwright/test'; import { Locator } from '@playwright/test';
import { ManageRulesDialogComponent } from './manageRules/manage-rules-dialog.component'; import { ManageRulesDialogComponent } from './manageRules/manage-rules-dialog.component';
export enum Field { export enum Field {
@@ -41,10 +41,6 @@ export enum Comparator {
export class ConditionComponent extends ManageRulesDialogComponent { export class ConditionComponent extends ManageRulesDialogComponent {
private getOptionLocator = (optionName: string): Locator => this.page.locator(`.cdk-overlay-pane .mat-option span`, { hasText: optionName }); 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<Field>, index: number): Promise<void> { private async selectField(fields: Partial<Field>, index: number): Promise<void> {
await this.fieldDropDown.nth(index).click(); await this.fieldDropDown.nth(index).click();
const option = this.getOptionLocator(fields); const option = this.getOptionLocator(fields);

View File

@@ -201,13 +201,13 @@ export class DataTableComponent extends BaseComponent {
async goThroughPagesLookingForRowWithName(name: string | number): Promise<void> { async goThroughPagesLookingForRowWithName(name: string | number): Promise<void> {
await this.spinnerWaitForReload(); await this.spinnerWaitForReload();
if ((await this.getRowByName(name).isVisible()) || (await this.pagination.totalPageLocator.textContent()) === ' of 1 ') { if (await this.getRowByName(name).isVisible()) {
return null; return null;
} }
if (await this.pagination.currentPageLocator.isVisible()) { if (await this.pagination.currentPageLocator.isVisible()) {
if ((await this.pagination.currentPageLocator.textContent()) !== ' Page 1 ') { if ((await this.pagination.currentPageLocator.textContent()) === ' of 1 ') {
await this.pagination.navigateToPage(1); return null;
} }
} }
if (await this.pagination.totalPageLocator.isVisible()) { if (await this.pagination.totalPageLocator.isVisible()) {