Skip to content

Commit d26d120

Browse files
gajopclaude
andcommitted
e2e: cover project save-as, large map, and create openability
- new_project_create now also asserts LoadProjectCommand: the reloaded engine loads the freshly created project, proving it is a real, loadable project. - project_save_as: Save As writes the current project under a new name and emits SetProjectNamePath + SaveProjectInfo + Save (no reload). - large_map_create: a 32x32 blank map (the dialog's maximum) generates and boots without OOM or crash. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9cb0e53 commit d26d120

2 files changed

Lines changed: 50 additions & 2 deletions

File tree

tools/e2e/scenarios/gallery.py

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,53 @@ def new_project_create(run_state: E2ERun) -> None:
363363
run_state.click(*dialog_point(run_state, DIALOG["new_project_create"]), delay=2.5)
364364

365365
# Save persists the project; the reload reads it back and boots into the new
366-
# map. The dialog fields do not reach the log (neither command serializes),
367-
# so assert the pair fired, which is what "Create did something" means.
366+
# map, where the engine loads it (LoadProjectCommand). The dialog fields do
367+
# not reach the log (neither command serializes), so assert the trio fired,
368+
# which is what "Create made a real, loadable project" means.
368369
run_state.assert_command("SaveProjectInfoCommand")
369370
run_state.assert_command("ReloadIntoProjectCommand")
371+
run_state.assert_command("LoadProjectCommand")
372+
373+
374+
@scenario()
375+
def project_save_as(run_state: E2ERun) -> None:
376+
"""Save As writes the current project under a new name (no reload).
377+
378+
Emits SetProjectNamePath + SaveProjectInfo + Save. The name-input row pushes
379+
the dialog footer down, so this uses the taller dialog's OK position.
380+
"""
381+
left = panel_left(run_state)
382+
run_state.focus()
383+
run_state.click(*panel_point(left, TOOLBAR["save_as"]), delay=1.0)
384+
run_state.screenshot("save-as-open")
385+
run_state.click(*dialog_point(run_state, DIALOG["file_name"]), delay=0.3)
386+
run_state.type_text("SavedProj")
387+
run_state.key("Return", delay=0.3)
388+
run_state.click(*dialog_point(run_state, DIALOG["file_ok_name"]), delay=1.5)
389+
run_state.assert_command("SetProjectNamePathCommand")
390+
run_state.assert_command("SaveProjectInfoCommand")
391+
run_state.assert_command("SaveCommand")
392+
393+
394+
@scenario()
395+
def large_map_create(run_state: E2ERun) -> None:
396+
"""Create the largest map the dialog allows (32x32) and boot into it.
397+
398+
The size fields clamp at 32, so this is the biggest a user can make. A
399+
32x32 blank map is generated and reloaded into; the engine surviving to the
400+
screenshot (a bigger map is more memory and a slower generate) is the check.
401+
"""
402+
left = panel_left(run_state)
403+
run_state.focus()
404+
run_state.click(*panel_point(left, TOOLBAR["new_project"]), delay=1.0)
405+
run_state.click(*dialog_point(run_state, DIALOG["new_project_name"]), delay=0.2)
406+
run_state.type_text("BigMap")
407+
run_state.key("Return", delay=0.3)
408+
for field, value in (("new_project_size_x", "32"), ("new_project_size_y", "32")):
409+
run_state.click(*dialog_point(run_state, DIALOG[field]), delay=0.2)
410+
run_state.key("ctrl+a", delay=0.08)
411+
run_state.type_text(value)
412+
run_state.key("Return", delay=0.25)
413+
run_state.click(*dialog_point(run_state, DIALOG["new_project_create"]), delay=6.0)
414+
run_state.assert_command("ReloadIntoProjectCommand")
415+
run_state.screenshot("big-map-loaded")

tools/e2e/scenarios/geometry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@
246246
"new_project_create": (347, 407),
247247
"file_name": (240, 590),
248248
"file_type": (240, 629),
249+
# A name-input dialog (Save As) has its footer one row below the plain one.
250+
"file_ok_name": (347, 641),
249251
"asset_core_cell": (104, 360),
250252
"asset_ok": (343, 603),
251253
"asset_ok_gallery": (347, 602),

0 commit comments

Comments
 (0)