[ACS-7295] create actions - beforeEach and afterAll refactored (#3730)

* [ACS-7295] create actions beforeEach and afterAll refactored

* [ACS-7295] review fix 1

* [ACS-7295] review fix 2
This commit is contained in:
Adam Świderski
2024-03-25 16:07:01 +01:00
committed by GitHub
parent 419f35e879
commit 2046630f58
5 changed files with 39 additions and 76 deletions

View File

@@ -39,16 +39,13 @@ test.describe('Move actions', () => {
let sourceFolder: string;
let destinationFolder: string;
test.afterAll(async ({ nodesApiAction }) => {
await Utils.deleteNodesSitesEmptyTrashcan(nodesApiAction, trashcanApi, 'afterAll failed');
});
test.beforeAll(async () => {
try {
const apiClientFactory = new ApiClientFactory();
await apiClientFactory.setUpAcaBackend('admin');
await apiClientFactory.createUser({ username });
nodesApi = await NodesApi.initialize(username, username);
trashcanApi = await TrashcanApi.initialize(username, username);
} catch {}
});
@@ -68,6 +65,10 @@ test.describe('Move actions', () => {
await personalFiles.navigate();
});
test.afterAll(async () => {
await Utils.deleteNodesSitesEmptyTrashcan(nodesApi, trashcanApi, 'afterAll failed');
});
const moveContentInPersonalFiles = async (personalFilesPage: PersonalFilesPage, sourceFileList: string[], destinationName: string) => {
await personalFilesPage.copyOrMoveContentInDatatable(sourceFileList, destinationName, 'Move');
await personalFilesPage.spinner.waitForReload();