Skip to content

Commit

Permalink
add e2e test suite for copy-action
Browse files Browse the repository at this point in the history
  • Loading branch information
akashrathod28 committed Dec 27, 2023
1 parent 90c69b2 commit d4ddb48
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ jobs:
id: 7
- name: "list-views"
id: 8
- name: "copy-move-actions"
id: 9
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions e2e/playwright/copy-move-actions/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import EXCLUDED_JSON from './exclude.tests.json';
const config: PlaywrightTestConfig<CustomConfig> = {
...getGlobalConfig,

grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Copy Move Actions'),
grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'copy-move-actions'),
projects: [
{
name: 'Copy Move Actions',
name: 'copy-move-actions',
testDir: './src/tests',
use: {
users: ['hruser']
Expand Down
4 changes: 2 additions & 2 deletions projects/aca-playwright-shared/src/api/file-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class FileActionsApi {

async uploadFile(fileLocation: string, fileName: string, parentFolderId: string): Promise<NodeEntry> {
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'
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions projects/aca-playwright-shared/src/api/nodes-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class NodesApi {

async renameNode(nodeId: string, newName: string): Promise<NodeEntry | null> {
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;
Expand Down Expand Up @@ -335,7 +335,7 @@ export class NodesApi {

private async addAspects(nodeId: string, aspectNames: string[]): Promise<NodeEntry> {
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;
Expand Down
2 changes: 1 addition & 1 deletion projects/aca-playwright-shared/src/api/search-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion projects/aca-playwright-shared/src/api/shared-links-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Field>, index: number): Promise<void> {
await this.fieldDropDown.nth(index).click();
const option = this.getOptionLocator(fields);
Expand Down

0 comments on commit d4ddb48

Please sign in to comment.