Skip to content

Commit 6aad3c3

Browse files
committed
docs: add documentation for e2e and testing-view
1 parent 8cba11d commit 6aad3c3

4 files changed

Lines changed: 119 additions & 74 deletions

File tree

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Our `pnpm-workspace.yaml` defines the following workspaces:
2828
| `backend` | Go | Data ingestion and pod communication server |
2929
| `packet-sender` | Rust | Utility for simulating vehicle packets |
3030
| `hyperloop-control-station` | JS | The main Control Station electron desktop application |
31+
| `e2e` | TS | End-to-end tests for the whole app (Playwright) |
3132
| `@workspace/ui` | TS/React | Shared UI component library (frontend-kit) |
3233
| `@workspace/core` | TS | Shared business logic and types (frontend-kit) |
3334
| `@workspace/eslint-config` | ESLint | Common ESLint configuration (frontend-kit) |
@@ -57,9 +58,19 @@ All Turbo scripts support filtering to target specific workspaces:
5758
#### Lifecycle Scripts
5859

5960
- `pnpm build` – Compiles every package in the monorepo (Go binaries, Rust crates, and Vite apps).
60-
- `pnpm test` – Runs all test suites across the repo (Vitest, Go tests, and Cargo tests).
61+
- `pnpm test` – Runs all test suites across the repo (Vitest, Go tests, Cargo tests, and Playwright e2e tests).
6162
- `pnpm lint` – Runs ESLint across all TypeScript packages.
6263
- `pnpm preview` – Previews the production Vite builds for the frontend applications.
64+
65+
#### Electron App Scripts
66+
67+
- `pnpm start` – Launches the Electron app directly (requires a prior build).
68+
- `pnpm build:win` – Packages the Electron app for Windows.
69+
- `pnpm build:linux` – Packages the Electron app for Linux.
70+
- `pnpm build:mac` – Packages the Electron app for macOS.
71+
72+
#### Utility Scripts
73+
6374
- `pnpm ui:add <component-name>` - To add shadcn/ui components
6475

6576
> Note: don't forget to also include it in frontend-kit/ui/src/components/shadcn/index.ts to be able to access it from @workspace/ui

e2e/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# e2e
2+
3+
End-to-end tests for the whole app. Tests run against the real Electron application using **Playwright** with the `@playwright/test` electron driver.
4+
5+
---
6+
7+
## Overview
8+
9+
Tests are split into two Playwright projects:
10+
11+
| Project | Directory | Description |
12+
| :------------ | :--------------- | :------------------------------------------------------------ |
13+
| `ui` | `tests/ui/` | UI tests — launch the Electron app and interact with the UI |
14+
| `integration` | `tests/integration/` | Integration tests (reserved for future use) |
15+
16+
---
17+
18+
## UI Tests
19+
20+
These tests launch the full Electron app and drive it through Playwright. They cover app startup, window titles, mode badge state, chart interactions, and filter dialog behaviour.
21+
22+
---
23+
24+
## Fixtures
25+
26+
`fixtures/electron.ts` provides three custom Playwright fixtures:
27+
28+
| Fixture | Description |
29+
| :--------- | :------------------------------------------------------------------ |
30+
| `app` | Launches the Electron app and waits for both windows to be ready |
31+
| `page` | The main Control Station window — waits for the app to leave loading state |
32+
| `logPage` | The Backend Logs window |
33+
34+
---
35+
36+
## Scripts
37+
38+
| Script | Description |
39+
| :--------------------- | :---------------------------------------------------------------- |
40+
| `pnpm test` | Build all dependencies then run all tests |
41+
| `pnpm test:ui` | Build all dependencies then run only `tests/ui` |
42+
| `pnpm test:integration`| Build the electron app then run only `tests/integration` |
43+
| `pnpm test:fast` | Run all tests without rebuilding (assumes already built) |
44+
| `pnpm test:fast:ui` | Run `tests/ui` without rebuilding |
45+
| `pnpm report` | Open the last Playwright HTML report |
46+
47+
> **Note:** `pnpm test` and `pnpm test:ui` always build the `testing-view` (e2e mode) and the electron app before running. Use the `:fast` variants when iterating to skip the build step.
48+
49+
---
50+
51+
## Requirements
52+
53+
- The `hyperloop-control-station` electron app must be built (handled automatically by `pnpm test`).
54+
- `testing-view` must be built in e2e mode (`build:e2e`), also handled automatically.
55+
- Workers are set to `1` — Electron tests must run serially since only one app instance can run at a time.
56+
57+
> **Note:** The app runs in its normal production mode during tests — there is no special test environment or mock mode.

frontend/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The frontend is organized as 6 workspaces out of 9 in the whole monorepo, divide
2626
- **Zustand** for state management
2727
- **React Router** for navigation
2828
- **Radix UI / shadcn/ui** for UI components
29+
- **RxJS** for reactive data streams
2930
- **WebSocket** for real-time backend communication
3031
- **@dnd-kit** for drag-and-drop functionality
3132

frontend/testing-view/README.md

Lines changed: 49 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,49 @@
1-
# React + TypeScript + Vite
2-
3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4-
5-
Currently, two official plugins are available:
6-
7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9-
10-
## React Compiler
11-
12-
The React Compiler is currently not compatible with SWC. See [this issue](https://github.com/vitejs/vite-plugin-react/issues/428) for tracking the progress.
13-
14-
## Expanding the ESLint configuration
15-
16-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17-
18-
```js
19-
export default defineConfig([
20-
globalIgnores(["dist"]),
21-
{
22-
files: ["**/*.{ts,tsx}"],
23-
extends: [
24-
// Other configs...
25-
26-
// Remove tseslint.configs.recommended and replace with this
27-
tseslint.configs.recommendedTypeChecked,
28-
// Alternatively, use this for stricter rules
29-
tseslint.configs.strictTypeChecked,
30-
// Optionally, add this for stylistic rules
31-
tseslint.configs.stylisticTypeChecked,
32-
33-
// Other configs...
34-
],
35-
languageOptions: {
36-
parserOptions: {
37-
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
38-
tsconfigRootDir: import.meta.dirname,
39-
},
40-
// other options...
41-
},
42-
},
43-
]);
44-
```
45-
46-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47-
48-
```js
49-
// eslint.config.js
50-
import reactX from "eslint-plugin-react-x";
51-
import reactDom from "eslint-plugin-react-dom";
52-
53-
export default defineConfig([
54-
globalIgnores(["dist"]),
55-
{
56-
files: ["**/*.{ts,tsx}"],
57-
extends: [
58-
// Other configs...
59-
// Enable lint rules for React
60-
reactX.configs["recommended-typescript"],
61-
// Enable lint rules for React DOM
62-
reactDom.configs.recommended,
63-
],
64-
languageOptions: {
65-
parserOptions: {
66-
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
67-
tsconfigRootDir: import.meta.dirname,
68-
},
69-
// other options...
70-
},
71-
},
72-
]);
73-
```
1+
# Testing View
2+
3+
The Testing View is the web interface used during vehicle testing sessions. It provides real-time telemetry charts and a filtering system for monitoring packet data from the pod.
4+
5+
It is built with **React**, **TypeScript**, and **Vite**, and runs embedded inside the Hyperloop Control Station Electron app.
6+
7+
---
8+
9+
## Features
10+
11+
### Workspaces
12+
13+
Workspaces are named tabs that each hold their own independent set of charts. You can create, rename, and delete workspaces, and switch between them at any time. The active workspace and its charts are persisted across sessions.
14+
15+
### Charts
16+
17+
The charts panel displays live telemetry data as line charts within the active workspace. You can add, remove, and reorder charts via drag and drop. Each chart supports multiple data series and a configurable history limit that controls how many data points are kept in memory.
18+
19+
### Filtering
20+
21+
The filtering system lets you select which telemetry packets and commands are visible. Filters are organized in a tree matching the packet catalog structure, with search, select all, and clear all controls.
22+
23+
### Settings
24+
25+
A settings dialog exposes runtime configuration for the vehicle connection, including vehicle board selection, ADJ branch, TCP/TFTP connection parameters, BLCU addresses, and logging options (time unit and output path).
26+
27+
### Key Bindings
28+
29+
The key bindings system lets you assign keyboard shortcuts to commands sent to the vehicle, as well as special built-in actions like starting, stopping, or toggling the logger.
30+
31+
---
32+
33+
## Scripts
34+
35+
| Script | Description |
36+
| :---------------- | :---------------------------------------------- |
37+
| `pnpm dev` | Start the Vite dev server |
38+
| `pnpm build` | Type-check and build for production |
39+
| `pnpm build:e2e` | Build in e2e mode (used by the `e2e` workspace) |
40+
| `pnpm preview` | Preview the production build |
41+
| `pnpm lint` | Run ESLint |
42+
| `pnpm test` | Run unit tests once (Vitest) |
43+
| `pnpm test:watch` | Run unit tests in watch mode |
44+
45+
---
46+
47+
## Tests
48+
49+
Unit tests are written with **Vitest**. The charts store, filtering store, and utility functions are covered.

0 commit comments

Comments
 (0)