mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
refactoring for create folder tests (#3360)
* refactoring for create folder tests * adding spinnerWaitForReload * update optional
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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> {
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user