You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add headless Playwright E2E coverage for the standalone WebUI
- add fixture-based and emulator-backed Playwright suites
- add standalone server and emulator harness helpers
- support DATA_DIR isolation and dynamic emulator ports
- fix AD5X and legacy emulator compatibility issues
- document the new test workflow and runtime data path behavior
Copy file name to clipboardExpand all lines: README.md
+61-3Lines changed: 61 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ Or if accessing from another device on your network:
145
145
http://<server-ip>:3000
146
146
```
147
147
148
-
**Default Login:** The default password is `changeme`. You should change this in `data/config.json` or via the `--webui-password` flag.
148
+
**Default Login:** The default password is `changeme`. You should change this in the active config file (by default `data/config.json`, or the directory pointed to by `DATA_DIR`) or via the `--webui-password` flag.
149
149
150
150
<divalign="center">
151
151
<h2>Command Line Options</h2>
@@ -168,7 +168,18 @@ http://<server-ip>:3000
168
168
<h2>Configuration</h2>
169
169
</div>
170
170
171
-
The application automatically creates a configuration file at `data/config.json` on first run.
171
+
The application automatically creates a configuration file in the active data directory on first run. By default this is `data/config.json`.
172
+
173
+
By default, runtime data is stored in `./data` under the working directory. Set `DATA_DIR` to move configuration, logs, and saved printer state elsewhere.
174
+
175
+
```bash
176
+
# Linux/macOS
177
+
DATA_DIR=/path/to/flashforge-data npm start
178
+
179
+
# PowerShell
180
+
$env:DATA_DIR = 'C:\FlashForgeWebUI\data'
181
+
npm start
182
+
```
172
183
173
184
<divalign="center">
174
185
@@ -183,6 +194,53 @@ The application automatically creates a configuration file at `data/config.json`
183
194
184
195
</div>
185
196
197
+
<divalign="center">
198
+
<h2>Testing</h2>
199
+
</div>
200
+
201
+
```bash
202
+
# Jest app tests
203
+
npm test
204
+
205
+
# TypeScript checks
206
+
npm run type-check
207
+
208
+
# Playwright browser E2E (fixture/stub server)
209
+
npm run test:e2e:install
210
+
npm run test:e2e
211
+
npm run test:e2e:smoke
212
+
npm run test:e2e:auth
213
+
214
+
# Playwright emulator-backed E2E (headless, single worker)
215
+
npm run test:e2e:emulator
216
+
npm run test:e2e:emulator:direct
217
+
npm run test:e2e:emulator:discovery
218
+
npm run test:e2e:emulator:multi
219
+
220
+
# Combined entry points
221
+
npm run test:e2e:all
222
+
npm run test:all
223
+
```
224
+
225
+
The fixture Playwright suite in `e2e/` runs against a built standalone WebUI with a local stub server.
226
+
227
+
The emulator-backed suite in `e2e-emulator/` runs headless Chromium against the real standalone server plus `flashforge-emulator-v2`. Clone the emulator repo next to this one at `../flashforge-emulator-v2`, or point `FF_EMULATOR_ROOT` at it explicitly.
228
+
229
+
```bash
230
+
# Linux/macOS
231
+
FF_EMULATOR_ROOT=../flashforge-emulator-v2 npm run test:e2e:emulator
All Playwright scripts support npm passthrough arguments:
239
+
240
+
```bash
241
+
npm run test:e2e:emulator:direct -- --grep "Adventurer 3"
242
+
```
243
+
186
244
<divalign="center">
187
245
<h2>Building from Source</h2>
188
246
</div>
@@ -207,7 +265,7 @@ npm run build:mac-arm # macOS ARM (Apple Silicon)
207
265
| --- | --- |
208
266
|**"Cannot GET /" or blank page when accessing WebUI**| If running from source: Make sure you ran `npm run build` before `npm start`<br>If using a pre-1.0.2 binary: Update to version 1.0.2 or later (fixes static file serving bug) |
209
267
|**"Permission denied" when running binary**| Run `chmod +x flashforge-webui-linux-*` to make executable |
210
-
|**Port already in use**| Change the port in `data/config.json` or use `--webui-port=3001`|
268
+
|**Port already in use**| Change the port in the active config file (default `data/config.json`, or the directory pointed to by `DATA_DIR`) or use `--webui-port=3001`|
211
269
|**Cannot connect to printer**| Ensure your printer is on the same network as the device running WebUI<br>Check that the printer's IP address is correct<br>For legacy printers, ensure TCP port 8899 is accessible |
212
270
|**Selecting the correct binary for your platform**| Windows: `flashforge-webui-win-x64.exe`<br>macOS Intel: `flashforge-webui-macos-x64`<br>macOS Apple Silicon: `flashforge-webui-macos-arm64`<br>Linux x64: `flashforge-webui-linux-x64`<br>Raspberry Pi (64-bit OS): `flashforge-webui-linux-arm64`<br>Raspberry Pi (32-bit OS): `flashforge-webui-linux-armv7`<br>Check your architecture with `uname -m` (x86_64 = x64, aarch64 = ARM64, armv7l = ARMv7) |
0 commit comments