From f45fbdd2094ddd7a8a6de2baf6945ca5504a7e41 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Thu, 11 Dec 2025 14:55:00 +0100 Subject: [PATCH 01/12] added EditorSample test for VS Code. Signed-off-by: Oleksii Korniienko --- tests/e2e/pageobjects/dashboard/Dashboard.ts | 23 +++++ .../EditorSampleVSCode.spec.ts | 93 +++++++++++++++++++ .../tests-library/WorkspaceHandlingTests.ts | 30 ++++++ 3 files changed, 146 insertions(+) create mode 100644 tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts diff --git a/tests/e2e/pageobjects/dashboard/Dashboard.ts b/tests/e2e/pageobjects/dashboard/Dashboard.ts index 99d7722c5ae..37a42110bb9 100644 --- a/tests/e2e/pageobjects/dashboard/Dashboard.ts +++ b/tests/e2e/pageobjects/dashboard/Dashboard.ts @@ -44,6 +44,7 @@ export class Dashboard { }; private static readonly CONTINUE_WITH_DEFAULT_DEVFILE_BUTTON: By = By.xpath('//button[text()="Continue with default devfile"]'); private static readonly OPEN_EXISTING_WORKSPACE_LINK: By = By.xpath('//button[text()="Open the existing workspace"]'); + private static readonly CHOOSE_EDITOR_MENU: By = By.xpath('//*[@id="accordion-item-selector"]'); constructor( @inject(CLASSES.DriverHelper) @@ -62,6 +63,16 @@ export class Dashboard { await this.workspaces.waitWorkspaceWithStoppedStatus(workspaceName); } + async forceStopWorkspaceByUI(workspaceName: string): Promise { + Logger.debug(`"${workspaceName}"`); + + await this.clickWorkspacesButton(); + await this.workspaces.waitPage(); + await this.workspaces.waitWorkspaceListItem(workspaceName); + await this.workspaces.stopWorkspaceByActionsButton(workspaceName); + await this.workspaces.waitWorkspaceWithStoppedStatus(workspaceName); + } + async deleteStoppedWorkspaceByUI(workspaceName: string): Promise { Logger.debug(`"${workspaceName}"`); @@ -227,4 +238,16 @@ export class Dashboard { private getAboutDialogWindowItemLocator(itemDataTestId: string): By { return By.xpath(`//dd[@data-testid="${itemDataTestId}"]`); } + + async openChooseEditorMenu(timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { + Logger.debug('open "choose Editor" menu'); + + await this.driverHelper.waitAndClick(Dashboard.CHOOSE_EDITOR_MENU, timeout); + } + + async chooseEditor(editor: string, timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { + Logger.debug('select Editor. Editor: ' + editor); + + await this.driverHelper.waitAndClick(By.xpath(editor), timeout); + } } diff --git a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts new file mode 100644 index 00000000000..edbd7562f68 --- /dev/null +++ b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts @@ -0,0 +1,93 @@ +import { Logger } from '../../utils/Logger'; +import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor'; +import fs from 'fs'; +import path from 'path'; +import YAML from 'yaml'; +import { e2eContainer } from '../../configs/inversify.config'; +import { CLASSES } from '../../configs/inversify.types'; +import { LoginTests } from '../../tests-library/LoginTests'; +import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; +import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; +import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; +import { By } from 'selenium-webdriver'; +import { expect } from 'chai'; + + +suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { + this.timeout(6000000); + const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); + const pathToSampleFile: string = path.resolve('resources/default-devfile.yaml'); + const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name; + const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get( + CLASSES.KubernetesCommandLineToolsExecutor + ); + kubernetesCommandLineToolsExecutor.workspaceName = workspaceName; + const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); + const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); + const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); + + const VSCodeEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; + + const samplesForCheck: string[] = [ + 'Empty Workspace', + 'JBoss EAP 8.0', + 'Java Lombok', + 'Node.js Express', + 'Python', + 'Quarkus REST API', + '.NET', + 'Ansible', + 'C/C++', + 'Go', + 'PHP' + ]; + + const urlsForCheck: string[] = [ + 'https://github.com/crw-qe/quarkus-api-example-public/tree/ubi8-latest', + 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' + ]; + + + suiteSetup('Login into OC', function (): void { + kubernetesCommandLineToolsExecutor.loginToOcp(); + }); + + suiteSetup('Login into Che', async function (): Promise { + await loginTests.loginIntoChe(); + }); + + test('Test VSCode (desktop) (SSH) with default Samples', async function (): Promise { + for (const sampleName of samplesForCheck) { + await testVSCode(sampleName, false); + } + }); + + test('Test VSCode (desktop) (SSH) with ubi', async function (): Promise { + for (const url of urlsForCheck) { + await testVSCode(url, true); + } + }); + + async function testVSCode(sampleOrUrl: string, isUrl: boolean){ + Logger.debug(sampleOrUrl); + await dashboard.openDashboard(); + await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(VSCodeEditor, sampleOrUrl, isUrl); + + const headerText = await workspaceHandlingTests.getTextFromWorkspaceElement('/html/body/h1'); + expect("Workspace " + WorkspaceHandlingTests.getWorkspaceName() + " is running").equal(headerText); + + await deleteWorkspace(); + } + + async function deleteWorkspace() { + await dashboard.openDashboard(); + await browserTabsUtil.closeAllTabsExceptCurrent(); + await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + } + + + suiteTeardown('Delete default DevWorkspace', function (): void { + kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); + }); +}); diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index 0c1b6333c35..3c7353da3b6 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -173,4 +173,34 @@ export class WorkspaceHandlingTests { return '(unknown)'; } } + + async createAndOpenWorkspaceWithSpecificEditorAndSample(editor: string, sample: string, isUrl: boolean = false): Promise { + Logger.debug('Create and open workspace with specific Editor and Sample. Sample ' + editor); + await this.selectEditor(editor); + + if (isUrl) { + await this.createWorkspace.importFromGitUsingUI(sample); + } else { + await this.createWorkspace.clickOnSampleNoEditorSelection(sample); + } + + await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); + await this.obtainWorkspaceNameFromStartingPage(); + + await this.driverHelper.waitVisibility( + By.xpath('/html/body/h1'), + TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT + ); + } + + async selectEditor(editor: string): Promise { + Logger.debug('select Editor. Editor: ' + editor); + await this.dashboard.openChooseEditorMenu(); + await this.dashboard.chooseEditor(editor); + } + + async getTextFromWorkspaceElement(xpath: string): Promise { + Logger.debug('returning text from xPath: ' + xpath); + return await this.driverHelper.getDriver().findElement(By.xpath(xpath)).getText(); + } } From 509fb399aa7cc719bb934c5300d33c130a297b27 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Thu, 11 Dec 2025 16:14:07 +0100 Subject: [PATCH 02/12] small fixes + prettier Signed-off-by: Oleksii Korniienko --- .../dashboard-samples/EditorSampleVSCode.spec.ts | 14 ++++++-------- tests/e2e/tests-library/WorkspaceHandlingTests.ts | 12 +++++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts index edbd7562f68..3f2e4a302d1 100644 --- a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts +++ b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts @@ -12,7 +12,6 @@ import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTes import { By } from 'selenium-webdriver'; import { expect } from 'chai'; - suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { this.timeout(6000000); const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); @@ -25,8 +24,9 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); - + const VSCodeEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; + const titlexPath: string = '/html/body/h1'; const samplesForCheck: string[] = [ 'Empty Workspace', @@ -47,7 +47,6 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' ]; - suiteSetup('Login into OC', function (): void { kubernetesCommandLineToolsExecutor.loginToOcp(); }); @@ -68,13 +67,13 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): } }); - async function testVSCode(sampleOrUrl: string, isUrl: boolean){ + async function testVSCode(sampleOrUrl: string, isUrl: boolean) { Logger.debug(sampleOrUrl); await dashboard.openDashboard(); - await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(VSCodeEditor, sampleOrUrl, isUrl); + await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(VSCodeEditor, sampleOrUrl, isUrl, titlexPath); - const headerText = await workspaceHandlingTests.getTextFromWorkspaceElement('/html/body/h1'); - expect("Workspace " + WorkspaceHandlingTests.getWorkspaceName() + " is running").equal(headerText); + const headerText = await workspaceHandlingTests.getTextFromWorkspaceElement(titlexPath); + expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); await deleteWorkspace(); } @@ -86,7 +85,6 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); } - suiteTeardown('Delete default DevWorkspace', function (): void { kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); }); diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index 3c7353da3b6..4139cae96d5 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -174,7 +174,12 @@ export class WorkspaceHandlingTests { } } - async createAndOpenWorkspaceWithSpecificEditorAndSample(editor: string, sample: string, isUrl: boolean = false): Promise { + async createAndOpenWorkspaceWithSpecificEditorAndSample( + editor: string, + sample: string, + isUrl: boolean = false, + xPathForVerify: string + ): Promise { Logger.debug('Create and open workspace with specific Editor and Sample. Sample ' + editor); await this.selectEditor(editor); @@ -187,10 +192,7 @@ export class WorkspaceHandlingTests { await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); await this.obtainWorkspaceNameFromStartingPage(); - await this.driverHelper.waitVisibility( - By.xpath('/html/body/h1'), - TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT - ); + await this.driverHelper.waitVisibility(By.xpath(xPathForVerify), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); } async selectEditor(editor: string): Promise { From 619c6a0a89a13864b6287cd9cc36f6fd87a34fa4 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Thu, 11 Dec 2025 16:27:29 +0100 Subject: [PATCH 03/12] fixed lint error Signed-off-by: Oleksii Korniienko --- tests/e2e/pageobjects/dashboard/Dashboard.ts | 16 +++---- .../EditorSampleVSCode.spec.ts | 39 ++++++++------- .../tests-library/WorkspaceHandlingTests.ts | 48 +++++++++---------- 3 files changed, 51 insertions(+), 52 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/Dashboard.ts b/tests/e2e/pageobjects/dashboard/Dashboard.ts index 37a42110bb9..10788ee6de7 100644 --- a/tests/e2e/pageobjects/dashboard/Dashboard.ts +++ b/tests/e2e/pageobjects/dashboard/Dashboard.ts @@ -231,14 +231,6 @@ export class Dashboard { await this.driverHelper.waitAndClick(Dashboard.CONTINUE_WITH_DEFAULT_DEVFILE_BUTTON, timeout); } - private getAboutMenuItemButtonLocator(text: string): By { - return By.xpath(`//li/button[text()="${text}"]`); - } - - private getAboutDialogWindowItemLocator(itemDataTestId: string): By { - return By.xpath(`//dd[@data-testid="${itemDataTestId}"]`); - } - async openChooseEditorMenu(timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { Logger.debug('open "choose Editor" menu'); @@ -250,4 +242,12 @@ export class Dashboard { await this.driverHelper.waitAndClick(By.xpath(editor), timeout); } + + private getAboutMenuItemButtonLocator(text: string): By { + return By.xpath(`//li/button[text()="${text}"]`); + } + + private getAboutDialogWindowItemLocator(itemDataTestId: string): By { + return By.xpath(`//dd[@data-testid="${itemDataTestId}"]`); + } } diff --git a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts index 3f2e4a302d1..c41c0c1415f 100644 --- a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts +++ b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts @@ -9,7 +9,6 @@ import { LoginTests } from '../../tests-library/LoginTests'; import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; -import { By } from 'selenium-webdriver'; import { expect } from 'chai'; suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { @@ -25,7 +24,7 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); - const VSCodeEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; + const vsCodeEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; const titlexPath: string = '/html/body/h1'; const samplesForCheck: string[] = [ @@ -47,6 +46,24 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' ]; + async function testVSCode(sampleOrUrl: string, isUrl: boolean): Promise { + Logger.debug(sampleOrUrl); + await dashboard.openDashboard(); + await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(vsCodeEditor, sampleOrUrl, isUrl, titlexPath); + + const headerText: string = await workspaceHandlingTests.getTextFromWorkspaceElement(titlexPath); + expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); + + await deleteWorkspace(); + } + + async function deleteWorkspace(): Promise { + await dashboard.openDashboard(); + await browserTabsUtil.closeAllTabsExceptCurrent(); + await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + } + suiteSetup('Login into OC', function (): void { kubernetesCommandLineToolsExecutor.loginToOcp(); }); @@ -67,24 +84,6 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): } }); - async function testVSCode(sampleOrUrl: string, isUrl: boolean) { - Logger.debug(sampleOrUrl); - await dashboard.openDashboard(); - await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(VSCodeEditor, sampleOrUrl, isUrl, titlexPath); - - const headerText = await workspaceHandlingTests.getTextFromWorkspaceElement(titlexPath); - expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); - - await deleteWorkspace(); - } - - async function deleteWorkspace() { - await dashboard.openDashboard(); - await browserTabsUtil.closeAllTabsExceptCurrent(); - await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); - await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); - } - suiteTeardown('Delete default DevWorkspace', function (): void { kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); }); diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index 4139cae96d5..b9e4f91b268 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -150,30 +150,6 @@ export class WorkspaceHandlingTests { Logger.info('Start workspace progress description: ' + alertDescription); } - private async getWorkspaceAlertDescription(): Promise { - try { - return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_ALERT_DESCRIPTION).getText(); - } catch (err) { - return '(unknown)'; - } - } - - private async getWorkspaceStatus(): Promise { - try { - return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_STATUS).getText(); - } catch (err) { - return '(unknown)'; - } - } - - private async getWorkspaceAlertTitle(): Promise { - try { - return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_ALERT_TITLE).getAttribute('innerHTML'); - } catch (err) { - return '(unknown)'; - } - } - async createAndOpenWorkspaceWithSpecificEditorAndSample( editor: string, sample: string, @@ -205,4 +181,28 @@ export class WorkspaceHandlingTests { Logger.debug('returning text from xPath: ' + xpath); return await this.driverHelper.getDriver().findElement(By.xpath(xpath)).getText(); } + + private async getWorkspaceAlertDescription(): Promise { + try { + return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_ALERT_DESCRIPTION).getText(); + } catch (err) { + return '(unknown)'; + } + } + + private async getWorkspaceStatus(): Promise { + try { + return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_STATUS).getText(); + } catch (err) { + return '(unknown)'; + } + } + + private async getWorkspaceAlertTitle(): Promise { + try { + return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_ALERT_TITLE).getAttribute('innerHTML'); + } catch (err) { + return '(unknown)'; + } + } } From 3edcefd9bae93f9bd117d5d85c1f921ea307a5fc Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Thu, 11 Dec 2025 16:36:01 +0100 Subject: [PATCH 04/12] one more lint error fix Signed-off-by: Oleksii Korniienko --- .../dashboard-samples/EditorSampleVSCode.spec.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts index c41c0c1415f..1f46d4a37dc 100644 --- a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts +++ b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts @@ -46,6 +46,13 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' ]; + async function deleteWorkspace(): Promise { + await dashboard.openDashboard(); + await browserTabsUtil.closeAllTabsExceptCurrent(); + await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + } + async function testVSCode(sampleOrUrl: string, isUrl: boolean): Promise { Logger.debug(sampleOrUrl); await dashboard.openDashboard(); @@ -57,13 +64,6 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): await deleteWorkspace(); } - async function deleteWorkspace(): Promise { - await dashboard.openDashboard(); - await browserTabsUtil.closeAllTabsExceptCurrent(); - await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); - await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); - } - suiteSetup('Login into OC', function (): void { kubernetesCommandLineToolsExecutor.loginToOcp(); }); From 6c542b1b5b246f345ce16b5019c4d9999b73f75b Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Tue, 20 Jan 2026 15:42:29 +0100 Subject: [PATCH 05/12] Resolved small issues Signed-off-by: Oleksii Korniienko --- tests/e2e/pageobjects/dashboard/Dashboard.ts | 11 -- .../EditorSampleVSCode.spec.ts | 90 ----------- ...rkspaceUsingVSCodeDesktopSshEditor.spec.ts | 140 ++++++++++++++++++ .../tests-library/WorkspaceHandlingTests.ts | 26 ++-- 4 files changed, 153 insertions(+), 114 deletions(-) delete mode 100644 tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts create mode 100644 tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts diff --git a/tests/e2e/pageobjects/dashboard/Dashboard.ts b/tests/e2e/pageobjects/dashboard/Dashboard.ts index 87bd76b0aac..5df49f25add 100644 --- a/tests/e2e/pageobjects/dashboard/Dashboard.ts +++ b/tests/e2e/pageobjects/dashboard/Dashboard.ts @@ -55,17 +55,6 @@ export class Dashboard { async stopWorkspaceByUI(workspaceName: string): Promise { Logger.debug(`"${workspaceName}"`); - await this.clickWorkspacesButton(); - await this.workspaces.waitPage(); - await this.workspaces.waitWorkspaceListItem(workspaceName); - await this.workspaces.waitWorkspaceWithRunningStatus(workspaceName); - await this.workspaces.stopWorkspaceByActionsButton(workspaceName); - await this.workspaces.waitWorkspaceWithStoppedStatus(workspaceName); - } - - async forceStopWorkspaceByUI(workspaceName: string): Promise { - Logger.debug(`"${workspaceName}"`); - await this.clickWorkspacesButton(); await this.workspaces.waitPage(); await this.workspaces.waitWorkspaceListItem(workspaceName); diff --git a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts b/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts deleted file mode 100644 index 1f46d4a37dc..00000000000 --- a/tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { Logger } from '../../utils/Logger'; -import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor'; -import fs from 'fs'; -import path from 'path'; -import YAML from 'yaml'; -import { e2eContainer } from '../../configs/inversify.config'; -import { CLASSES } from '../../configs/inversify.types'; -import { LoginTests } from '../../tests-library/LoginTests'; -import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; -import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; -import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; -import { expect } from 'chai'; - -suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { - this.timeout(6000000); - const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); - const pathToSampleFile: string = path.resolve('resources/default-devfile.yaml'); - const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name; - const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get( - CLASSES.KubernetesCommandLineToolsExecutor - ); - kubernetesCommandLineToolsExecutor.workspaceName = workspaceName; - const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); - const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); - const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); - - const vsCodeEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; - const titlexPath: string = '/html/body/h1'; - - const samplesForCheck: string[] = [ - 'Empty Workspace', - 'JBoss EAP 8.0', - 'Java Lombok', - 'Node.js Express', - 'Python', - 'Quarkus REST API', - '.NET', - 'Ansible', - 'C/C++', - 'Go', - 'PHP' - ]; - - const urlsForCheck: string[] = [ - 'https://github.com/crw-qe/quarkus-api-example-public/tree/ubi8-latest', - 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' - ]; - - async function deleteWorkspace(): Promise { - await dashboard.openDashboard(); - await browserTabsUtil.closeAllTabsExceptCurrent(); - await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); - await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); - } - - async function testVSCode(sampleOrUrl: string, isUrl: boolean): Promise { - Logger.debug(sampleOrUrl); - await dashboard.openDashboard(); - await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(vsCodeEditor, sampleOrUrl, isUrl, titlexPath); - - const headerText: string = await workspaceHandlingTests.getTextFromWorkspaceElement(titlexPath); - expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); - - await deleteWorkspace(); - } - - suiteSetup('Login into OC', function (): void { - kubernetesCommandLineToolsExecutor.loginToOcp(); - }); - - suiteSetup('Login into Che', async function (): Promise { - await loginTests.loginIntoChe(); - }); - - test('Test VSCode (desktop) (SSH) with default Samples', async function (): Promise { - for (const sampleName of samplesForCheck) { - await testVSCode(sampleName, false); - } - }); - - test('Test VSCode (desktop) (SSH) with ubi', async function (): Promise { - for (const url of urlsForCheck) { - await testVSCode(url, true); - } - }); - - suiteTeardown('Delete default DevWorkspace', function (): void { - kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); - }); -}); diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts new file mode 100644 index 00000000000..98e9f205b4b --- /dev/null +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -0,0 +1,140 @@ +/** ******************************************************************* + * copyright (c) 2026 Red Hat, Inc. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + **********************************************************************/ + +import { Logger } from '../../utils/Logger'; +import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor'; +import fs from 'fs'; +import path from 'path'; +import YAML from 'yaml'; +import { e2eContainer } from '../../configs/inversify.config'; +import { CLASSES } from '../../configs/inversify.types'; +import { LoginTests } from '../../tests-library/LoginTests'; +import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; +import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; +import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; +import { expect } from 'chai'; + +suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { + this.timeout(6000000); + const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); + const pathToSampleFile: string = path.resolve('resources/default-devfile.yaml'); + const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name; + const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get( + CLASSES.KubernetesCommandLineToolsExecutor + ); + kubernetesCommandLineToolsExecutor.workspaceName = workspaceName; + const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); + const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); + const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); + + const vsCodeDesktopSshEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; + const titlexPath: string = '/html/body/h1'; + const ocPortForwardxPath: string = '//*[@id="port-forward"]'; + const sshKeyxPath: string = '//*[@id="key"]'; + const sshKonfigxPath: string = '//*[@id="config"]'; + + const samplesForCheck: string[] = [ + 'Empty Workspace', + 'JBoss EAP 8.0', + 'Java Lombok', + 'Node.js Express', + 'Python', + 'Quarkus REST API', + '.NET', + 'Ansible', + 'C/C++', + 'Go', + 'PHP' + ]; + + const gitRepoUrlsToCheck: string[] = [ + 'https://github.com/crw-qe/quarkus-api-example-public/tree/ubi8-latest', + 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' + ]; + + async function deleteWorkspace(): Promise { + await dashboard.openDashboard(); + await browserTabsUtil.closeAllTabsExceptCurrent(); + await dashboard.stopAndRemoveWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + } + + suiteSetup('Login into OCP', function (): void { + kubernetesCommandLineToolsExecutor.loginToOcp(); + }); + + suiteSetup('Login into Che', async function (): Promise { + await loginTests.loginIntoChe(); + }); + + async function testStartVSCode(sampleNameOrUrl: string, isUrl: boolean): Promise { + await dashboard.openDashboard(); + if (isUrl) { + await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSampleUrl( + vsCodeDesktopSshEditor, + sampleNameOrUrl, + titlexPath + ); + } else { + await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample( + vsCodeDesktopSshEditor, + sampleNameOrUrl, + titlexPath + ); + } + + // check title + const headerText: string = await workspaceHandlingTests.getTextFromUIElementByXpath(titlexPath); + Logger.debug(headerText); + expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); + // check oc-port-forwarding + const ocPortForward: string = await workspaceHandlingTests.getTextFromUIElementByXpath(ocPortForwardxPath); + Logger.debug(ocPortForward); + expect(ocPortForward).contains('oc port-forward -n admin-devspaces'); + // check ssh key + const sshKey: string = await workspaceHandlingTests.getTextFromUIElementByXpath(sshKeyxPath); + Logger.debug(sshKey); + expect(sshKey).contains('-----BEGIN OPENSSH PRIVATE KEY-----').and.contains('-----END OPENSSH PRIVATE KEY-----'); + // check .ssh/kofig + const sshKonfig: string = await workspaceHandlingTests.getTextFromUIElementByXpath(sshKonfigxPath); + Logger.debug(sshKonfig); + expect(sshKonfig) + .contains('HostName') + .and.contains('User') + .and.contains('Port') + .and.contains('IdentityFile') + .and.contains('UserKnownHostsFile'); + + await deleteWorkspace(); + } + + suiteSetup('Login into OCP', function (): void { + kubernetesCommandLineToolsExecutor.loginToOcp(); + }); + + suiteSetup('Login into Che', async function (): Promise { + await loginTests.loginIntoChe(); + }); + + test('Test start of VSCode (desktop) (SSH) with default Samples', async function (): Promise { + for (const sampleName of samplesForCheck) { + await testStartVSCode(sampleName, false); + } + }); + + test('Test start of VSCode (desktop) (SSH) with ubi', async function (): Promise { + for (const url of gitRepoUrlsToCheck) { + await testStartVSCode(url, true); + } + }); + + suiteTeardown('Delete default DevWorkspace', function (): void { + kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); + }); +}); diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index b9e4f91b268..ae5563ebbbc 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -150,25 +150,25 @@ export class WorkspaceHandlingTests { Logger.info('Start workspace progress description: ' + alertDescription); } - async createAndOpenWorkspaceWithSpecificEditorAndSample( - editor: string, - sample: string, - isUrl: boolean = false, - xPathForVerify: string - ): Promise { + async createAndOpenWorkspaceWithSpecificEditorAndSample(editor: string, sampleName: string, xPath: string): Promise { Logger.debug('Create and open workspace with specific Editor and Sample. Sample ' + editor); await this.selectEditor(editor); + await this.createWorkspace.clickOnSampleNoEditorSelection(sampleName); + await this.waitForControlXpath(xPath); + } - if (isUrl) { - await this.createWorkspace.importFromGitUsingUI(sample); - } else { - await this.createWorkspace.clickOnSampleNoEditorSelection(sample); - } + async createAndOpenWorkspaceWithSpecificEditorAndSampleUrl(editor: string, sampleUrl: string, xPath: string): Promise { + Logger.debug('Create and open workspace with specific Editor and URL. Sample ' + editor); + await this.selectEditor(editor); + await this.createWorkspace.importFromGitUsingUI(sampleUrl); + await this.waitForControlXpath(xPath); + } + private async waitForControlXpath(xPathToWait: string): Promise { await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); await this.obtainWorkspaceNameFromStartingPage(); - await this.driverHelper.waitVisibility(By.xpath(xPathForVerify), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); + await this.driverHelper.waitVisibility(By.xpath(xPathToWait), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); } async selectEditor(editor: string): Promise { @@ -177,7 +177,7 @@ export class WorkspaceHandlingTests { await this.dashboard.chooseEditor(editor); } - async getTextFromWorkspaceElement(xpath: string): Promise { + async getTextFromUIElementByXpath(xpath: string): Promise { Logger.debug('returning text from xPath: ' + xpath); return await this.driverHelper.getDriver().findElement(By.xpath(xpath)).getText(); } From 4bc3eda3a139ad109f95f297b2fbae18d1a9d394 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Tue, 20 Jan 2026 16:38:50 +0100 Subject: [PATCH 06/12] removed extra logs Signed-off-by: Oleksii Korniienko --- .../StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index 98e9f205b4b..186cd184d10 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -91,19 +91,15 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): // check title const headerText: string = await workspaceHandlingTests.getTextFromUIElementByXpath(titlexPath); - Logger.debug(headerText); expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); // check oc-port-forwarding const ocPortForward: string = await workspaceHandlingTests.getTextFromUIElementByXpath(ocPortForwardxPath); - Logger.debug(ocPortForward); expect(ocPortForward).contains('oc port-forward -n admin-devspaces'); // check ssh key const sshKey: string = await workspaceHandlingTests.getTextFromUIElementByXpath(sshKeyxPath); - Logger.debug(sshKey); expect(sshKey).contains('-----BEGIN OPENSSH PRIVATE KEY-----').and.contains('-----END OPENSSH PRIVATE KEY-----'); // check .ssh/kofig const sshKonfig: string = await workspaceHandlingTests.getTextFromUIElementByXpath(sshKonfigxPath); - Logger.debug(sshKonfig); expect(sshKonfig) .contains('HostName') .and.contains('User') From 19a72d5210ba19823c23fd07eaacc37e4e99dc90 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Tue, 20 Jan 2026 17:04:07 +0100 Subject: [PATCH 07/12] fixed lint errors Signed-off-by: Oleksii Korniienko --- ...artWorkspaceUsingVSCodeDesktopSshEditor.spec.ts | 1 - tests/e2e/tests-library/WorkspaceHandlingTests.ts | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index 186cd184d10..bcf41f46a8d 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -8,7 +8,6 @@ * SPDX-License-Identifier: EPL-2.0 **********************************************************************/ -import { Logger } from '../../utils/Logger'; import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor'; import fs from 'fs'; import path from 'path'; diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index ae5563ebbbc..11bfeec39c7 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -164,13 +164,6 @@ export class WorkspaceHandlingTests { await this.waitForControlXpath(xPath); } - private async waitForControlXpath(xPathToWait: string): Promise { - await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); - await this.obtainWorkspaceNameFromStartingPage(); - - await this.driverHelper.waitVisibility(By.xpath(xPathToWait), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); - } - async selectEditor(editor: string): Promise { Logger.debug('select Editor. Editor: ' + editor); await this.dashboard.openChooseEditorMenu(); @@ -182,6 +175,13 @@ export class WorkspaceHandlingTests { return await this.driverHelper.getDriver().findElement(By.xpath(xpath)).getText(); } + private async waitForControlXpath(xPathToWait: string): Promise { + await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); + await this.obtainWorkspaceNameFromStartingPage(); + + await this.driverHelper.waitVisibility(By.xpath(xPathToWait), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); + } + private async getWorkspaceAlertDescription(): Promise { try { return await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_ALERT_DESCRIPTION).getText(); From 98c111d13a5828629b01d5337d575e0e0c6eaa9c Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Wed, 21 Jan 2026 16:52:22 +0100 Subject: [PATCH 08/12] test suite teardown Signed-off-by: Oleksii Korniienko --- ...rkspaceUsingVSCodeDesktopSshEditor.spec.ts | 31 +++++++++++-------- .../tests-library/WorkspaceHandlingTests.ts | 3 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index bcf41f46a8d..0a50fbd88c3 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -19,6 +19,8 @@ import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; import { expect } from 'chai'; +import { Logger } from '../../utils/Logger'; +import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS'; suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { this.timeout(6000000); @@ -58,6 +60,10 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' ]; + const gitRepoUrlsToCheckAirgap: string[] = [ + 'https://gh.crw-qe.com/test-automation-only/ubi9-based-sample-public/tree/ubi9-minimal' + ]; + async function deleteWorkspace(): Promise { await dashboard.openDashboard(); await browserTabsUtil.closeAllTabsExceptCurrent(); @@ -72,10 +78,10 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): await loginTests.loginIntoChe(); }); - async function testStartVSCode(sampleNameOrUrl: string, isUrl: boolean): Promise { + async function testWorkspaceStartup(sampleNameOrUrl: string, isUrl: boolean): Promise { await dashboard.openDashboard(); if (isUrl) { - await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSampleUrl( + await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndGitUrl( vsCodeDesktopSshEditor, sampleNameOrUrl, titlexPath @@ -109,23 +115,22 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): await deleteWorkspace(); } - suiteSetup('Login into OCP', function (): void { - kubernetesCommandLineToolsExecutor.loginToOcp(); - }); - - suiteSetup('Login into Che', async function (): Promise { - await loginTests.loginIntoChe(); - }); - test('Test start of VSCode (desktop) (SSH) with default Samples', async function (): Promise { for (const sampleName of samplesForCheck) { - await testStartVSCode(sampleName, false); + await testWorkspaceStartup(sampleName, false); } }); test('Test start of VSCode (desktop) (SSH) with ubi', async function (): Promise { - for (const url of gitRepoUrlsToCheck) { - await testStartVSCode(url, true); + if (BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED()) { + Logger.info('Test cluster is disconnected. Using url for airgap cluster.'); + for (const url of gitRepoUrlsToCheckAirgap) { + await testWorkspaceStartup(url, true); + } + } else { + for (const url of gitRepoUrlsToCheck) { + await testWorkspaceStartup(url, true); + } } }); diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index 11bfeec39c7..f7b701ae438 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -157,7 +157,7 @@ export class WorkspaceHandlingTests { await this.waitForControlXpath(xPath); } - async createAndOpenWorkspaceWithSpecificEditorAndSampleUrl(editor: string, sampleUrl: string, xPath: string): Promise { + async createAndOpenWorkspaceWithSpecificEditorAndGitUrl(editor: string, sampleUrl: string, xPath: string): Promise { Logger.debug('Create and open workspace with specific Editor and URL. Sample ' + editor); await this.selectEditor(editor); await this.createWorkspace.importFromGitUsingUI(sampleUrl); @@ -180,6 +180,7 @@ export class WorkspaceHandlingTests { await this.obtainWorkspaceNameFromStartingPage(); await this.driverHelper.waitVisibility(By.xpath(xPathToWait), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); + await this.driverHelper.waitVisibility(By.xpath(xPathToWait+"asdasdasd"), TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT); } private async getWorkspaceAlertDescription(): Promise { From 869661194bfd9f3b66c5fed53b5fa0864ba6aadb Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Wed, 28 Jan 2026 15:37:52 +0100 Subject: [PATCH 09/12] added urls for airgap cluster + reworked teardown method. Signed-off-by: Oleksii Korniienko --- .../StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts | 10 ++++------ tests/e2e/tests-library/WorkspaceHandlingTests.ts | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index 0a50fbd88c3..17aa375ee80 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -61,6 +61,7 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): ]; const gitRepoUrlsToCheckAirgap: string[] = [ + 'https://gh.crw-qe.com/test-automation-only/ubi8/tree/ubi8-latest', 'https://gh.crw-qe.com/test-automation-only/ubi9-based-sample-public/tree/ubi9-minimal' ]; @@ -70,10 +71,6 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): await dashboard.stopAndRemoveWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); } - suiteSetup('Login into OCP', function (): void { - kubernetesCommandLineToolsExecutor.loginToOcp(); - }); - suiteSetup('Login into Che', async function (): Promise { await loginTests.loginIntoChe(); }); @@ -134,7 +131,8 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): } }); - suiteTeardown('Delete default DevWorkspace', function (): void { - kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); + suiteTeardown('Delete DevWorkspace', async function (): Promise { + Logger.info('Deleting DevWorkspace...'); + await deleteWorkspace(); }); }); diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index f7b701ae438..4e884d44709 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -180,7 +180,6 @@ export class WorkspaceHandlingTests { await this.obtainWorkspaceNameFromStartingPage(); await this.driverHelper.waitVisibility(By.xpath(xPathToWait), TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); - await this.driverHelper.waitVisibility(By.xpath(xPathToWait+"asdasdasd"), TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT); } private async getWorkspaceAlertDescription(): Promise { From 7496707e37b2d078c1c6d946a48639f3916b9f18 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Wed, 28 Jan 2026 16:21:14 +0100 Subject: [PATCH 10/12] reworked suiteTeardown. Added try/catch. Signed-off-by: Oleksii Korniienko --- .../StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index 17aa375ee80..6c5f01a962b 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -132,7 +132,13 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): }); suiteTeardown('Delete DevWorkspace', async function (): Promise { - Logger.info('Deleting DevWorkspace...'); - await deleteWorkspace(); + Logger.info('Deleting DevWorkspace... After all.'); + await dashboard.openDashboard(); + await browserTabsUtil.closeAllTabsExceptCurrent(); + try { + await dashboard.stopAndRemoveWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + } catch (e) { + Logger.info("Cannot find or stop DevWorkspace in suiteTeardown. Normal behaviour if test passed.") + } }); }); From fdbee5a752c85eca8a407d599a6209d971eaafa3 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Wed, 28 Jan 2026 16:45:06 +0100 Subject: [PATCH 11/12] prettier fixes Signed-off-by: Oleksii Korniienko --- .../StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index 6c5f01a962b..8afe9b6ee8e 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -138,7 +138,7 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): try { await dashboard.stopAndRemoveWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); } catch (e) { - Logger.info("Cannot find or stop DevWorkspace in suiteTeardown. Normal behaviour if test passed.") + Logger.info('Cannot find or stop DevWorkspace in suiteTeardown. Normal behaviour if test passed.'); } }); }); From fbf37917c305358f30e0ccc3163a792b2a5da65b Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Wed, 28 Jan 2026 17:03:55 +0100 Subject: [PATCH 12/12] replaced stop and delete to just delete for suiteTeardown. Signed-off-by: Oleksii Korniienko --- .../StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts index 8afe9b6ee8e..7ec4ce2e40a 100644 --- a/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +++ b/tests/e2e/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts @@ -136,7 +136,7 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): await dashboard.openDashboard(); await browserTabsUtil.closeAllTabsExceptCurrent(); try { - await dashboard.stopAndRemoveWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); + await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); } catch (e) { Logger.info('Cannot find or stop DevWorkspace in suiteTeardown. Normal behaviour if test passed.'); }