refactoring for create folder tests (#3360)

* refactoring for create folder tests

* adding spinnerWaitForReload

* update optional
This commit is contained in:
Adam Zakrzewski
2023-07-24 14:19:17 +02:00
committed by GitHub
parent 118bf5b33f
commit 6d7287d668
4 changed files with 112 additions and 83 deletions

View File

@@ -40,4 +40,18 @@ export class AdfFolderDialogComponent extends BaseComponent {
}
public getLabelText = (text: string) => this.getChild('label', { hasText: text });
/**
* This method is used when we want to fill in Create new Folder Dialog and choose Create button
*
* @param nameInput input for the Name field
* @param titleInput input for Title field
* @param descriptionInput input for Description field
*/
async createNewFolderDialog(nameInput: string, titleInput?: string, descriptionInput?: string): Promise<void> {
await this.folderNameInputLocator.fill(nameInput);
if (titleInput) { await this.folderTitleInput.fill(titleInput); }
if (descriptionInput) { await this.folderDescriptionInput.fill(descriptionInput); }
await this.createButton.click();
}
}

View File

@@ -55,6 +55,7 @@ export class AdfLibraryDialogComponent extends BaseComponent {
if (descriptionInput) { await this.getLabelText('Description').fill(descriptionInput); }
if (visibility) { await this.getLabelText(visibility).click(); }
await this.createButton.click();
await this.spinnerWaitForReload();
}
async isErrorMessageDisplayed(errorText: string): Promise<boolean> {

View File

@@ -41,4 +41,9 @@ export class PersonalFilesPage extends BasePage {
public dataTable = new DataTableComponent(this.page);
public viewer = new ViewerComponent(this.page);
public passwordDialog = new PasswordOverlayDialogComponent(this.page);
async selectCreateFolder(): Promise<void> {
await this.acaHeader.createButton.click();
await this.matMenu.createFolder.click();
}
}