Record original-alignment implementation and traceability checkpoint
Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
@@ -14,6 +14,22 @@ var _warehouse: StringName = &""
|
||||
var _save_path := "user://tests/business_ui_%d/queued_policy" % OS.get_process_id()
|
||||
|
||||
|
||||
func _test_layer_palette() -> void:
|
||||
_main.call("_set_layer", 0)
|
||||
var before: Color = _panel.facility_status_label.get_theme_color("font_color")
|
||||
var selected: bool = _panel.business_open_button.button_pressed
|
||||
_main.call("_set_layer", 1)
|
||||
_panel.refresh()
|
||||
_expect(_panel.facility_status_label.get_theme_color("font_color") == Color("d8eeea"), "BACK panel text survives refresh")
|
||||
_expect(_panel.business_open_button.get_theme_color("font_hover_color") == Color("d8eeea") and _panel.business_open_button.get_theme_color("font_disabled_color") == Color("8da4a4"), "BACK toggle remains readable for hover and disabled states")
|
||||
_panel.call("_set_result", "条件未達", false)
|
||||
_expect(_panel.result_label.get_theme_color("font_color") == Color("ffb498"), "BACK error retains warning colour")
|
||||
_main.call("_set_layer", 0)
|
||||
_expect(_panel.facility_status_label.get_theme_color("font_color") == before and _panel.result_label.get_theme_color("font_color") == Color("a7402e"), "FRONT restores panel and warning colours")
|
||||
_expect(_panel.business_open_button.button_pressed == selected, "palette does not toggle policy")
|
||||
_panel.call("_set_result", "", true)
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
@@ -42,6 +58,7 @@ func _run() -> void:
|
||||
_expect(_panel.visible and _panel.apply_button.disabled and _panel.facility_option.disabled,
|
||||
"business nav opens a safe empty state before completed construction")
|
||||
_expect("完成" in _panel.facility_status_label.text, "empty state explains completed facility prerequisite")
|
||||
_test_layer_palette()
|
||||
for request: Array in [
|
||||
[&"reception", Vector3i(-8, 0, 0)],
|
||||
[&"standard_room", Vector3i(-8, 2, 0)],
|
||||
@@ -68,13 +85,30 @@ func _run() -> void:
|
||||
return
|
||||
_main.call("_activate_management_mode", &"business")
|
||||
_panel.refresh()
|
||||
_test_related_facility_disk_save()
|
||||
_test_prices_and_drafts()
|
||||
_test_open_close()
|
||||
_test_saved_pending_edit()
|
||||
_test_customer_counts()
|
||||
await _test_navigation_and_layout()
|
||||
_finish()
|
||||
|
||||
|
||||
func _test_related_facility_disk_save() -> void:
|
||||
_clock.set_paused(true)
|
||||
var linked: CommandResult = _runtime.submit_command(&"set_facility_conditions", {&"facility_id": _rooms[0], &"conditions": {&"related_facility_id": _rooms[1]}})
|
||||
_expect(linked.is_success(), "built room accepts related facility through Runtime")
|
||||
var snapshot: Dictionary = _runtime.create_snapshot()
|
||||
var saved: Dictionary = _runtime.save_to_path(_save_path)
|
||||
_expect(bool(saved.get(&"ok", false)), "related facility saves to real disk slot")
|
||||
_runtime.submit_command(&"set_facility_conditions", {&"facility_id": _rooms[0], &"conditions": {&"related_facility_id": &""}})
|
||||
var loaded: Dictionary = _runtime.load_from_path(_save_path)
|
||||
_expect(bool(loaded.get(&"ok", false)), "related facility loads through Runtime crosslink validation")
|
||||
_expect(_runtime.facility_service.get_instance(_rooms[0]).related_facility_id == _rooms[1], "restored room retains the selected dependency")
|
||||
_expect(_runtime.facility_service.create_snapshot() == snapshot[&"systems"][&"runtime"][&"facilities"], "facility state is exact across disk roundtrip")
|
||||
_runtime.submit_command(&"set_facility_conditions", {&"facility_id": _rooms[0], &"conditions": {&"related_facility_id": &""}})
|
||||
|
||||
|
||||
func _test_prices_and_drafts() -> void:
|
||||
_choose(_panel.facility_option, _rooms[0])
|
||||
_expect(_panel.price_option.item_count == 5 and not _panel.price_option.disabled, "five price modes are available for paid guest rooms")
|
||||
@@ -124,8 +158,9 @@ func _test_open_close() -> void:
|
||||
_expect(not bool(_row(_rooms[1]).get(&"business_open", true)) and "停止" in _panel.facility_status_label.text,
|
||||
"close reaches actual facility operator state and status text")
|
||||
_expect("受付済みの料金は変わりません" in _panel.explanation_label.text
|
||||
and "開始済みのサービス" in _panel.explanation_label.text and "給与は発生" in _panel.explanation_label.text,
|
||||
"UI explains fixed accepted prices, service completion, and continued wages during closure")
|
||||
and "開始済みのサービス" in _panel.explanation_label.text
|
||||
and "休業中も給与と施設維持費は発生" in _panel.explanation_label.text,
|
||||
"UI explains fixed accepted prices, service completion, and continued wages plus upkeep during closure")
|
||||
_panel.business_open_button.button_pressed = true
|
||||
_panel.apply_button.pressed.emit()
|
||||
_expect(bool(_row(_rooms[1]).get(&"business_open", false)), "admission can be reopened through the same controls")
|
||||
@@ -204,7 +239,8 @@ func _test_navigation_and_layout() -> void:
|
||||
_expect(control.get_global_rect().position.x >= side.get_global_rect().position.x
|
||||
and control.get_global_rect().end.x <= side.get_global_rect().end.x, "%s fits inside narrow sidebar" % control.name)
|
||||
if OS.get_environment("THE_TREE_BUSINESS_UI_CAPTURE") == "1":
|
||||
var capture_dir := ProjectSettings.globalize_path("res://artifacts/business-management")
|
||||
var requested_capture := OS.get_environment("THE_TREE_BUSINESS_CAPTURE_DIR")
|
||||
var capture_dir := ProjectSettings.globalize_path(requested_capture if not requested_capture.is_empty() else "res://artifacts/business-management")
|
||||
DirAccess.make_dir_recursive_absolute(capture_dir)
|
||||
await RenderingServer.frame_post_draw
|
||||
root.get_texture().get_image().save_png(capture_dir.path_join("business-panel.png"))
|
||||
@@ -213,6 +249,10 @@ func _test_navigation_and_layout() -> void:
|
||||
await process_frame
|
||||
await RenderingServer.frame_post_draw
|
||||
root.get_texture().get_image().save_png(capture_dir.path_join("warehouse-policy.png"))
|
||||
if OS.get_environment("THE_TREE_PANEL_SKIN_CAPTURE") == "1":
|
||||
_main.call("_set_layer", 1)
|
||||
await process_frame;await RenderingServer.frame_post_draw
|
||||
_expect(root.get_texture().get_image().save_png(ProjectSettings.globalize_path("res://artifacts/facility-dimensions-2026-09-29/business-skin-back.png")) == OK, "capture BACK management skin")
|
||||
_main.call("_unhandled_key_input", _key(KEY_ESCAPE))
|
||||
_expect(not _panel.visible and not bool(_main.get("_management_panel_open")), "Escape closes business inspector and restores full map")
|
||||
|
||||
@@ -257,3 +297,30 @@ func _finish() -> void:
|
||||
_main.queue_free()
|
||||
print("Business management UI: %d checks, %d failures" % [_checks, _failures])
|
||||
quit(1 if _failures > 0 else 0)
|
||||
|
||||
|
||||
func _test_customer_counts() -> void:
|
||||
# Controlled multi-person read-model fixture; no simulated time advances.
|
||||
var saved: Dictionary = _runtime.facility_service.create_snapshot()
|
||||
var room: FacilityInstance = _runtime.facility_service.get_instance(_rooms[1])
|
||||
room.active_services.clear()
|
||||
room.customer_capacity = 3
|
||||
var group := ServiceInstance.new().configure(&"group", &"group_request", room.instance_id, _clock.absolute_minute, 60, [&"group_a", &"group_b"], [])
|
||||
room.active_services[&"group"] = group
|
||||
var request := ServiceRequest.new().configure(&"waiting_group", room.instance_id, [&"waiting_a", &"waiting_b", &"waiting_c"], &"default", _clock.absolute_minute)
|
||||
_expect(_runtime.facility_service.enqueue_request(request).is_success(), "queue a three-person request for the occupancy read model")
|
||||
var row := _row(room.instance_id)
|
||||
_expect(row[&"active_count"] == 1 and row[&"active_customer_count"] == 2, "one grouped service reports two users separately from service count")
|
||||
_expect(row[&"queued_count"] == 1 and row[&"queued_customer_count"] == 3, "one queued request reports three waiting people")
|
||||
_panel.refresh()
|
||||
_choose(_panel.facility_option, room.instance_id)
|
||||
_expect("待ち 3人 / 利用中 2人" in _panel.facility_status_label.text and "上限 3人" in _panel.facility_status_label.text, "business screen shows people and explicit capacity")
|
||||
room.customer_capacity = -1
|
||||
_panel.refresh()
|
||||
_expect("上限 未設定" in _panel.facility_status_label.text, "unset customer limit is never replaced by generic capacity")
|
||||
room.active_services.clear()
|
||||
room.customer_capacity = 0
|
||||
_panel.refresh()
|
||||
_expect("利用中 0人" in _panel.facility_status_label.text and "上限 0人" in _panel.facility_status_label.text, "zero limit remains distinct from an unspecified limit")
|
||||
_expect(_runtime.facility_service.restore_snapshot(saved), "discard controlled occupancy fixture without changing later gameplay tests")
|
||||
_panel.refresh()
|
||||
|
||||
Reference in New Issue
Block a user