diff --git a/tests/e2e/specs/MochaHooks.ts b/tests/e2e/specs/MochaHooks.ts index 42a403628b1b..e16d597c6156 100644 --- a/tests/e2e/specs/MochaHooks.ts +++ b/tests/e2e/specs/MochaHooks.ts @@ -26,13 +26,19 @@ import { decorate, injectable, unmanaged } from 'inversify'; import { Main } from '@eclipse-che/che-devworkspace-generator/lib/main'; import { LocatorLoader } from 'monaco-page-objects/out/locators/loader'; import { REPORTER_CONSTANTS } from '../constants/REPORTER_CONSTANTS'; +import { WorkspaceHandlingTests } from '../tests-library/WorkspaceHandlingTests'; const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); let latestWorkspace: string = ''; export let rpApi: any = undefined; export function registerRunningWorkspace(workspaceName: string): void { - workspaceName !== '' ? Logger.debug(`with workspaceName:${workspaceName}`) : Logger.debug('delete workspace name'); + workspaceName !== '' + ? Logger.debug(`with workspaceName:${workspaceName}`) + : ((): void => { + Logger.debug('delete workspace name'); + WorkspaceHandlingTests.clearWorkspaceName(); + })(); latestWorkspace = workspaceName; } diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index fb2370d1a0c3..6dfebb021dfb 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -42,6 +42,10 @@ export class WorkspaceHandlingTests { return WorkspaceHandlingTests.workspaceName; } + static clearWorkspaceName(): void { + WorkspaceHandlingTests.workspaceName = 'undefined'; + } + async createAndOpenWorkspace(stack: string): Promise { await this.dashboard.clickWorkspacesButton(); await this.dashboard.waitPage();