[ACS-6269] create file from template tests (#3509)

* [ACS-6269] create file from template tests

* applying shorten expression
This commit is contained in:
Adam Zakrzewski
2023-11-07 17:35:04 +01:00
committed by GitHub
parent e8c14e44e1
commit 779e4e4b05
8 changed files with 487 additions and 437 deletions

View File

@@ -50,4 +50,9 @@ export class AcaHeader extends BaseComponent {
await this.createButton.click();
await this.matMenu.createFolderFromTemplate.click();
}
async clickCreateFileFromTemplate(): Promise<void> {
await this.createButton.click();
await this.matMenu.createFileFromTemplate.click();
}
}

View File

@@ -36,6 +36,7 @@ export class MatMenuComponent extends BaseComponent {
public getMenuItemTextLocator = this.getChild('[data-automation-id="menu-item-title"]');
public createFolder = this.getChild('[id="app.create.folder"]');
public createFolderFromTemplate = this.getChild('[id="app.create.folderFromTemplate"]');
public createFileFromTemplate = this.getChild('[id="app.create.fileFromTemplate"]');
public createLibrary = this.getChild('[id="app.create.library"]');
public getButtonByText = (text: string) => this.getChild('button', { hasText: text });

View File

@@ -33,8 +33,8 @@ export class CreateFromTemplateDialogComponent extends BaseComponent {
super(page, CreateFromTemplateDialogComponent.rootElement);
}
cancelButton = this.getChild('[data-automation-id="cancel-folder-template-button"]');
createButton = this.getChild('[data-automation-id="create-folder-template-button"]');
cancelButton = this.getChild('[data-automation-id="create-from-template-dialog-cancel-button"]');
createButton = this.getChild('[data-automation-id="create-from-template-dialog-create-button"]');
getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text });
getDialogLabel = (text: string) => this.getChild('label', { hasText: text });
getErrorByText = (text: string): Locator => this.page.locator('mat-error', {hasText: text});
@@ -46,9 +46,9 @@ export class CreateFromTemplateDialogComponent extends BaseComponent {
}
/**
* This method is used when we want to fill in Create new folder from template dialog and choose Create button
* This method is used when we want to fill in Create new folder/document/file from template dialog and choose Create button
*/
async createNewFolderFromTemplate( nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
async createFromTemplateAction( nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.getDialogLabel('Name *').fill(nameInput);
if (titleInput) { await this.getDialogLabel('Title').fill(titleInput); }
if (descriptionInput) { await this.getDialogLabel('Description').fill(descriptionInput); }