mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-7298] beforeEach and afterAll updated for list-views (#3734)
* [ACS-7298] beforeEach and afterAll updated for list-views * [ACS-7298] 'only' deleted
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
const crypto = require('crypto');
|
||||
import * as path from 'path';
|
||||
import { LoginPage, MyLibrariesPage, PersonalFilesPage, FavoritesLibrariesPage, SearchPage, SharedPage } from '../';
|
||||
import { LoginPage, MyLibrariesPage, PersonalFilesPage, FavoritesLibrariesPage, SearchPage, SharedPage, TrashPage } from '../';
|
||||
import { NodesApi, TrashcanApi, SitesApi } from '@alfresco/playwright-shared';
|
||||
|
||||
export class Utils {
|
||||
@@ -102,7 +102,7 @@ export class Utils {
|
||||
static async reloadPageIfRowNotVisible(
|
||||
pageContext: PersonalFilesPage | MyLibrariesPage | FavoritesLibrariesPage | SearchPage | SharedPage,
|
||||
nodeName: string,
|
||||
errorMessage = 'Error '
|
||||
errorMessage = 'reloadPageIfRowNotVisible Error '
|
||||
): Promise<void> {
|
||||
try {
|
||||
if (!await pageContext.dataTable.getRowByName(nodeName).isVisible()) {
|
||||
@@ -112,4 +112,17 @@ export class Utils {
|
||||
console.error(`${errorMessage}: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
static async reloadPageIfDatatableEmpty(
|
||||
pageContext: PersonalFilesPage | MyLibrariesPage | FavoritesLibrariesPage | SearchPage | SharedPage | TrashPage,
|
||||
errorMessage = 'reloadPageIfDatatableEmpty Error '
|
||||
): Promise<void> {
|
||||
try {
|
||||
if (await pageContext.dataTable.getEmptyFolderLocator.isVisible() || await pageContext.dataTable.emptyListTitle.isVisible()) {
|
||||
await pageContext.page.reload({ waitUntil: 'load' });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`${errorMessage}: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user