Skip to content

Commit

Permalink
fix: update method to clear ws name in WorkspaceHandlingTests.ts
Browse files Browse the repository at this point in the history
Signed-off-by: mdolhalo <[email protected]>
  • Loading branch information
mdolhalo committed Oct 29, 2023
1 parent 74ea11c commit bd87e08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/e2e/specs/MochaHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/tests-library/WorkspaceHandlingTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export class WorkspaceHandlingTests {
return WorkspaceHandlingTests.workspaceName;
}

static clearWorkspaceName(): void {
WorkspaceHandlingTests.workspaceName = 'undefined';
}

async createAndOpenWorkspace(stack: string): Promise<void> {
await this.dashboard.clickWorkspacesButton();
await this.dashboard.waitPage();
Expand Down

0 comments on commit bd87e08

Please sign in to comment.