mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-7305] beforeEach and afterAll updated for viewer tests (#3830)
This commit is contained in:
parent
eeca6b1a83
commit
995305fc13
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import { ApiClientFactory, FileActionsApi, LoginPage, NodesApi, SitesApi, test, TEST_FILES, Utils } from '@alfresco/playwright-shared';
|
import { ApiClientFactory, FileActionsApi, NodesApi, SitesApi, test, TEST_FILES, Utils, TrashcanApi } from '@alfresco/playwright-shared';
|
||||||
import { SiteBodyCreate } from '@alfresco/js-api';
|
import { SiteBodyCreate } from '@alfresco/js-api';
|
||||||
|
|
||||||
test.describe('from File Libraries', () => {
|
test.describe('from File Libraries', () => {
|
||||||
@ -34,6 +34,7 @@ test.describe('from File Libraries', () => {
|
|||||||
let destinationId: string;
|
let destinationId: string;
|
||||||
const xlsxLibraries = `xlsxFL-${Utils.random()}`;
|
const xlsxLibraries = `xlsxFL-${Utils.random()}`;
|
||||||
let nodesApi: NodesApi;
|
let nodesApi: NodesApi;
|
||||||
|
let trashcanApi: TrashcanApi;
|
||||||
let sitesApi: SitesApi;
|
let sitesApi: SitesApi;
|
||||||
let fileApi: FileActionsApi;
|
let fileApi: FileActionsApi;
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ test.describe('from File Libraries', () => {
|
|||||||
await apiClientFactory.setUpAcaBackend('admin');
|
await apiClientFactory.setUpAcaBackend('admin');
|
||||||
await apiClientFactory.createUser({ username });
|
await apiClientFactory.createUser({ username });
|
||||||
nodesApi = await NodesApi.initialize(username, username);
|
nodesApi = await NodesApi.initialize(username, username);
|
||||||
|
trashcanApi = await TrashcanApi.initialize(username, username);
|
||||||
sitesApi = await SitesApi.initialize(username, username);
|
sitesApi = await SitesApi.initialize(username, username);
|
||||||
fileApi = await FileActionsApi.initialize(username, username);
|
fileApi = await FileActionsApi.initialize(username, username);
|
||||||
try {
|
try {
|
||||||
@ -52,22 +54,12 @@ test.describe('from File Libraries', () => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
});
|
});
|
||||||
|
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ loginPage }) => {
|
||||||
const loginPage = new LoginPage(page);
|
await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed');
|
||||||
await loginPage.loginUser(
|
|
||||||
{ username: username, password: username },
|
|
||||||
{
|
|
||||||
withNavigation: true,
|
|
||||||
waitForLoading: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async () => {
|
test.afterAll(async () => {
|
||||||
try {
|
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed', sitesApi, [siteName]);
|
||||||
await sitesApi.deleteSites([siteName]);
|
|
||||||
await nodesApi.deleteNodes([destinationId]);
|
|
||||||
} catch {}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C286371] Move action from File Libraries', async ({ myLibrariesPage, personalFiles }) => {
|
test('[C286371] Move action from File Libraries', async ({ myLibrariesPage, personalFiles }) => {
|
||||||
|
@ -27,14 +27,14 @@ import {
|
|||||||
ApiClientFactory,
|
ApiClientFactory,
|
||||||
FavoritesPageApi,
|
FavoritesPageApi,
|
||||||
FileActionsApi,
|
FileActionsApi,
|
||||||
LoginPage,
|
|
||||||
NodesApi,
|
NodesApi,
|
||||||
SharedLinksApi,
|
SharedLinksApi,
|
||||||
SitesApi,
|
SitesApi,
|
||||||
test,
|
test,
|
||||||
TEST_FILES,
|
TEST_FILES,
|
||||||
timeouts,
|
timeouts,
|
||||||
Utils
|
Utils,
|
||||||
|
TrashcanApi
|
||||||
} from '@alfresco/playwright-shared';
|
} from '@alfresco/playwright-shared';
|
||||||
import { Site } from '@alfresco/js-api';
|
import { Site } from '@alfresco/js-api';
|
||||||
|
|
||||||
@ -51,6 +51,7 @@ test.describe('viewer file', () => {
|
|||||||
let folderId: string;
|
let folderId: string;
|
||||||
let fileDocxId: string;
|
let fileDocxId: string;
|
||||||
let nodesApi: NodesApi;
|
let nodesApi: NodesApi;
|
||||||
|
let trashcanApi: TrashcanApi;
|
||||||
|
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
test.setTimeout(timeouts.extendedTest);
|
test.setTimeout(timeouts.extendedTest);
|
||||||
@ -60,6 +61,7 @@ test.describe('viewer file', () => {
|
|||||||
await apiClientFactory.createUser({ username });
|
await apiClientFactory.createUser({ username });
|
||||||
nodesApi = await NodesApi.initialize(username, username);
|
nodesApi = await NodesApi.initialize(username, username);
|
||||||
const fileActionApi = await FileActionsApi.initialize(username, username);
|
const fileActionApi = await FileActionsApi.initialize(username, username);
|
||||||
|
trashcanApi = await TrashcanApi.initialize(username, username);
|
||||||
const shareActions = await SharedLinksApi.initialize(username, username);
|
const shareActions = await SharedLinksApi.initialize(username, username);
|
||||||
const favoritesActions = await FavoritesPageApi.initialize(username, username);
|
const favoritesActions = await FavoritesPageApi.initialize(username, username);
|
||||||
const siteActionsUser = await SitesApi.initialize(username, username);
|
const siteActionsUser = await SitesApi.initialize(username, username);
|
||||||
@ -89,20 +91,13 @@ test.describe('viewer file', () => {
|
|||||||
await fileActionApi.waitForNodes(randomDocxName, { expect: 1 });
|
await fileActionApi.waitForNodes(randomDocxName, { expect: 1 });
|
||||||
});
|
});
|
||||||
|
|
||||||
test.beforeEach(async ({ personalFiles, page }) => {
|
test.beforeEach(async ({ personalFiles, loginPage }) => {
|
||||||
const loginPage = new LoginPage(page);
|
await Utils.tryLoginUser(loginPage, username, username, 'beforeEach failed');
|
||||||
await loginPage.loginUser(
|
|
||||||
{ username, password: username },
|
|
||||||
{
|
|
||||||
withNavigation: true,
|
|
||||||
waitForLoading: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await personalFiles.navigate({ remoteUrl: `#/personal-files/${folderId}` });
|
await personalFiles.navigate({ remoteUrl: `#/personal-files/${folderId}` });
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async () => {
|
test.afterAll(async () => {
|
||||||
await nodesApi.deleteCurrentUserNodes();
|
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[C279269] Viewer opens on double clicking on a file from Personal Files', async ({ personalFiles }) => {
|
test('[C279269] Viewer opens on double clicking on a file from Personal Files', async ({ personalFiles }) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user