A Windows desktop application for automating E2E test workflows. It provides two core features: File Generator (create test files with date replacement) and File Copy (distribute files to target directories) — all managed through a drag-and-drop container-based UI.
| Area | Choice |
|---|---|
| Runtime | Electron 41 |
| Bundler / Dev | Vite 8 |
| UI | React 19 + TypeScript |
| Electron Plugin | vite-plugin-electron/simple |
| Excel Support | SheetJS (xlsx) |
| Packaging | electron-builder |
e2e-auto/
├── electron/
│ ├── main.ts # Main process: window, IPC handlers, file ops
│ └── preload.ts # Context bridge: exposes APIs to renderer
├── src/
│ ├── App.tsx # Root component with two collapsible sections
│ ├── App.css # Global styles (dark theme)
│ ├── index.css # CSS reset
│ ├── main.tsx # React entry point
│ ├── types.ts # Type definitions
│ ├── electron.d.ts # Window.electronAPI type declarations
│ └── components/
│ ├── Section.tsx # Collapsible section wrapper
│ ├── GeneratorCard.tsx # File Generator container card
│ ├── ContainerCard.tsx # File Copy container card
│ └── DropZone.tsx # Drag-and-drop zone component
├── template.json # Sample template file
├── dist/ # (built) Renderer output
├── dist-electron/ # (built) Main/preload output
├── release/ # (built) Packaged executables
├── index.html # Vite entry HTML
├── vite.config.ts # Vite + electron plugin config
└── package.json # Scripts, dependencies, build config
Generate new test files from sample files with automatic date replacement.
- Drag and drop sample files (CSV, TXT, Excel) into the container
- Auto-detect dates from both filename and file content, displayed separately:
- Filename dates (green tags) — e.g.,
20260412from20260412_test.csv - Content dates (blue tags) — e.g.,
2026-04-12found inside the file
- Filename dates (green tags) — e.g.,
- Two target date pickers: one for filename date, one for content date
- Output directory defaults to the source file's directory
- Supported date formats:
YYYYMMDD,YYYY-MM-DD,YYYY/MM/DD - Excel support: reads cell values and replaces dates in string and numeric cells
- Generate / Generate All buttons to create files
Copy source files to destination directories.
- Load Template: open a
template.jsonfile via file explorer, then select an app from the dropdown to auto-populate containers with expected files and destinations - Drag and drop source files into each container
- Destination path input with template auto-fill
- Upload / Upload All buttons to copy files
- Status messages: shows copied/overwritten/failed counts per container
- Refresh / Refresh All to clear containers for next run
Both File Generator and File Copy are wrapped in collapsible sections. The section header always shows action buttons (Refresh All, Generate All / Upload All, + Add Container) regardless of open/closed state. Container DOM is preserved when collapsed so state is not lost.
A JSON template file defines apps with expected file lists and destinations:
{
"apps": [
{
"name": "App Alpha",
"containers": [
{
"expectedFiles": ["20260412_test.csv"],
"destination": "D:\\output\\alpha\\data"
}
]
}
]
}Loading a template creates containers with pre-filled destination paths and expected file indicators in the source drop zone.
- Node.js 20+ (developed with v24.14.1)
- Windows 10/11
npm installnpm run devStarts Vite dev server (http://localhost:5173) and opens the Electron window. HMR is enabled — changes to src/ or electron/ are reflected immediately.
Note: If
ELECTRON_RUN_AS_NODE=1is set in your shell environment, Electron will run in plain Node.js mode and the app will fail to start. Unset it before running:PowerShell:
Remove-Item Env:ELECTRON_RUN_AS_NODE -ErrorAction SilentlyContinueBash:
unset ELECTRON_RUN_AS_NODE
npm run buildOutputs renderer to dist/ and main/preload to dist-electron/.
npm run packageProduces two executables in release/:
| File | Description |
|---|---|
E2E Assistant 1.0.0.exe |
Portable — run without installation |
E2E Assistant Setup 1.0.0.exe |
NSIS installer with directory selection |
npm run lintMain Process (electron/main.ts)
- Creates a 1200x800
BrowserWindowwith no menu bar contextIsolation: true,nodeIntegration: falsefor security- IPC handlers:
load-template— opens file dialog, reads and parses JSONdetect-dates— extracts date patterns from filename and file content (text + Excel)generate-file— replaces dates in filename and content, writes new fileget-dir— returns directory of a file pathcopy-files— copies files to destination, reports copied/overwritten/failed
Preload (electron/preload.ts)
Exposes window.electronAPI via contextBridge:
getPathForFile(file)— resolves absolute path usingwebUtils.getPathForFileloadTemplate()— triggers file dialog and returns parsed templatedetectDates(filePath)— returns detected filename and content datesgenerateFile(...)— creates a new file with replaced datesgetDir(filePath)— returns parent directorycopyFiles(sourcePaths, destDir)— copies files and returns results
- No
"type": "module"inpackage.json— main/preload are built as CommonJS xlsxis configured as an external dependency in Vite to avoid bundling issues- Code signing is disabled for local builds (
signAndEditExecutable: false)
| Command | Description |
|---|---|
npm run dev |
Start Vite + Electron in development mode |
npm run build |
TypeScript check + production build |
npm run package |
Build + package as Windows .exe (NSIS + portable) |
npm run lint |
Run ESLint |
npm run preview |
Preview built renderer via Vite |