[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:
Adam Świderski
2024-03-27 10:18:08 +01:00
committed by GitHub
parent 2046630f58
commit d6e6c41a2e
10 changed files with 64 additions and 127 deletions

View File

@@ -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}`);
}
}
}