Add ability to manually configure Node.js path for users who have Node.js installed but not in their system PATH. Features: - Browse and select custom Node.js installation folder - Visual status indicator showing Node.js version or "Not found" - Reset to system default PATH option - Manual configuration option in setup banner - Real-time Node.js status checking closes #1050 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds manual Node.js path configuration so the app works even when Node isn’t on PATH, fulfilling #1050. Users can browse to their install, reset to default, and see real-time status in Settings and during setup. - New Features - Settings: NodePathSelector to browse a Node.js folder, show version/“Not found” status, and reset to system PATH (persists customNodePath). - Setup banner: manual config flow with a folder picker if Node is already installed. - IPC: select-node-folder, set-node-path, get-node-path; reloads env and prepends custom path to PATH. - Real-time Node.js status check with visual indicator (CheckCircle on valid). - E2E tests for browse, reset, and valid-status display. <!-- End of auto-generated description by cubic. -->
59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import { test } from "./helpers/test_helper";
|
|
import { expect } from "@playwright/test";
|
|
|
|
test.describe("Node.js Path Configuration", () => {
|
|
test("should browse and set custom Node.js path", async ({ po }) => {
|
|
await po.setUp();
|
|
await po.goToSettingsTab();
|
|
|
|
const browseButton = po.page.getByRole("button", {
|
|
name: /Browse for Node\.js/i,
|
|
});
|
|
await browseButton.click();
|
|
|
|
// Should show selecting state
|
|
await expect(
|
|
po.page.getByRole("button", { name: /Selecting\.\.\./i }),
|
|
).toBeVisible();
|
|
});
|
|
|
|
test("should reset custom path to system default", async ({ po }) => {
|
|
await po.setUp();
|
|
await po.goToSettingsTab();
|
|
|
|
const resetButton = po.page.getByRole("button", {
|
|
name: /Reset to Default/i,
|
|
});
|
|
|
|
if (await resetButton.isVisible()) {
|
|
await resetButton.click();
|
|
|
|
// Should show system PATH after reset
|
|
await expect(po.page.getByText("System PATH:")).toBeVisible();
|
|
}
|
|
});
|
|
|
|
test("should show CheckCircle when Node.js is valid", async ({ po }) => {
|
|
await po.setUp();
|
|
await po.goToSettingsTab();
|
|
|
|
// Wait for status check
|
|
await po.page.waitForTimeout(2000);
|
|
|
|
// Target the specific valid status container with CheckCircle
|
|
const validStatus = po.page.locator(
|
|
"div.flex.items-center.gap-1.text-green-600, div.flex.items-center.gap-1.text-green-400",
|
|
);
|
|
|
|
// Skip test if Node.js is not installed
|
|
if (!(await validStatus.isVisible())) {
|
|
test.skip();
|
|
}
|
|
|
|
// If visible, check for CheckCircle icon
|
|
await expect(validStatus).toBeVisible();
|
|
const checkIcon = validStatus.locator("svg").first();
|
|
await expect(checkIcon).toBeVisible();
|
|
});
|
|
});
|