diff --git a/.eslintrc.json b/.eslintrc.json index ef1883962..0fc0564e3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -329,7 +329,7 @@ } }, { - "files": ["*.e2e.ts"], + "files": ["*.e2e.ts", "*.ts"], "extends": ["plugin:playwright/playwright-test"], "rules": { "no-empty-pattern": "off", diff --git a/e2e/playwright/special-permissions-actions-available/src/tests/folders-actions.e2e.ts b/e2e/playwright/special-permissions-actions-available/src/tests/folders-actions.e2e.ts index 0cf9c9c5f..5fc2823cf 100644 --- a/e2e/playwright/special-permissions-actions-available/src/tests/folders-actions.e2e.ts +++ b/e2e/playwright/special-permissions-actions-available/src/tests/folders-actions.e2e.ts @@ -29,7 +29,7 @@ test.describe('Folders - available actions : ', () => { const username = `user-${Utils.random()}`; let parentId: string; let nodesApi: NodesApi; - let trashCanActions: TrashcanApi; + let trashcanApi: TrashcanApi; async function checkActionsAvailable( myPersonalFiles: PersonalFilesPage, @@ -61,7 +61,7 @@ test.describe('Folders - available actions : ', () => { await apiClientFactory.createUser({ username }); nodesApi = await NodesApi.initialize(username, username); const favoritesActions = await FavoritesPageApi.initialize(username, username); - trashCanActions = await TrashcanApi.initialize(username, username); + trashcanApi = await TrashcanApi.initialize(username, username); parentId = (await nodesApi.createFolder(parentName)).entry.id; await nodesApi.createFile(testData.file.name, parentId); await nodesApi.createFolder(testData.folderFile.name, parentId); @@ -72,14 +72,13 @@ test.describe('Folders - available actions : ', () => { }); test.afterAll(async () => { - await nodesApi.deleteNodes([parentId]); - await trashCanActions.emptyTrashcan(); + await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed'); }); test.describe('on Personal Files : ', () => { test.beforeEach(async ({ personalFiles, loginPage }) => { + await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed'); await personalFiles.navigate({ remoteUrl: `#/personal-files/${parentId}` }); - await loginPage.loginUser({ username, password: username }); }); test('Folder not favorite - [C213123]', async ({ personalFiles }) => { diff --git a/e2e/playwright/special-permissions-actions-available/src/tests/other-permissions.ts b/e2e/playwright/special-permissions-actions-available/src/tests/other-permissions.ts index 476adbbe7..5064570b8 100644 --- a/e2e/playwright/special-permissions-actions-available/src/tests/other-permissions.ts +++ b/e2e/playwright/special-permissions-actions-available/src/tests/other-permissions.ts @@ -22,7 +22,7 @@ * from Hyland Software. If not, see . */ -import { MyLibrariesPage, test } from '@alfresco/playwright-shared'; +import { MyLibrariesPage, test, Utils } from '@alfresco/playwright-shared'; import * as testData from '@alfresco/playwright-shared'; import { expect } from '@playwright/test'; @@ -54,8 +54,7 @@ async function checkActionsViewerAvailable( export function collaboratorTests(userCollaborator: string, siteName: string) { test.describe('available actions : ', () => { test.beforeEach(async ({ loginPage }) => { - await loginPage.navigate(); - await loginPage.loginUser({ username: userCollaborator, password: userCollaborator }); + await Utils.tryLoginUser(loginPage, userCollaborator, userCollaborator, 'beforeEach failed'); }); test('on File Libraries - [C297647]', async ({ myLibrariesPage }) => { @@ -242,8 +241,7 @@ export function filesLockedByCurrentUser(userDemoted: string, siteName?: string) export function filesLockedByOtherUser(userManager: string, siteName?: string) { test.describe('available actions : ', () => { test.beforeEach(async ({ loginPage }) => { - await loginPage.navigate(); - await loginPage.loginUser({ username: userManager, password: userManager }); + await Utils.tryLoginUser(loginPage, userManager, userManager, 'beforeEach failed'); }); test('on File Libraries - [C297664]', async ({ myLibrariesPage }) => { diff --git a/e2e/playwright/special-permissions-actions-available/src/tests/special-permissions-actions.e2e.ts b/e2e/playwright/special-permissions-actions-available/src/tests/special-permissions-actions.e2e.ts index 378d8beb7..8caefa2c5 100644 --- a/e2e/playwright/special-permissions-actions-available/src/tests/special-permissions-actions.e2e.ts +++ b/e2e/playwright/special-permissions-actions-available/src/tests/special-permissions-actions.e2e.ts @@ -35,7 +35,8 @@ import { test, SharedLinksApi, SearchPageApi, - timeouts + timeouts, + Utils } from '@alfresco/playwright-shared'; import { Site } from '@alfresco/js-api'; @@ -80,7 +81,7 @@ test.describe('Special permissions : ', () => { let managerSearchActions: SearchPageApi; test.beforeAll(async () => { - test.setTimeout(timeouts.extendedTest); + test.setTimeout(timeouts.extendedLongTest); await apiClientFactory.setUpAcaBackend('admin'); await apiClientFactory.createUser({ username: userManager }); await apiClientFactory.createUser({ username: userConsumer }); @@ -180,7 +181,7 @@ test.describe('Special permissions : ', () => { }); test.afterAll(async () => { - await managerSiteActions.deleteSites([sitePrivate]); + await Utils.deleteNodesSitesEmptyTrashcan(undefined, undefined, 'afterAll failed', managerSiteActions, [sitePrivate]); }); test.describe('Consumer', () => {