Skip to content

Commit

Permalink
Changed code blocks order
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzynakita committed Feb 13, 2024
1 parent 18f572c commit 3ce84af
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions e2e/playwright/info-drawer/src/tests/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ import { expect } from '@playwright/test';
import { ApiClientFactory, Utils, test, TrashcanApi, NodesApi, FileActionsApi } from '@alfresco/playwright-shared';

test.describe('Info Drawer - General', () => {
let nodesApi: NodesApi;
let trashcanApi: TrashcanApi;
let fileActionsApi: FileActionsApi;
let trashcanApi: TrashcanApi;
let nodesApi: NodesApi;

const username = `user1-${Utils.random()}`;

test.afterAll(async () => {
test.beforeEach(async ({ loginPage }) => {
try {
await nodesApi.deleteCurrentUserNodes();
await trashcanApi.emptyTrashcan();
await loginPage.loginUser({ username, password: username }, { withNavigation: true, waitForLoading: true });
} catch (error) {
console.error(`afterAll failed: ${error}`);
console.error(`beforeEach failed: ${error}`);
}
});

Expand All @@ -46,19 +45,20 @@ test.describe('Info Drawer - General', () => {
const apiClientFactory = new ApiClientFactory();
await apiClientFactory.setUpAcaBackend('admin');
await apiClientFactory.createUser({ username });
nodesApi = await NodesApi.initialize(username, username);
trashcanApi = await TrashcanApi.initialize(username, username);
fileActionsApi = await FileActionsApi.initialize(username, username);
trashcanApi = await TrashcanApi.initialize(username, username);
nodesApi = await NodesApi.initialize(username, username);
} catch (error) {
console.error(`beforeAll failed: ${error}`);
}
});

test.beforeEach(async ({ loginPage }) => {
test.afterAll(async () => {
try {
await loginPage.loginUser({ username, password: username }, { withNavigation: true, waitForLoading: true });
await trashcanApi.emptyTrashcan();
await nodesApi.deleteCurrentUserNodes();
} catch (error) {
console.error(`beforeEach failed: ${error}`);
console.error(`afterAll failed: ${error}`);
}
});

Expand Down

0 comments on commit 3ce84af

Please sign in to comment.