From 5dbcefa3d16d3b29981b5564b3a811acf898466f Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 16 Nov 2021 14:07:22 -0500 Subject: [PATCH] Fix integration tests Signed-off-by: Sebastian Malton --- integration/__tests__/cluster-pages.tests.ts | 5 ++++- integration/helpers/utils.ts | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/integration/__tests__/cluster-pages.tests.ts b/integration/__tests__/cluster-pages.tests.ts index 64ca60380d..930c852fe8 100644 --- a/integration/__tests__/cluster-pages.tests.ts +++ b/integration/__tests__/cluster-pages.tests.ts @@ -328,6 +328,8 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { }, 10*60*1000); afterEach(async () => { + await frame.click(`[data-testid="sidebar-cluster-dropdown"]`); + await frame.click(`.Menu >> text="Disconnect"`); await cleanup(); }, 10*60*1000); @@ -337,6 +339,7 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { await frame.waitForSelector(`.Menu >> text="Settings"`); await frame.waitForSelector(`.Menu >> text="Disconnect"`); await frame.waitForSelector(`.Menu >> text="Delete"`); + await frame.click(`[data-testid="sidebar-cluster-dropdown"]`); }); it("should navigate around common cluster pages", async () => { @@ -370,7 +373,7 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => { } }, 10*60*1000); - + it("show logs and highlight the log search entries", async () => { await frame.click(`a[href="/workloads"]`); diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index ad140d346e..783111d0fd 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -72,7 +72,12 @@ export async function start() { ...process.env, }, timeout: 100_000, - } as Parameters[0]); + }); + + const cleanup = async () => { + await app.close(); + await remove(CICD).catch(noop); + }; try { const window = await getMainWindow(app); @@ -80,14 +85,10 @@ export async function start() { return { app, window, - cleanup: async () => { - await app.close(); - await remove(CICD).catch(noop); - }, + cleanup, }; } catch (error) { - await app.close(); - await remove(CICD).catch(noop); + await cleanup(); throw error; } }