Skip to content

sehyunnoh/e2e-auto

Repository files navigation

E2E Assistant

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.

Tech Stack

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

Project Structure

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

Features

File Generator

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., 20260412 from 20260412_test.csv
    • Content dates (blue tags) — e.g., 2026-04-12 found inside the file
  • 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

File Copy

Copy source files to destination directories.

  • Load Template: open a template.json file 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

Collapsible Sections

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.

Template System

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.

Getting Started

Prerequisites

  • Node.js 20+ (developed with v24.14.1)
  • Windows 10/11

Install

npm install

Development

npm run dev

Starts 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=1 is 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 SilentlyContinue

Bash: unset ELECTRON_RUN_AS_NODE

Build

npm run build

Outputs renderer to dist/ and main/preload to dist-electron/.

Package (Windows .exe)

npm run package

Produces 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

Lint

npm run lint

Architecture

Main Process (electron/main.ts)

  • Creates a 1200x800 BrowserWindow with no menu bar
  • contextIsolation: true, nodeIntegration: false for security
  • IPC handlers:
    • load-template — opens file dialog, reads and parses JSON
    • detect-dates — extracts date patterns from filename and file content (text + Excel)
    • generate-file — replaces dates in filename and content, writes new file
    • get-dir — returns directory of a file path
    • copy-files — copies files to destination, reports copied/overwritten/failed

Exposes window.electronAPI via contextBridge:

  • getPathForFile(file) — resolves absolute path using webUtils.getPathForFile
  • loadTemplate() — triggers file dialog and returns parsed template
  • detectDates(filePath) — returns detected filename and content dates
  • generateFile(...) — creates a new file with replaced dates
  • getDir(filePath) — returns parent directory
  • copyFiles(sourcePaths, destDir) — copies files and returns results

Build Format

  • No "type": "module" in package.json — main/preload are built as CommonJS
  • xlsx is configured as an external dependency in Vite to avoid bundling issues
  • Code signing is disabled for local builds (signAndEditExecutable: false)

Scripts Reference

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors