From af832199982c5f760d2a0b9bc6ad70a6f71b0960 Mon Sep 17 00:00:00 2001 From: "adam.zakrzewski" Date: Tue, 19 Dec 2023 15:15:12 +0100 Subject: [PATCH] move nodesApi initialize and delete --- .../tests/create/create-file-from-template.spec.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/e2e/playwright/actions/src/tests/create/create-file-from-template.spec.ts b/e2e/playwright/actions/src/tests/create/create-file-from-template.spec.ts index 2ebf936043..0b5d87e915 100644 --- a/e2e/playwright/actions/src/tests/create/create-file-from-template.spec.ts +++ b/e2e/playwright/actions/src/tests/create/create-file-from-template.spec.ts @@ -108,6 +108,7 @@ test.describe('Create file from template', () => { await nodesApiAction.createContent(templates, `Data Dictionary/Node Templates`); await nodesApiAction.removeUserAccessOnNodeTemplate(restrictedTemplateFolder); fileLink = (await nodesApiAction.createLinkToFileName(template2InRoot, await nodesApiAction.getNodeTemplatesFolderId())).entry.name; + nodesApi = await NodesApi.initialize(username, username); } catch (error) { console.error(`Main beforeAll failed: ${error}`); } @@ -137,16 +138,13 @@ test.describe('Create file from template', () => { template1InRoot, template2InRoot ]); + await nodesApi.deleteCurrentUserNodes(); } catch (error) { console.error(`Main afterAll failed: ${error}`); } }); test.describe('Personal Files page', () => { - test.beforeAll(async () => { - nodesApi = await NodesApi.initialize(username, username); - }); - test.beforeEach(async ({ personalFiles }) => { try { selectFileTemplateDialog = personalFiles.contentNodeSelector; @@ -159,14 +157,6 @@ test.describe('Create file from template', () => { } }); - test.afterAll(async () => { - try { - await nodesApi.deleteCurrentUserNodes(); - } catch (error) { - console.error(`Personal Files page, afterAll failed: ${error}`); - } - }); - test.describe('Select Template dialog', () => { test('[C325043] Select template - dialog UI - with existing templates', async () => { await expect.soft(selectFileTemplateDialog.getDialogTitle(selectDialogTitle)).toBeVisible();