@eclipse-che/che-e2e 7.124.0-next-c1c068e → 7.124.0-next-cd60f9b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/inversify.config.ts +2 -0
- package/configs/inversify.types.ts +2 -1
- package/constants/BASE_TEST_CONSTANTS.ts +6 -0
- package/dist/configs/inversify.config.js +2 -0
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +2 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/constants/BASE_TEST_CONSTANTS.js +4 -0
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +33 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/UserPreferences.js +73 -0
- package/dist/pageobjects/dashboard/UserPreferences.js.map +1 -1
- package/dist/pageobjects/ide/RestartWorkspaceDialog.js +11 -0
- package/dist/pageobjects/ide/RestartWorkspaceDialog.js.map +1 -1
- package/dist/pageobjects/ide/StatusBarProblemsView.js +62 -0
- package/dist/pageobjects/ide/StatusBarProblemsView.js.map +1 -0
- package/dist/specs/miscellaneous/OpenCodeProviderSmokeTest.spec.js +138 -0
- package/dist/specs/miscellaneous/OpenCodeProviderSmokeTest.spec.js.map +1 -0
- package/dist/specs/restart-tests/RestartFromLocalDevfile.spec.js +101 -0
- package/dist/specs/restart-tests/RestartFromLocalDevfile.spec.js.map +1 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +50 -0
- package/pageobjects/dashboard/UserPreferences.ts +106 -0
- package/pageobjects/ide/RestartWorkspaceDialog.ts +21 -2
- package/pageobjects/ide/StatusBarProblemsView.ts +48 -0
- package/specs/miscellaneous/OpenCodeProviderSmokeTest.spec.ts +175 -0
- package/specs/restart-tests/RestartFromLocalDevfile.spec.ts +125 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2026 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import { e2eContainer } from '../../configs/inversify.config';
|
|
11
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
12
|
+
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
13
|
+
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
14
|
+
import { LoginTests } from '../../tests-library/LoginTests';
|
|
15
|
+
import { registerRunningWorkspace } from '../MochaHooks';
|
|
16
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
17
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
18
|
+
|
|
19
|
+
import { UserPreferences } from '../../pageobjects/dashboard/UserPreferences';
|
|
20
|
+
import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace';
|
|
21
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
22
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
23
|
+
import { KubernetesCommandLineToolsExecutor, ContainerTerminal } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
24
|
+
import { ShellString } from 'shelljs';
|
|
25
|
+
import { expect } from 'chai';
|
|
26
|
+
import { Logger } from '../../utils/Logger';
|
|
27
|
+
|
|
28
|
+
const stackName: string = 'Empty Workspace';
|
|
29
|
+
|
|
30
|
+
suite(`OpenCode Provider Smoke Test ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
31
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
32
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
33
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
34
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
35
|
+
const userPreferences: UserPreferences = e2eContainer.get(CLASSES.UserPreferences);
|
|
36
|
+
const createWorkspace: CreateWorkspace = e2eContainer.get(CLASSES.CreateWorkspace);
|
|
37
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
38
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
39
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
40
|
+
CLASSES.KubernetesCommandLineToolsExecutor
|
|
41
|
+
);
|
|
42
|
+
const containerTerminal: ContainerTerminal = e2eContainer.get(CLASSES.ContainerTerminal);
|
|
43
|
+
|
|
44
|
+
const providerName: string = 'OpenCode';
|
|
45
|
+
const providerId: string = 'opencodeai/opencode';
|
|
46
|
+
const apiKey: string = BASE_TEST_CONSTANTS.TS_AI_PROVIDER_API_KEY;
|
|
47
|
+
const envVarName: string = 'OPENAI_API_KEY';
|
|
48
|
+
const openAiModel: string = 'gpt-4o-mini';
|
|
49
|
+
|
|
50
|
+
async function deleteAiProviderKeys(): Promise<void> {
|
|
51
|
+
Logger.debug('Deleting AI Provider keys if they are present');
|
|
52
|
+
await userPreferences.openUserPreferencesPage();
|
|
53
|
+
await userPreferences.openAiProviderKeysTab();
|
|
54
|
+
await userPreferences.deleteAiProviderKeys(providerName);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
58
|
+
await loginTests.loginIntoChe();
|
|
59
|
+
await deleteAiProviderKeys();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
suite('Add AI Provider API key', function (): void {
|
|
63
|
+
test('Navigate to AI Provider Keys tab', async function (): Promise<void> {
|
|
64
|
+
await userPreferences.openUserPreferencesPage();
|
|
65
|
+
await userPreferences.waitAiProviderKeysTab();
|
|
66
|
+
await userPreferences.openAiProviderKeysTab();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test(`Add ${providerName} API key`, async function (): Promise<void> {
|
|
70
|
+
await userPreferences.addAiProviderKey(providerName, apiKey);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test(`Verify ${providerName} key is present in the list`, async function (): Promise<void> {
|
|
74
|
+
await userPreferences.waitAiProviderKeyPresent(providerId);
|
|
75
|
+
|
|
76
|
+
const actualEnvVarName: string = await userPreferences.getAiProviderEnvVarName(providerId);
|
|
77
|
+
expect(actualEnvVarName).to.equal(envVarName);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
suite('Verify AI Provider on Create Workspace page', function (): void {
|
|
82
|
+
test('Navigate to Create Workspace page', async function (): Promise<void> {
|
|
83
|
+
await dashboard.clickCreateWorkspaceButton();
|
|
84
|
+
await createWorkspace.waitPage();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('Verify AI Provider section is visible', async function (): Promise<void> {
|
|
88
|
+
await createWorkspace.waitAiProviderSectionVisible();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('Expand "Choose an AI Provider" section', async function (): Promise<void> {
|
|
92
|
+
await createWorkspace.expandChooseAiProviderSection();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test(`Verify ${providerName} provider card is visible`, async function (): Promise<void> {
|
|
96
|
+
await createWorkspace.waitAiProviderCardVisible(providerId);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('Verify "Key configured" badge is displayed', async function (): Promise<void> {
|
|
100
|
+
const isBadgeVisible: boolean = await createWorkspace.isAiProviderKeyConfiguredBadgeVisible();
|
|
101
|
+
expect(isBadgeVisible, '"Key configured" badge should be visible').to.be.true;
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
suite('Create workspace and verify AI tool', function (): void {
|
|
106
|
+
test(`Create and open ${stackName}`, async function (): Promise<void> {
|
|
107
|
+
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
111
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('Register running workspace', function (): void {
|
|
115
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test('Wait workspace readiness', async function (): Promise<void> {
|
|
119
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test('Connect to workspace container', function (): void {
|
|
123
|
+
kubernetesCommandLineToolsExecutor.workspaceName = WorkspaceHandlingTests.getWorkspaceName();
|
|
124
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
125
|
+
kubernetesCommandLineToolsExecutor.getPodAndContainerNames();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('Verify opencode binary is available in workspace', function (): void {
|
|
129
|
+
const output: ShellString = containerTerminal.execInContainerCommand('which opencode || ls /injected-tools/opencode');
|
|
130
|
+
expect(output.code, 'opencode binary should be present in the workspace').to.equal(0);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test(`Verify ${envVarName} environment variable is set`, function (): void {
|
|
134
|
+
const output: ShellString = containerTerminal.execInContainerCommand(`printenv ${envVarName}`);
|
|
135
|
+
expect(output.stdout.trim(), `${envVarName} environment variable should be set`).to.not.be.empty;
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('Verify opencode starts and reports version', function (): void {
|
|
139
|
+
const output: ShellString = containerTerminal.execInContainerCommandWithTimeout('opencode --version 2>&1', undefined, '15');
|
|
140
|
+
expect(output.code, 'opencode --version should exit with code 0').to.equal(0);
|
|
141
|
+
expect(output.stdout, 'opencode should return version info').to.not.be.empty;
|
|
142
|
+
expect(output.stdout.toLowerCase(), 'opencode --version should not contain errors').to.not.contain('error');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('Verify API key reaches OpenAI and returns insufficient_quota', function (): void {
|
|
146
|
+
// call OpenAI API directly via curl to verify the injected API key works end-to-end.
|
|
147
|
+
// the key is valid but has no credits, so OpenAI returns "insufficient_quota" error.
|
|
148
|
+
// we use curl instead of "opencode run" because opencode's plugin initialization
|
|
149
|
+
// hangs in workspace containers that cannot reach the npm registry.
|
|
150
|
+
const curlCommand: string =
|
|
151
|
+
'curl -s -m 15 https://api.openai.com/v1/chat/completions ' +
|
|
152
|
+
'-H "Authorization: Bearer $OPENAI_API_KEY" ' +
|
|
153
|
+
'-H "Content-Type: application/json" ' +
|
|
154
|
+
`-d "{\\"model\\":\\"${openAiModel}\\",\\"messages\\":[{\\"role\\":\\"user\\",\\"content\\":\\"Say hello\\"}]}"`;
|
|
155
|
+
|
|
156
|
+
const output: ShellString = containerTerminal.execInContainerCommand(curlCommand);
|
|
157
|
+
const response: string = output.stdout + output.stderr;
|
|
158
|
+
Logger.info(`OpenAI API response: ${response}`);
|
|
159
|
+
expect(response, 'OpenAI API should return insufficient_quota for a key with no credits').to.contain('insufficient_quota');
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
164
|
+
await dashboard.openDashboard();
|
|
165
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
169
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
173
|
+
registerRunningWorkspace('');
|
|
174
|
+
});
|
|
175
|
+
});
|
|
@@ -26,6 +26,7 @@ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
|
26
26
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
27
27
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
28
28
|
import { RestartWorkspaceDialog } from '../../pageobjects/ide/RestartWorkspaceDialog';
|
|
29
|
+
import { StatusBarProblemsView } from '../../pageobjects/ide/StatusBarProblemsView';
|
|
29
30
|
import { By } from 'selenium-webdriver';
|
|
30
31
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
31
32
|
|
|
@@ -349,3 +350,127 @@ suite(`Test case with pvc-fail workspace (bad image restart) ${BASE_TEST_CONSTAN
|
|
|
349
350
|
}
|
|
350
351
|
});
|
|
351
352
|
});
|
|
353
|
+
|
|
354
|
+
suite(`Test case with empty workspace and ubi9-init devfile restart ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
355
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
356
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
357
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
358
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
359
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
360
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
361
|
+
const containerTerminal: ContainerTerminal = e2eContainer.get(CLASSES.ContainerTerminal);
|
|
362
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
363
|
+
CLASSES.KubernetesCommandLineToolsExecutor
|
|
364
|
+
);
|
|
365
|
+
const restartWorkspaceDialog: RestartWorkspaceDialog = e2eContainer.get(CLASSES.RestartWorkspaceDialog);
|
|
366
|
+
const statusBarProblemsView: StatusBarProblemsView = e2eContainer.get(CLASSES.StatusBarProblemsView);
|
|
367
|
+
const gitRepository: string = BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED()
|
|
368
|
+
? 'https://gh.crw-qe.com/test-automation-only/ubi9-based-sample-public'
|
|
369
|
+
: 'https://github.com/crw-qe/ubi9-based-sample-public.git';
|
|
370
|
+
const projectName: string = 'ubi9-based-sample-public';
|
|
371
|
+
const branchName: string = 'ubi9-init';
|
|
372
|
+
let currentTabHandle: string = 'undefined';
|
|
373
|
+
let originalWorkspaceName: string = 'undefined';
|
|
374
|
+
const editorXpath: string = '//*[@id="editor-selector-card-che-incubator/che-code/latest"]';
|
|
375
|
+
const xPathToWaitFor: string = '//*[@id="workbench.parts.sidebar"]';
|
|
376
|
+
|
|
377
|
+
suiteSetup('Login into Che', async function (): Promise<void> {
|
|
378
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
379
|
+
await loginTests.loginIntoChe();
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
function clearCurrentTabHandle(): void {
|
|
383
|
+
currentTabHandle = 'undefined';
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
test('Create Empty workspace', async function (): Promise<void> {
|
|
387
|
+
await dashboard.openDashboard();
|
|
388
|
+
currentTabHandle = await browserTabsUtil.getCurrentWindowHandle();
|
|
389
|
+
await dashboard.clickCreateWorkspaceButton();
|
|
390
|
+
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(editorXpath, 'Empty Workspace', xPathToWaitFor);
|
|
391
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
test('Setup workspace context for API operations', function (): void {
|
|
395
|
+
kubernetesCommandLineToolsExecutor.workspaceName = WorkspaceHandlingTests.getWorkspaceName();
|
|
396
|
+
kubernetesCommandLineToolsExecutor.getPodAndContainerNames();
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
test('Clone ubi9-based-sample-public repository', function (): void {
|
|
400
|
+
const cloneOutput: ShellString = containerTerminal.gitClone(gitRepository);
|
|
401
|
+
expect(cloneOutput.stdout + cloneOutput.stderr).includes('Cloning');
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
405
|
+
await projectAndFileTests.performTrustAuthorDialog();
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
test('Verify cloned project exists', function (): void {
|
|
409
|
+
expect(containerTerminal.ls().stdout).includes(projectName);
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
test('Checkout to ubi9-init branch', function (): void {
|
|
413
|
+
const checkoutOutput: ShellString = containerTerminal.execInContainerCommand(
|
|
414
|
+
`cd /projects/${projectName} && git checkout ${branchName}`
|
|
415
|
+
);
|
|
416
|
+
expect(checkoutOutput.code).to.equal(0, `Failed to checkout branch ${branchName}`);
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
test('Restart workspace from local devfile', async function (): Promise<void> {
|
|
420
|
+
await restartWorkspaceDialog.restartFromLocalDevfile(projectName);
|
|
421
|
+
Logger.info('Waiting for "Restart Workspace" confirmation popup');
|
|
422
|
+
await restartWorkspaceDialog.confirmRestartWorkspace();
|
|
423
|
+
await restartWorkspaceDialog.waitErrorDialogNotPresent();
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
test('Verify workspace name is preserved after restart', async function (): Promise<void> {
|
|
427
|
+
originalWorkspaceName = WorkspaceHandlingTests.getWorkspaceName();
|
|
428
|
+
Logger.info(`Original workspace name before restart: ${originalWorkspaceName}`);
|
|
429
|
+
WorkspaceHandlingTests.clearWorkspaceName();
|
|
430
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
431
|
+
const restartedWorkspaceName: string = WorkspaceHandlingTests.getWorkspaceName();
|
|
432
|
+
Logger.info(`Workspace name from starting page after restart: ${restartedWorkspaceName}`);
|
|
433
|
+
expect(restartedWorkspaceName).to.equal(originalWorkspaceName, 'Workspace name must be the same after restart');
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
test('Wait for workspace to restart successfully', async function (): Promise<void> {
|
|
437
|
+
Logger.info('Waiting for workspace to restart with local devfile from ubi9-init branch');
|
|
438
|
+
await driverHelper.waitVisibility(By.xpath(xPathToWaitFor), TIMEOUT_CONSTANTS.TS_IDE_START_TIMEOUT);
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
test('Re-initialize workspace context after restart', function (): void {
|
|
442
|
+
kubernetesCommandLineToolsExecutor.getPodAndContainerNames();
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
test('Verify project exists after restart', async function (): Promise<void> {
|
|
446
|
+
expect(containerTerminal.ls('/projects').stdout).includes(projectName);
|
|
447
|
+
expect(containerTerminal.ls(`/projects/${projectName}`).stdout).includes('devfile.yaml');
|
|
448
|
+
await restartWorkspaceDialog.waitErrorDialogNotPresent();
|
|
449
|
+
const problemsViewText: string = await statusBarProblemsView.openProblemsViewAndGetText();
|
|
450
|
+
Logger.info(`Problems view text after restart: ${problemsViewText}`);
|
|
451
|
+
expect(problemsViewText).includes('No problems have been detected in the workspace');
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
suiteTeardown('Delete DevWorkspace', async function (): Promise<void> {
|
|
455
|
+
Logger.debug('Delete DevWorkspace. After each test.');
|
|
456
|
+
if (currentTabHandle !== 'undefined') {
|
|
457
|
+
await browserTabsUtil.switchToWindow(currentTabHandle);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
await dashboard.openDashboard();
|
|
461
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
462
|
+
|
|
463
|
+
// the restart flow may clear the current workspace name, so fall back to the name captured before the restart
|
|
464
|
+
const currentWorkspaceName: string = WorkspaceHandlingTests.getWorkspaceName();
|
|
465
|
+
const workspaceNameToDelete: string = currentWorkspaceName !== 'undefined' ? currentWorkspaceName : originalWorkspaceName;
|
|
466
|
+
|
|
467
|
+
if (workspaceNameToDelete !== 'undefined' && workspaceNameToDelete !== '') {
|
|
468
|
+
Logger.debug(`Workspace name is defined. Deleting workspace: ${workspaceNameToDelete}`);
|
|
469
|
+
await dashboard.deleteStoppedWorkspaceByUI(workspaceNameToDelete);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
WorkspaceHandlingTests.clearWorkspaceName();
|
|
473
|
+
clearCurrentTabHandle();
|
|
474
|
+
registerRunningWorkspace('');
|
|
475
|
+
});
|
|
476
|
+
});
|