diff --git a/tests/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts b/tests/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts index bccb16dad7c..f926ceea773 100644 --- a/tests/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts +++ b/tests/e2e/specs/miscellaneous/PredefinedNamespace.spec.ts @@ -54,11 +54,25 @@ suite(`Create predefined workspace and check it ${BASE_TEST_CONSTANTS.TEST_ENVIR // generate empty workspace DevFile and create it through oc client under a regular user suiteSetup('Login', async function (): Promise { const devfileContent: string = 'schemaVersion: 2.2.0\n' + 'metadata:\n' + ` name: ${workspaceName}\n`; + const majorMinorVersion: string = BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION.split('.').slice(0, 2).join('.'); + const devSpacesEditorImage: string = `quay.io/redhat-user-workloads/devspaces-tenant/devspaces/code-rhel9:${majorMinorVersion}`; kubernetesCommandLineToolsExecutor.loginToOcp(userName); devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({ devfileContent }); devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext(); + + // update che-code-injector image to use Dev Spaces VS Code Editor (Dev Spaces only) + if (BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME() === 'devspaces') { + devfileContext.devWorkspaceTemplates.forEach((template): void => { + template.spec?.components?.forEach((component): void => { + if (component.name === 'che-code-injector' && component.container?.image) { + component.container.image = devSpacesEditorImage; + } + }); + }); + } + const devWorkspaceConfigurationYamlString: string = devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext); kubernetesCommandLineToolsExecutor.applyWithoutNamespace(devWorkspaceConfigurationYamlString);