From 7cfe1c49f15594f3510a7b4defef51f94624f9d4 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Mon, 15 Sep 2025 09:41:29 +0200 Subject: [PATCH 01/12] Fixing new env in blank project issue --- src/vcastUtilities.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vcastUtilities.ts b/src/vcastUtilities.ts index cbd2a3dc..d19f83b0 100644 --- a/src/vcastUtilities.ts +++ b/src/vcastUtilities.ts @@ -573,6 +573,15 @@ export function checkIfAnyProjectsAreOpened() { return true; } } + + // In case we have empty projects without envs in it + if ( + typeof globalProjectDataCache !== "undefined" && + globalProjectDataCache.size > 0 + ) { + return true; + } + return false; } From 39e0161ad11a4bd94438e050c9825391a8113834 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Wed, 1 Oct 2025 14:45:32 +0200 Subject: [PATCH 02/12] Changelog && Version --- CHANGELOG.md | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a3c309b..c46f647c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to the "vectorcastTestExplorer" extension will be documented in this file. +## [1.0.21] - 2025-10-02 + +### Added +- Enabled creation of a new environment in a freshly created project. + ## [1.0.20] - 2025-08-25 ### Bug Fixes @@ -115,7 +120,7 @@ All notable changes to the "vectorcastTestExplorer" extension will be documented ## [1.0.8] - 2023-11-15 - Added new right click menu choices for .vce (open environment) and .env (build environment) files #30 - Added new right click menu choice for test explorer tree to allow you to insert Basis Path and ATG tests #31 - - Added Generate ATG and Generate Basis Path choices to the "flask+" icons in the text editor +- Added Generate ATG and Generate Basis Path choices to the "flask+" icons in the text editor - Added support for TEST.REQUIREMENT_KEY syntax, including a hover-over that displays the requirement text #34 - Improved the 'open settings' feature to default to the 'Workspace' tab diff --git a/package.json b/package.json index 9a1232dc..5acca894 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vectorcasttestexplorer", "displayName": "VectorCAST Test Explorer", "description": "VectorCAST Test Explorer for VS Code", - "version": "1.0.20", + "version": "1.0.21", "license": "MIT", "repository": { "type": "git", From 3710c55181784f01db55b8167263f419992340a2 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Wed, 1 Oct 2025 17:11:12 +0200 Subject: [PATCH 03/12] Added test creating an env in a new project --- .../e2e/test/specs/vcast_manage.test.ts | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index 3b6bb5e5..eab9dc09 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -146,7 +146,7 @@ describe("vTypeCheck VS Code Extension", () => { // For the compiler tab we need to do it that way, because it's input is not found // The different strucutre (autocompletion) + we already clicked on the same webview // make the problems, so we just navigate with tab and enter within the webview - await insertStringToInput("NewProject", "Project Name Input"); + await insertStringToInput("ANewProject", "Project Name Input"); await browser.keys(["Tab"]); await browser.keys("GNU Native_Automatic_C++17"); await browser.keys(["Tab"]); @@ -162,7 +162,7 @@ describe("vTypeCheck VS Code Extension", () => { ); console.log("Checking existence of new Project"); - const projectNode = await findTreeNodeAtLevel(0, "NewProject.vcm"); + const projectNode = await findTreeNodeAtLevel(0, "ANewProject.vcm"); const compilerNode = await findTreeNodeAtLevel( 1, "GNU_Native_Automatic_C++17" @@ -171,6 +171,59 @@ describe("vTypeCheck VS Code Extension", () => { expect(compilerNode).toBeDefined(); }); + it("testing creating new environment in project", async () => { + await updateTestID(); + await bottomBar.toggle(true); + const outputView = await bottomBar.openOutputView(); + await outputView.clearText(); + + const notificationsCenter = await workbench.openNotificationsCenter(); + await notificationsCenter.clearAllNotifications(); + + console.log("Create new ENV in Project"); + const activityBar = workbench.getActivityBar(); + const explorerView = await activityBar.getViewControl("Explorer"); + await explorerView?.openView(); + + const workspaceFolderSection = + await expandWorkspaceFolderSectionInExplorer("vcastTutorial"); + const cppFolder = workspaceFolderSection.findItem("cpp"); + await (await cppFolder).select(); + + const managerCpp = await workspaceFolderSection.findItem("manager.cpp"); + const databaseCpp = await workspaceFolderSection.findItem("database.cpp"); + await executeCtrlClickOn(databaseCpp); + await executeCtrlClickOn(managerCpp); + await releaseCtrl(); + + await databaseCpp.openContextMenu(); + await (await $("aria/Create VectorCAST Environment in Project")).click(); + + const button = await $(`aria/OK`); + await button.click(); + + console.log("Checking Logs"); + await browser.waitUntil( + async () => + (await outputView.getText()) + .toString() + .includes("--force --migrate' returned exit code: 0"), + { timeout: TIMEOUT } + ); + + await browser.waitUntil( + async () => + (await outputView.getText()).toString().includes("ANewProject.vcm"), + { timeout: TIMEOUT } + ); + await browser.pause(3000); + + // Should now find the env in the project + await getViewContent("Testing"); + const envNode = await findTreeNodeAtLevel(3, "DATABASE-MANAGER"); + expect(envNode).toBeDefined(); + }); + it("testing tree structure", async () => { await updateTestID(); From 63721c65a2f0964b558685fe423c6af1ca9d38f0 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 10:44:35 +0200 Subject: [PATCH 04/12] Adapted logs in test --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index eab9dc09..ce9925c0 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -157,7 +157,7 @@ describe("vTypeCheck VS Code Extension", () => { async () => (await outputView.getText()) .toString() - .includes(`Added Compiler CCAST_.CFG to Project NewProject`), + .includes(`Added Compiler CCAST_.CFG to Project ANewProject`), { timeout: TIMEOUT } ); From 73863bc65f58397e7062f9bb91ea1efbcd7bc7fb Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 13:24:57 +0200 Subject: [PATCH 05/12] Changed folder interaction in test --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index ce9925c0..ed96b4d4 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -186,9 +186,7 @@ describe("vTypeCheck VS Code Extension", () => { await explorerView?.openView(); const workspaceFolderSection = - await expandWorkspaceFolderSectionInExplorer("vcastTutorial"); - const cppFolder = workspaceFolderSection.findItem("cpp"); - await (await cppFolder).select(); + await expandWorkspaceFolderSectionInExplorer("tutorial"); const managerCpp = await workspaceFolderSection.findItem("manager.cpp"); const databaseCpp = await workspaceFolderSection.findItem("database.cpp"); From 9b64c26a0336b18e38ee21c6404153e6b312349d Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 13:48:26 +0200 Subject: [PATCH 06/12] Adapted tests --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index ed96b4d4..0c04c55d 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -186,7 +186,10 @@ describe("vTypeCheck VS Code Extension", () => { await explorerView?.openView(); const workspaceFolderSection = - await expandWorkspaceFolderSectionInExplorer("tutorial"); + await expandWorkspaceFolderSectionInExplorer("vcastTutorial"); + + const cppFolder = workspaceFolderSection.findItem("tutorial"); + await (await cppFolder).select(); const managerCpp = await workspaceFolderSection.findItem("manager.cpp"); const databaseCpp = await workspaceFolderSection.findItem("database.cpp"); From 1c155b821ea8ad38690963a9e4fa1c470d446954 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 14:11:20 +0200 Subject: [PATCH 07/12] Changed aria label --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index 0c04c55d..c743f5b0 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -200,7 +200,7 @@ describe("vTypeCheck VS Code Extension", () => { await databaseCpp.openContextMenu(); await (await $("aria/Create VectorCAST Environment in Project")).click(); - const button = await $(`aria/OK`); + const button = await $(`aria/Import OK`); await button.click(); console.log("Checking Logs"); From 27bd7d4d6ff99a5c6b701f39638de660f395ac70 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 14:23:57 +0200 Subject: [PATCH 08/12] Changed way to click on ok button --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index c743f5b0..6925a3f6 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -200,8 +200,11 @@ describe("vTypeCheck VS Code Extension", () => { await databaseCpp.openContextMenu(); await (await $("aria/Create VectorCAST Environment in Project")).click(); - const button = await $(`aria/Import OK`); - await button.click(); + // Press Tab 12 times, then Enter. We do not find the button to click on otherwise + for (let i = 0; i < 12; i++) { + await browser.keys(["Tab"]); + } + await browser.keys("Enter"); console.log("Checking Logs"); await browser.waitUntil( From 9ff7f52cac3f5e5efe43cfa93bd5d7ddd6449164 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 14:36:11 +0200 Subject: [PATCH 09/12] Changed way to click on ok button 2 --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index 6925a3f6..aea40c3d 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -200,11 +200,15 @@ describe("vTypeCheck VS Code Extension", () => { await databaseCpp.openContextMenu(); await (await $("aria/Create VectorCAST Environment in Project")).click(); - // Press Tab 12 times, then Enter. We do not find the button to click on otherwise - for (let i = 0; i < 12; i++) { - await browser.keys(["Tab"]); + let maxTries = 30; // safety limit + for (let i = 0; i < maxTries; i++) { + const active = await browser.execute(() => document.activeElement?.id); + if (active === "btnSubmit") { + await browser.keys("Enter"); + return; + } + await browser.keys("Tab"); } - await browser.keys("Enter"); console.log("Checking Logs"); await browser.waitUntil( From 4cf23a892c87b3e4ea75a2f419860026156b19a8 Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 15:54:02 +0200 Subject: [PATCH 10/12] removing new env test for release --- .../e2e/test/specs/vcast_manage.test.ts | 61 ------------------- 1 file changed, 61 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index aea40c3d..4b9aa158 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -171,67 +171,6 @@ describe("vTypeCheck VS Code Extension", () => { expect(compilerNode).toBeDefined(); }); - it("testing creating new environment in project", async () => { - await updateTestID(); - await bottomBar.toggle(true); - const outputView = await bottomBar.openOutputView(); - await outputView.clearText(); - - const notificationsCenter = await workbench.openNotificationsCenter(); - await notificationsCenter.clearAllNotifications(); - - console.log("Create new ENV in Project"); - const activityBar = workbench.getActivityBar(); - const explorerView = await activityBar.getViewControl("Explorer"); - await explorerView?.openView(); - - const workspaceFolderSection = - await expandWorkspaceFolderSectionInExplorer("vcastTutorial"); - - const cppFolder = workspaceFolderSection.findItem("tutorial"); - await (await cppFolder).select(); - - const managerCpp = await workspaceFolderSection.findItem("manager.cpp"); - const databaseCpp = await workspaceFolderSection.findItem("database.cpp"); - await executeCtrlClickOn(databaseCpp); - await executeCtrlClickOn(managerCpp); - await releaseCtrl(); - - await databaseCpp.openContextMenu(); - await (await $("aria/Create VectorCAST Environment in Project")).click(); - - let maxTries = 30; // safety limit - for (let i = 0; i < maxTries; i++) { - const active = await browser.execute(() => document.activeElement?.id); - if (active === "btnSubmit") { - await browser.keys("Enter"); - return; - } - await browser.keys("Tab"); - } - - console.log("Checking Logs"); - await browser.waitUntil( - async () => - (await outputView.getText()) - .toString() - .includes("--force --migrate' returned exit code: 0"), - { timeout: TIMEOUT } - ); - - await browser.waitUntil( - async () => - (await outputView.getText()).toString().includes("ANewProject.vcm"), - { timeout: TIMEOUT } - ); - await browser.pause(3000); - - // Should now find the env in the project - await getViewContent("Testing"); - const envNode = await findTreeNodeAtLevel(3, "DATABASE-MANAGER"); - expect(envNode).toBeDefined(); - }); - it("testing tree structure", async () => { await updateTestID(); From fb161ad9e7b948693e8de76f8d5256d4ba6a4a2d Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Thu, 2 Oct 2025 17:45:42 +0200 Subject: [PATCH 11/12] Adding test for new env in new project --- .../e2e/test/specs/vcast_manage.test.ts | 158 +++++++++++++----- 1 file changed, 115 insertions(+), 43 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index 4b9aa158..5475f801 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -128,49 +128,6 @@ describe("vTypeCheck VS Code Extension", () => { expect(compilerNode).toBeDefined(); }); - it("testing creating new project", async () => { - await updateTestID(); - await bottomBar.toggle(true); - const outputView = await bottomBar.openOutputView(); - await outputView.clearText(); - - const notificationsCenter = await workbench.openNotificationsCenter(); - await notificationsCenter.clearAllNotifications(); - - console.log("Executing Create New Project Command:"); - await browser.executeWorkbench((vscode) => { - vscode.commands.executeCommand("vectorcastTestExplorer.createNewProject"); - }); - - console.log("Inserting Data to Webview"); - // For the compiler tab we need to do it that way, because it's input is not found - // The different strucutre (autocompletion) + we already clicked on the same webview - // make the problems, so we just navigate with tab and enter within the webview - await insertStringToInput("ANewProject", "Project Name Input"); - await browser.keys(["Tab"]); - await browser.keys("GNU Native_Automatic_C++17"); - await browser.keys(["Tab"]); - await browser.keys(["Tab"]); - await browser.keys(["Enter"]); - - await browser.waitUntil( - async () => - (await outputView.getText()) - .toString() - .includes(`Added Compiler CCAST_.CFG to Project ANewProject`), - { timeout: TIMEOUT } - ); - - console.log("Checking existence of new Project"); - const projectNode = await findTreeNodeAtLevel(0, "ANewProject.vcm"); - const compilerNode = await findTreeNodeAtLevel( - 1, - "GNU_Native_Automatic_C++17" - ); - expect(projectNode).toBeDefined(); - expect(compilerNode).toBeDefined(); - }); - it("testing tree structure", async () => { await updateTestID(); @@ -912,4 +869,119 @@ describe("vTypeCheck VS Code Extension", () => { { timeout: TIMEOUT } ); }); + + it("testing creating new project", async () => { + await updateTestID(); + await bottomBar.toggle(true); + const outputView = await bottomBar.openOutputView(); + await outputView.clearText(); + + const notificationsCenter = await workbench.openNotificationsCenter(); + await notificationsCenter.clearAllNotifications(); + + console.log("Executing Create New Project Command:"); + await browser.pause(3000); + await browser.executeWorkbench((vscode) => { + vscode.commands.executeCommand("vectorcastTestExplorer.createNewProject"); + }); + + console.log("Inserting Data to Webview"); + // For the compiler tab we need to do it that way, because it's input is not found + // The different strucutre (autocompletion) + we already clicked on the same webview + // make the problems, so we just navigate with tab and enter within the webview + await insertStringToInput("ANewProject", "Project Name Input"); + await browser.keys(["Tab"]); + await browser.keys("GNU Native_Automatic_C++17"); + await browser.keys(["Tab"]); + await browser.keys(["Tab"]); + await browser.keys(["Enter"]); + + await browser.waitUntil( + async () => + (await outputView.getText()) + .toString() + .includes(`Added Compiler CCAST_.CFG to Project ANewProject`), + { timeout: TIMEOUT } + ); + + console.log("Checking existence of new Project"); + const projectNode = await findTreeNodeAtLevel(0, "ANewProject.vcm"); + const compilerNode = await findTreeNodeAtLevel( + 1, + "GNU_Native_Automatic_C++17" + ); + expect(projectNode).toBeDefined(); + expect(compilerNode).toBeDefined(); + }); + + it("testing creating new environment in new project", async () => { + await updateTestID(); + await bottomBar.toggle(true); + const outputView = await bottomBar.openOutputView(); + await outputView.clearText(); + + const notificationsCenter = await workbench.openNotificationsCenter(); + await notificationsCenter.clearAllNotifications(); + + console.log("Create new ENV in Project"); + const activityBar = workbench.getActivityBar(); + const explorerView = await activityBar.getViewControl("Explorer"); + await explorerView?.openView(); + + const workspaceFolderSection = + await expandWorkspaceFolderSectionInExplorer("vcastTutorial"); + + const cppFolder = workspaceFolderSection.findItem("tutorial"); + await (await cppFolder).select(); + + const managerCpp = await workspaceFolderSection.findItem("manager.cpp"); + await executeCtrlClickOn(managerCpp); + await releaseCtrl(); + + await managerCpp.openContextMenu(); + await (await $("aria/Create VectorCAST Environment in Project")).click(); + + // Wait for webview to appear + let webviews = await workbench.getAllWebviews(); + expect(webviews).toHaveLength(1); + let webview = webviews[0]; + await webview.open(); + + // ----------------------------- + // Select the correct project + // ----------------------------- + const projectDropdown = await $("aria/Project Path"); + await projectDropdown.waitForDisplayed({ timeout: TIMEOUT }); + await projectDropdown.click(); // Open dropdown + await browser.keys(["ArrowDown"]); // Navigate to desired project + await browser.keys(["Enter"]); // Select it + + // ----------------------------- + // Click OK to create the environment + // ----------------------------- + const okButton = await $("aria/Import OK"); + await okButton.waitForDisplayed({ timeout: TIMEOUT }); + await okButton.click(); + + console.log("Checking Logs"); + await browser.waitUntil( + async () => + (await outputView.getText()) + .toString() + .includes("--force --migrate' returned exit code: 0"), + { timeout: TIMEOUT } + ); + + await browser.waitUntil( + async () => + (await outputView.getText()).toString().includes("ANewProject.vcm"), + { timeout: TIMEOUT } + ); + await browser.pause(3000); + + // Should now find the env in the project + await getViewContent("Testing"); + const envNode = await findTreeNodeAtLevel(3, "MANAGER"); + expect(envNode).toBeDefined(); + }); }); From 739fee6365e9fc5077a790a3165dc2eafd6d4f7d Mon Sep 17 00:00:00 2001 From: Denis Moslavac Date: Mon, 6 Oct 2025 09:11:36 +0200 Subject: [PATCH 12/12] commenting out folder select --- tests/internal/e2e/test/specs/vcast_manage.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/internal/e2e/test/specs/vcast_manage.test.ts b/tests/internal/e2e/test/specs/vcast_manage.test.ts index 5475f801..cc7b1c2f 100644 --- a/tests/internal/e2e/test/specs/vcast_manage.test.ts +++ b/tests/internal/e2e/test/specs/vcast_manage.test.ts @@ -931,8 +931,8 @@ describe("vTypeCheck VS Code Extension", () => { const workspaceFolderSection = await expandWorkspaceFolderSectionInExplorer("vcastTutorial"); - const cppFolder = workspaceFolderSection.findItem("tutorial"); - await (await cppFolder).select(); + // const cppFolder = workspaceFolderSection.findItem("tutorial"); + // await (await cppFolder).select(); const managerCpp = await workspaceFolderSection.findItem("manager.cpp"); await executeCtrlClickOn(managerCpp);