mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6954] Refactored search playwright tests (#3700)
* Refactored search playwright tests
This commit is contained in:
@@ -28,6 +28,8 @@ import { DataTableComponent, MatMenuComponent, ViewerComponent, SearchInputCompo
|
||||
import { AcaHeader } from '../components/aca-header.component';
|
||||
import { AdfConfirmDialogComponent, AdfFolderDialogComponent } from '../components/dialogs';
|
||||
|
||||
type SearchType = 'files' | 'folders' | 'filesAndFolders' | 'libraries';
|
||||
|
||||
export class SearchPage extends BasePage {
|
||||
private static pageUrl = 'search';
|
||||
|
||||
@@ -44,4 +46,27 @@ export class SearchPage extends BasePage {
|
||||
public searchOverlay = new SearchOverlayComponent(this.page);
|
||||
public sidenav = new SidenavComponent(this.page);
|
||||
public confirmDialogComponent = new AdfConfirmDialogComponent(this.page);
|
||||
|
||||
async searchWithin(searchText: string, searchType: SearchType): Promise<void> {
|
||||
await this.acaHeader.searchButton.click();
|
||||
await this.searchInput.searchButton.click();
|
||||
switch (searchType) {
|
||||
case 'files':
|
||||
await this.searchInput.checkOnlyFiles();
|
||||
break;
|
||||
case 'folders':
|
||||
await this.searchInput.checkOnlyFolders();
|
||||
break;
|
||||
case 'filesAndFolders':
|
||||
await this.searchInput.checkFilesAndFolders();
|
||||
break;
|
||||
case 'libraries':
|
||||
await this.searchInput.checkLibraries();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
await this.searchInput.searchFor(searchText);
|
||||
await this.dataTable.progressBarWaitForReload();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user