2026-10-29 22:31:17 +02:00
|
|
|
|
extends RefCounted
|
|
|
|
|
|
## Exercise the same rendered buttons as a player. Wall-clock jumps only
|
|
|
|
|
|
## replace waiting; no direct invocation of task completion or ending selection.
|
|
|
|
|
|
var game: Node
|
|
|
|
|
|
var errors: Array[String] = []
|
|
|
|
|
|
var results: Array = []
|
|
|
|
|
|
var checks := 0
|
|
|
|
|
|
|
|
|
|
|
|
func check(ok: bool, message: String) -> void:
|
|
|
|
|
|
checks += 1
|
|
|
|
|
|
if not ok:
|
|
|
|
|
|
errors.append(message)
|
|
|
|
|
|
push_error("PHONE QA: " + message)
|
|
|
|
|
|
|
|
|
|
|
|
func click(id: String) -> void:
|
2026-10-30 01:03:42 +02:00
|
|
|
|
var gameplay := id in ["question", "cancel"]
|
|
|
|
|
|
for action in game.story.actions:
|
|
|
|
|
|
if action.id == id: gameplay = true
|
|
|
|
|
|
if gameplay: wait_for_speech()
|
2026-10-29 22:31:17 +02:00
|
|
|
|
var control: Button = game.action_button(id)
|
|
|
|
|
|
check(control != null, "Visible button: " + id)
|
|
|
|
|
|
if control != null:
|
|
|
|
|
|
check(not control.disabled, "Enabled button: " + id)
|
|
|
|
|
|
control.pressed.emit()
|
|
|
|
|
|
|
|
|
|
|
|
func at(second: float) -> void:
|
2026-10-30 01:03:42 +02:00
|
|
|
|
if second >= game.speech_until: game.voice.stop()
|
2026-10-29 22:31:17 +02:00
|
|
|
|
game.start_tick = Time.get_ticks_msec() - int(second * 1000.0)
|
|
|
|
|
|
game._process(0)
|
2026-10-30 01:03:42 +02:00
|
|
|
|
if second >= game.speech_until: game.voice.stop()
|
|
|
|
|
|
game.refresh_live()
|
|
|
|
|
|
|
|
|
|
|
|
func wait_for_speech() -> void:
|
|
|
|
|
|
for step in range(12):
|
|
|
|
|
|
if game.speech_finished() and game.events.is_empty(): return
|
|
|
|
|
|
var next: float = maxf(game.elapsed, game.speech_until) + 0.01
|
|
|
|
|
|
if not game.events.is_empty(): next = maxf(next, float(game.events[0].at) + 0.01)
|
|
|
|
|
|
at(next)
|
|
|
|
|
|
check(false, "Dialogue must finish before choosing")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
|
|
|
|
|
|
func perform(id: String) -> void:
|
|
|
|
|
|
click(id)
|
|
|
|
|
|
check(not game.busy.is_empty(), "Command accepted: " + id)
|
|
|
|
|
|
if not game.busy.is_empty():
|
|
|
|
|
|
at(game.reply_at + 0.02)
|
|
|
|
|
|
at(game.busy_end + 0.03)
|
|
|
|
|
|
|
|
|
|
|
|
func start(number: int, knowledge: int = 0) -> void:
|
|
|
|
|
|
game.show_test_menu()
|
|
|
|
|
|
var selection: OptionButton = null
|
|
|
|
|
|
var memories: OptionButton = null
|
|
|
|
|
|
for node in game.overlay.find_children("*", "OptionButton", true, false):
|
|
|
|
|
|
if node.has_meta("test_chapter"): selection = node
|
|
|
|
|
|
if node.has_meta("test_knowledge"): memories = node
|
|
|
|
|
|
check(selection != null and memories != null, "Test menu selectors")
|
|
|
|
|
|
selection.select(number - 1)
|
|
|
|
|
|
memories.select(knowledge)
|
|
|
|
|
|
click("test_start")
|
|
|
|
|
|
|
|
|
|
|
|
func render() -> void:
|
|
|
|
|
|
await game.get_tree().process_frame
|
|
|
|
|
|
await game.get_tree().process_frame
|
|
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
await RenderingServer.frame_post_draw
|
|
|
|
|
|
|
|
|
|
|
|
func capture(name: String) -> void:
|
2026-10-30 01:38:31 +02:00
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
await game.get_tree().create_timer(0.42).timeout
|
2026-10-29 22:31:17 +02:00
|
|
|
|
await render()
|
|
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
game.get_viewport().get_texture().get_image().save_png(directory().path_join(name + ".png"))
|
|
|
|
|
|
|
|
|
|
|
|
func directory() -> String:
|
|
|
|
|
|
return OS.get_executable_path().get_base_dir().path_join("captures") if OS.has_feature("template") else ProjectSettings.globalize_path("res://../qa")
|
|
|
|
|
|
|
|
|
|
|
|
func finish(expected: String) -> void:
|
|
|
|
|
|
at(90.1)
|
|
|
|
|
|
check(game.impacted and not game.running, "Strike finishes")
|
|
|
|
|
|
check(game.busy.is_empty() and game.events.is_empty(), "Strike clears pending work")
|
|
|
|
|
|
check(not game.voice.playing, "Strike cuts dialogue")
|
|
|
|
|
|
check(game.outcome == expected, "Expected " + expected + ", got " + game.outcome)
|
|
|
|
|
|
results.append({"chapter": game.chapter, "outcome": game.outcome, "facts": game.facts.keys()})
|
|
|
|
|
|
game.show_ending()
|
|
|
|
|
|
|
|
|
|
|
|
func realtime_check() -> void:
|
|
|
|
|
|
# Opt-in, genuinely wait for the complete prologue and production transition.
|
|
|
|
|
|
start(1)
|
|
|
|
|
|
game.qa_mode = false
|
|
|
|
|
|
var began := Time.get_ticks_msec()
|
|
|
|
|
|
for step in range(3):
|
|
|
|
|
|
await game.get_tree().create_timer(30.0).timeout
|
|
|
|
|
|
print("PHONE_REALTIME elapsed=", (Time.get_ticks_msec() - began) / 1000.0)
|
|
|
|
|
|
await game.get_tree().create_timer(9.0).timeout
|
|
|
|
|
|
check(game.impacted and not game.running, "Real 90-second strike")
|
|
|
|
|
|
for beat in game.story.intro:
|
|
|
|
|
|
check(beat.line in game.heard, "Real prologue " + str(beat.line))
|
|
|
|
|
|
check("after_call" in game.heard, "Production post-impact reply")
|
|
|
|
|
|
check(game.action_button("next") != null, "Production ending overlay")
|
|
|
|
|
|
await capture("phone-real-ending")
|
|
|
|
|
|
click("next")
|
2026-10-30 01:38:31 +02:00
|
|
|
|
while game.dialing: await game.get_tree().create_timer(0.1).timeout
|
2026-10-29 22:31:17 +02:00
|
|
|
|
await game.get_tree().create_timer(5.0).timeout
|
|
|
|
|
|
check(game.chapter == 2 and game.running, "Production redial")
|
|
|
|
|
|
check("greeting" in game.heard and "call_02_k" in game.heard, "Production second opening")
|
2026-10-30 01:03:42 +02:00
|
|
|
|
check(game.action_button("keys_search").disabled, "Real audio keeps early answers disabled")
|
|
|
|
|
|
for frame in range(100):
|
|
|
|
|
|
if game.can_respond(): break
|
|
|
|
|
|
await game.get_tree().create_timer(0.2).timeout
|
|
|
|
|
|
check(game.can_respond() and not game.action_button("keys_search").disabled, "Real audio completion unlocks answers")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
game.qa_mode = true
|
|
|
|
|
|
start(10, 2)
|
|
|
|
|
|
for id in ["keys_fast", "lamp_fast", "safe", "front", "side_open", "phone_shelf"]: perform(id)
|
|
|
|
|
|
game.qa_mode = false
|
|
|
|
|
|
at(90.1)
|
|
|
|
|
|
await game.get_tree().create_timer(8.0).timeout
|
|
|
|
|
|
check(game.outcome == "connected" and "after_alive" in game.heard, "Production mother reply after impact")
|
|
|
|
|
|
check(game.action_button("next") != null, "Production connected ending overlay")
|
|
|
|
|
|
game.qa_mode = true
|
|
|
|
|
|
print("PHONE_REALTIME complete")
|
|
|
|
|
|
|
|
|
|
|
|
func run(target: Node) -> void:
|
|
|
|
|
|
game = target
|
|
|
|
|
|
DirAccess.make_dir_recursive_absolute(directory())
|
|
|
|
|
|
check(game.story.chapters.size() == 10, "Ten chapters")
|
2026-10-30 01:03:42 +02:00
|
|
|
|
check(game.story.lines.size() == 110, "All 110 spoken lines")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
for id in game.story.lines:
|
|
|
|
|
|
check(game.voice_stream(id) != null and game.voice_length(id) > 0.1, "Playable audio " + id)
|
2026-10-30 00:23:30 +02:00
|
|
|
|
var voices: Dictionary = JSON.parse_string(FileAccess.get_file_as_string("res://data/voice_manifest.json"))
|
|
|
|
|
|
var jessica_count := 0
|
2026-10-30 00:43:57 +02:00
|
|
|
|
var carol_count := 0
|
2026-10-30 00:23:30 +02:00
|
|
|
|
for id in game.story.lines:
|
|
|
|
|
|
if game.story.lines[id].speaker == "Катя":
|
|
|
|
|
|
check(voices[id].provider == "ElevenLabs" and voices[id].voice_id == "cgSgspJ2msm6clMCkdW9", "Jessica assigned: " + id)
|
|
|
|
|
|
jessica_count += 1
|
|
|
|
|
|
else:
|
2026-10-30 00:43:57 +02:00
|
|
|
|
check(voices[id].provider == "ElevenLabs" and voices[id].voice_id == "5u41aNhyCU6hXOcjPPv0", "Carol assigned: " + id)
|
|
|
|
|
|
carol_count += 1
|
2026-10-30 01:03:42 +02:00
|
|
|
|
check(jessica_count == 52, "All 52 Katya lines use Jessica")
|
|
|
|
|
|
check(carol_count == 58, "All 58 mother lines use Carol")
|
2026-10-30 00:43:57 +02:00
|
|
|
|
check(game.voice_length("greeting") <= game.story.intro[0].at, "Greeting fits before prologue")
|
|
|
|
|
|
check(45 + game.voice_length("power") <= 51, "Blackout reaction fits before conversation resumes")
|
|
|
|
|
|
check(85 + game.voice_length("hum") <= 90, "Hum reaction fits before strike")
|
2026-10-30 00:23:30 +02:00
|
|
|
|
for index in range(game.story.intro.size()):
|
|
|
|
|
|
var beat: Dictionary = game.story.intro[index]
|
|
|
|
|
|
var next_at: float = game.story.intro[index + 1].at if index + 1 < game.story.intro.size() else 85.0
|
2026-10-30 00:43:57 +02:00
|
|
|
|
if float(beat.at) < 45: next_at = minf(next_at, 45)
|
2026-10-30 00:23:30 +02:00
|
|
|
|
check(float(beat.at) + game.voice_length(beat.line) <= next_at, "Intro line fits before next cue: " + str(beat.line))
|
2026-10-29 22:31:17 +02:00
|
|
|
|
await capture("phone-menu")
|
2026-10-30 00:43:57 +02:00
|
|
|
|
click("settings")
|
|
|
|
|
|
await capture("phone-credits")
|
|
|
|
|
|
click("back_menu")
|
2026-10-30 01:38:31 +02:00
|
|
|
|
game.dial_call(1,true,0,true)
|
|
|
|
|
|
check(game.dialing and not game.running, "Dial animation precedes the 90-second clock")
|
|
|
|
|
|
check(game.stage.mother_status.text == "Входящий звонок", "Mother sees incoming daughter call")
|
|
|
|
|
|
await game.get_tree().create_timer(0.55).timeout
|
|
|
|
|
|
await capture("phone-dialing")
|
|
|
|
|
|
await game.get_tree().create_timer(1.9 if DisplayServer.get_name() == "headless" else 1.5).timeout
|
|
|
|
|
|
check(game.running and not game.dialing and game.elapsed < 1.0, "Connection starts a fresh full attempt")
|
|
|
|
|
|
check("greeting" in game.heard, "Mother answers after connection")
|
|
|
|
|
|
game.stage.update(1.0)
|
|
|
|
|
|
check(game.stage.purple_level > game.stage.pink_level, "Mother lights the violet background")
|
|
|
|
|
|
await capture("phone-mother-voice")
|
|
|
|
|
|
at(4.0)
|
|
|
|
|
|
game.stage.update(1.0)
|
|
|
|
|
|
check(game.stage.pink_level > game.stage.purple_level, "Katya lights the pink background")
|
|
|
|
|
|
await capture("phone-katya-voice")
|
2026-10-30 01:03:42 +02:00
|
|
|
|
start(2)
|
|
|
|
|
|
var blocked: Button = game.action_button("keys_search")
|
|
|
|
|
|
check(blocked != null and blocked.disabled, "Choices visible but disabled during greeting")
|
|
|
|
|
|
await capture("phone-locked-answers")
|
|
|
|
|
|
blocked.pressed.emit()
|
|
|
|
|
|
game.choose_action("keys_search")
|
|
|
|
|
|
check(game.busy.is_empty() and game.heard == ["greeting"], "Early clicks cannot cut off a speaker")
|
|
|
|
|
|
at(game.speech_until - 0.02)
|
|
|
|
|
|
check(game.action_button("keys_search").disabled, "Still blocked before audio end")
|
|
|
|
|
|
wait_for_speech()
|
|
|
|
|
|
check(not game.action_button("keys_search").disabled, "Choices enabled after complete opening exchange")
|
2026-10-30 01:38:31 +02:00
|
|
|
|
await capture("phone-answer-cloud")
|
|
|
|
|
|
for answer in game.command_list.get_children():
|
|
|
|
|
|
if answer is Button: check(not answer.text.ends_with(" с"), "Answer has no duration: " + answer.text)
|
|
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
var tag: Button = game.action_button("keys_search")
|
|
|
|
|
|
# Keep the user's physical cursor from cancelling the timed synthetic hover.
|
|
|
|
|
|
# Click dispatch is still checked through the real viewport just below.
|
|
|
|
|
|
game.command_list.mouse_filter=Control.MOUSE_FILTER_IGNORE
|
|
|
|
|
|
await render()
|
|
|
|
|
|
game.command_list.hovered=null
|
|
|
|
|
|
game.command_list.pointer_inside=false
|
|
|
|
|
|
var previous: Vector2 = tag.position
|
|
|
|
|
|
await game.get_tree().create_timer(0.65).timeout
|
|
|
|
|
|
check(tag.position.distance_to(previous)>0.1, "Answer tags drift gently")
|
|
|
|
|
|
var pointer := InputEventMouseMotion.new()
|
|
|
|
|
|
pointer.position = tag.position+tag.size/2
|
|
|
|
|
|
game.command_list._gui_input(pointer)
|
|
|
|
|
|
await game.get_tree().create_timer(0.45).timeout
|
|
|
|
|
|
check(tag.scale.x>1.08, "Hovered answer grows")
|
|
|
|
|
|
var held: Vector2 = tag.position
|
|
|
|
|
|
await game.get_tree().create_timer(0.25).timeout
|
|
|
|
|
|
check(tag.position.distance_to(held)<0.1, "Hovered answer holds still for clicking")
|
|
|
|
|
|
await capture("phone-answer-hover")
|
|
|
|
|
|
pointer = InputEventMouseMotion.new()
|
|
|
|
|
|
pointer.position = Vector2(-20,-20)
|
|
|
|
|
|
game.command_list._gui_input(pointer)
|
|
|
|
|
|
await game.get_tree().create_timer(0.5).timeout
|
|
|
|
|
|
check(tag.scale.x<1.08, "Answer returns to its depth after hover")
|
|
|
|
|
|
game.command_list.mouse_filter=Control.MOUSE_FILTER_STOP
|
|
|
|
|
|
await render()
|
|
|
|
|
|
var press := InputEventMouseButton.new()
|
|
|
|
|
|
press.button_index=MOUSE_BUTTON_LEFT
|
|
|
|
|
|
press.position=tag.get_global_rect().get_center()
|
|
|
|
|
|
press.pressed=true
|
|
|
|
|
|
game.get_viewport().push_input(press,true)
|
|
|
|
|
|
var release := InputEventMouseButton.new()
|
|
|
|
|
|
release.button_index=MOUSE_BUTTON_LEFT
|
|
|
|
|
|
release.position=press.position
|
|
|
|
|
|
release.pressed=false
|
|
|
|
|
|
game.get_viewport().push_input(release,true)
|
|
|
|
|
|
check(game.busy.get("id","")=="keys_search", "Mouse selects the visible floating answer")
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
wait_for_speech()
|
|
|
|
|
|
await render()
|
|
|
|
|
|
check(game.stage.memory_button.size.x >= 100 and game.stage.menu_button.size.x >= 80, "Header controls stay readable")
|
|
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
var original_size := DisplayServer.window_get_size()
|
|
|
|
|
|
DisplayServer.window_set_size(Vector2i(1366,768))
|
|
|
|
|
|
await capture("phone-wide-layout")
|
|
|
|
|
|
check(game.ui.get_global_rect().encloses(game.stage.mother_phone.get_global_rect()), "Mother phone fits wide viewport")
|
|
|
|
|
|
check(game.ui.get_global_rect().encloses(game.stage.smartphone.get_global_rect()), "Katya phone fits wide viewport")
|
|
|
|
|
|
DisplayServer.window_set_size(original_size)
|
|
|
|
|
|
await render()
|
|
|
|
|
|
var cloud_rect: Rect2 = game.stage.choice_scroll.get_global_rect()
|
|
|
|
|
|
check(cloud_rect.position.y > game.transcript_scroll.get_global_rect().position.y, "Answers below central dialogue")
|
|
|
|
|
|
for child in game.command_list.get_children():
|
|
|
|
|
|
if child is Button:
|
|
|
|
|
|
check(child.get_global_rect().position.x >= cloud_rect.position.x and child.get_global_rect().end.x <= cloud_rect.end.x + 1, "Answer fits cloud width: " + child.text)
|
|
|
|
|
|
click("memory")
|
|
|
|
|
|
check(game.action_button("close_memory") != null, "Notebook opens from call screen")
|
|
|
|
|
|
click("close_memory")
|
2026-10-30 01:03:42 +02:00
|
|
|
|
click("keys_search")
|
|
|
|
|
|
check(game.cancel_button.disabled, "Cancellation cannot interrupt the spoken request")
|
|
|
|
|
|
game.cancel_task()
|
|
|
|
|
|
check(not game.busy.is_empty(), "Direct cancel rejected while speaking")
|
|
|
|
|
|
at(game.reply_at + 0.01)
|
|
|
|
|
|
check(game.cancel_button.disabled, "Mother's answer cannot be interrupted")
|
|
|
|
|
|
at(game.busy_end + 0.12)
|
|
|
|
|
|
check(game.can_respond(), "Next choices enabled after response and task completion")
|
|
|
|
|
|
|
|
|
|
|
|
start(1)
|
|
|
|
|
|
check(game.soundscape.streams.size() == 16, "All ambience and foley assets loaded")
|
|
|
|
|
|
check(game.soundscape.beds.fridge.playing and game.soundscape.beds.tv.playing, "Powered room starts alive")
|
|
|
|
|
|
check(game.soundscape.duck_db <= -11.9, "Background ducks under spoken greeting")
|
|
|
|
|
|
game.soundscape.update_mix(0.5, false)
|
|
|
|
|
|
check(game.soundscape.duck_db > -11 and game.soundscape.duck_db < 0, "Background recovers gently after speech")
|
|
|
|
|
|
game.soundscape.dialogue_started(-40)
|
|
|
|
|
|
check(game.soundscape.duck_db <= -23.9, "Very quiet voices receive extra background attenuation")
|
|
|
|
|
|
game.soundscape.set_volume(0)
|
|
|
|
|
|
check(AudioServer.get_bus_volume_db(game.soundscape.scene_bus) <= -79, "Independent background mute")
|
|
|
|
|
|
game.soundscape.set_volume(0.75)
|
|
|
|
|
|
at(36.1)
|
|
|
|
|
|
check(game.soundscape.history.any(func(cue): return cue.id == "kettle"), "Kettle follows the shared call clock")
|
|
|
|
|
|
at(45.01)
|
|
|
|
|
|
check(not game.soundscape.beds.fridge.playing and not game.soundscape.beds.tv.playing, "Power cut silences appliances")
|
|
|
|
|
|
check(game.soundscape.beds.room.playing and game.soundscape.beds.line.playing, "Room and telephone survive power cut")
|
|
|
|
|
|
finish("flat")
|
|
|
|
|
|
check(not game.soundscape.active and game.soundscape.queue.is_empty(), "Strike stops room and all pending sounds")
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
perform("keys_search")
|
|
|
|
|
|
check(game.soundscape.history.any(func(cue): return cue.id == "keys"), "Key sound follows actual search")
|
|
|
|
|
|
click("lamp_search")
|
|
|
|
|
|
wait_for_speech()
|
|
|
|
|
|
click("cancel")
|
|
|
|
|
|
check(not game.soundscape.queue.any(func(cue): return cue.task), "Cancel discards pending action sounds")
|
2026-10-30 00:43:57 +02:00
|
|
|
|
# Every redial repeats the same external world, including the first call.
|
|
|
|
|
|
for number in range(1, 11):
|
|
|
|
|
|
start(number)
|
|
|
|
|
|
at(23.99)
|
|
|
|
|
|
check(not game.fired.has("alarm"), "No early siren: " + str(number))
|
|
|
|
|
|
at(24.01)
|
|
|
|
|
|
check(game.fired.get("alarm") == 24.0, "Same siren time: " + str(number))
|
2026-10-30 01:38:31 +02:00
|
|
|
|
check(game.siren.playing and game.siren.volume_db < -60, "Siren starts softly: " + str(number))
|
|
|
|
|
|
at(27)
|
|
|
|
|
|
check(game.siren.volume_db > -40 and game.siren.volume_db < -25, "Siren rises gradually: " + str(number))
|
|
|
|
|
|
at(30)
|
|
|
|
|
|
check(absf(game.siren.volume_db+23)<0.1, "Siren reaches quiet background level: " + str(number))
|
2026-10-30 00:43:57 +02:00
|
|
|
|
at(44.99)
|
|
|
|
|
|
check(not game.fired.has("power") and "темно" not in game.place_label.text, "Lights stay on until 45: " + str(number))
|
|
|
|
|
|
at(45.01)
|
|
|
|
|
|
check(game.fired.get("power") == 45.0 and "темно" in game.place_label.text, "Same visible blackout: " + str(number))
|
|
|
|
|
|
check("power" in game.heard, "Mother acknowledges blackout: " + str(number))
|
|
|
|
|
|
at(84.99)
|
|
|
|
|
|
check(not game.fired.has("hum"), "No early hum: " + str(number))
|
|
|
|
|
|
at(85.01)
|
|
|
|
|
|
check(game.fired.get("hum") == 85.0, "Same hum time: " + str(number))
|
|
|
|
|
|
at(89.99)
|
|
|
|
|
|
check(not game.impacted, "No early strike: " + str(number))
|
|
|
|
|
|
finish("flat")
|
|
|
|
|
|
check(game.fired.get("impact") == 90.0, "Same strike time: " + str(number))
|
|
|
|
|
|
start(1)
|
|
|
|
|
|
at(45.01)
|
|
|
|
|
|
await capture("phone-first-blackout")
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
at(45.01)
|
|
|
|
|
|
await capture("phone-second-blackout")
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
at(38)
|
|
|
|
|
|
click("keys_search")
|
|
|
|
|
|
at(45.01)
|
|
|
|
|
|
check(not game.busy.is_empty() and "power" not in game.heard, "Blackout does not interrupt an unrelated spoken task")
|
|
|
|
|
|
check(game.fired.get("power") == 45.0 and "темно" in game.place_label.text, "Busy task cannot postpone blackout")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
for number in range(1, 11):
|
|
|
|
|
|
start(number)
|
|
|
|
|
|
check(game.chapter == number and game.place == "flat" and game.items.is_empty(), "Fresh chapter " + str(number))
|
|
|
|
|
|
check(game.heard == ["greeting"], "Identical opening " + str(number))
|
|
|
|
|
|
if number == 1:
|
|
|
|
|
|
check(game.action_button("keys_search") == null, "Prologue has no commands")
|
2026-10-30 01:38:31 +02:00
|
|
|
|
check(game.clock_label.text.is_empty(), "Prologue hides time")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
for beat in game.story.intro: at(beat.at + 0.01)
|
2026-10-30 01:03:42 +02:00
|
|
|
|
check(game.heard.size() == 19 and "power" in game.heard, "Ordinary conversation and blackout acknowledgement")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
else:
|
|
|
|
|
|
var entry: Dictionary = game.story.chapters[number - 1]
|
|
|
|
|
|
var opening_at: float = game.events[0].at
|
|
|
|
|
|
var reply_time: float = game.events[1].at
|
|
|
|
|
|
check(opening_at >= game.voice_length("greeting"), "Greeting is not truncated")
|
|
|
|
|
|
at(opening_at + 0.01)
|
|
|
|
|
|
at(reply_time + 0.01)
|
|
|
|
|
|
check(entry.opening in game.heard and entry.reply in game.heard, "Unique opening " + str(number))
|
|
|
|
|
|
perform("question")
|
|
|
|
|
|
check(entry.question in game.heard and entry.answer in game.heard, "Unique exchange " + str(number))
|
|
|
|
|
|
at(85.01)
|
|
|
|
|
|
check(game.heard[-1] == "hum", "Hum before strike")
|
|
|
|
|
|
finish("flat")
|
|
|
|
|
|
await capture("phone-ending")
|
|
|
|
|
|
|
|
|
|
|
|
# Learn through real commands. Precise instructions require discoveries,
|
|
|
|
|
|
# rather than the chapter index or a hidden action.
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
check(game.action_button("safe") == null, "Safe requires remembered code")
|
|
|
|
|
|
game.choose_action("safe")
|
|
|
|
|
|
check(game.busy.is_empty(), "Hidden action rejected")
|
|
|
|
|
|
perform("keys_search")
|
|
|
|
|
|
check(game.facts.has("keys") and game.items.has("keys"), "Key discovery")
|
|
|
|
|
|
perform("lamp_search")
|
|
|
|
|
|
check(game.facts.has("lamp") and game.items.has("lamp"), "Lamp discovery")
|
|
|
|
|
|
finish("flat")
|
|
|
|
|
|
click("next")
|
|
|
|
|
|
check(game.chapter == 3 and game.facts.has("keys") and game.items.is_empty(), "Redial remembers knowledge only")
|
|
|
|
|
|
check(game.action_button("keys_fast") != null and game.action_button("keys_search") == null, "Shortcut replaces slow search")
|
|
|
|
|
|
|
|
|
|
|
|
start(4)
|
|
|
|
|
|
perform("mail_hint")
|
|
|
|
|
|
perform("read_mail")
|
|
|
|
|
|
check(game.facts.has("code"), "Code obtainable before blackout")
|
|
|
|
|
|
at(45.01)
|
|
|
|
|
|
check(game.action_button("read_mail") == null, "No laptop after blackout")
|
|
|
|
|
|
finish("flat")
|
|
|
|
|
|
click("next")
|
|
|
|
|
|
perform("safe")
|
|
|
|
|
|
check(game.items.has("spare") and game.facts.has("route"), "Code opens safe on next call")
|
|
|
|
|
|
|
|
|
|
|
|
start(4)
|
|
|
|
|
|
perform("mail_hint")
|
|
|
|
|
|
at(40)
|
|
|
|
|
|
click("read_mail")
|
|
|
|
|
|
at(46)
|
|
|
|
|
|
check(game.busy.is_empty() and not game.facts.has("code"), "Power cancels unfinished mail")
|
|
|
|
|
|
check("late_mail" in game.heard, "Power failure dialogue")
|
|
|
|
|
|
|
|
|
|
|
|
start(4, 2)
|
|
|
|
|
|
game.facts.erase("code")
|
|
|
|
|
|
at(28)
|
|
|
|
|
|
click("read_mail")
|
|
|
|
|
|
check(game.busy_end < 45, "Mail scheduled before blackout")
|
|
|
|
|
|
at(46)
|
|
|
|
|
|
check(game.facts.has("code"), "Late frame preserves pre-blackout completion")
|
|
|
|
|
|
|
|
|
|
|
|
start(5, 2)
|
|
|
|
|
|
perform("keys_fast")
|
|
|
|
|
|
click("front")
|
|
|
|
|
|
at(92)
|
|
|
|
|
|
check(game.outcome == "landing", "Late frame resolves movement before impact")
|
|
|
|
|
|
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
click("keys_search")
|
|
|
|
|
|
at(8)
|
|
|
|
|
|
click("cancel")
|
|
|
|
|
|
at(21)
|
|
|
|
|
|
check(not game.facts.has("keys") and not game.items.has("keys"), "Cancelled search grants nothing")
|
|
|
|
|
|
check(game.elapsed >= 21, "Cancellation never refunds time")
|
|
|
|
|
|
at(89)
|
|
|
|
|
|
click("keys_search")
|
|
|
|
|
|
finish("flat")
|
|
|
|
|
|
check(not game.items.has("keys"), "Impact rejects unfinished search")
|
|
|
|
|
|
|
|
|
|
|
|
start(3)
|
|
|
|
|
|
perform("inner")
|
|
|
|
|
|
finish("inner")
|
|
|
|
|
|
start(5)
|
|
|
|
|
|
perform("keys_search")
|
|
|
|
|
|
perform("front")
|
|
|
|
|
|
perform("stairs")
|
2026-10-30 01:03:42 +02:00
|
|
|
|
check(game.facts.has("stairs"), "Unlit intact stairs discovered")
|
|
|
|
|
|
check("целая" in game.story.facts.stairs and "завален" not in game.story.facts.stairs, "Stairwell is intact")
|
|
|
|
|
|
await capture("phone-dark-stairwell")
|
2026-10-29 22:31:17 +02:00
|
|
|
|
finish("landing")
|
|
|
|
|
|
|
|
|
|
|
|
# Full route with learned facts is feasible at normal production durations,
|
|
|
|
|
|
# including both speakers' complete audio lengths.
|
|
|
|
|
|
start(7, 2)
|
|
|
|
|
|
game.facts.erase("latch")
|
|
|
|
|
|
for id in ["keys_fast", "lamp_fast", "safe", "front", "side_try"]: perform(id)
|
|
|
|
|
|
check(game.facts.has("latch"), "Latch discovered from physical attempt")
|
|
|
|
|
|
finish("landing")
|
|
|
|
|
|
click("next")
|
|
|
|
|
|
for id in ["keys_fast", "lamp_fast", "safe", "front", "side_open"]: perform(id)
|
|
|
|
|
|
check(game.place == "alcove" and game.elapsed < 75, "Reach alcove in time")
|
|
|
|
|
|
finish("alcove")
|
|
|
|
|
|
|
|
|
|
|
|
start(8, 2)
|
|
|
|
|
|
game.facts.erase("signal")
|
|
|
|
|
|
for id in ["keys_fast", "lamp_fast", "safe", "front", "side_open", "phone_test"]: perform(id)
|
|
|
|
|
|
check(game.facts.has("signal"), "Signal location found")
|
|
|
|
|
|
perform("phone_shelf")
|
|
|
|
|
|
check(game.items.has("connected") and game.elapsed < 90, "Reach responsive ending through discovery")
|
|
|
|
|
|
var route_time: float = game.elapsed
|
|
|
|
|
|
await capture("phone-gameplay")
|
|
|
|
|
|
finish("connected")
|
|
|
|
|
|
await capture("phone-connected")
|
|
|
|
|
|
|
|
|
|
|
|
# A late frame cannot complete a task after the impact. Old callbacks and
|
|
|
|
|
|
# popup buttons cannot apply a task twice.
|
|
|
|
|
|
start(10, 2)
|
|
|
|
|
|
at(82)
|
|
|
|
|
|
click("safe")
|
|
|
|
|
|
at(92)
|
|
|
|
|
|
check(game.outcome == "flat" and not game.items.has("spare"), "Low-FPS deadline wins over pending safe")
|
|
|
|
|
|
game.choose_action("keys_fast")
|
|
|
|
|
|
check(game.busy.is_empty(), "Post-impact commands ignored")
|
|
|
|
|
|
|
|
|
|
|
|
var save_file := directory().path_join("phone-profile-test.cfg")
|
|
|
|
|
|
check(game.Profile.write_profile(save_file, {"code": true}, {"connected": true}, 10) == OK, "Profile writes")
|
|
|
|
|
|
var saved: Dictionary = game.Profile.read_profile(save_file, game.story.facts, game.story.endings)
|
|
|
|
|
|
check(saved.facts == {"code": true} and saved.endings == {"connected": true} and saved.loops == 10, "Profile disk roundtrip")
|
|
|
|
|
|
var cfg := ConfigFile.new()
|
|
|
|
|
|
cfg.set_value("save", "facts", {"code": 1, "unknown": true, "lamp": true})
|
|
|
|
|
|
cfg.set_value("save", "loops", -3)
|
|
|
|
|
|
cfg.save(save_file)
|
|
|
|
|
|
saved = game.Profile.read_profile(save_file, game.story.facts, game.story.endings)
|
|
|
|
|
|
check(saved.facts == {"lamp": true} and saved.loops == 0, "Invalid save data filtered")
|
2026-10-29 22:36:22 +02:00
|
|
|
|
# Notifications are an independent clock: four during the call, the fifth
|
|
|
|
|
|
# two seconds after the strike. Reading never pauses or cancels mom's task.
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
at(16.9)
|
|
|
|
|
|
check(game.notifications.is_empty(), "No early push")
|
|
|
|
|
|
at(17)
|
|
|
|
|
|
check(game.notifications.size() == 1 and game.unread == 1, "First push at 17 seconds")
|
|
|
|
|
|
check(game.notification_card.visible, "Push is visible")
|
2026-10-30 01:38:31 +02:00
|
|
|
|
await render()
|
|
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
check(game.stage.smartphone.display.get_global_rect().encloses(game.notification_card.get_global_rect()), "Push stays on Katya's smartphone")
|
2026-10-29 22:36:22 +02:00
|
|
|
|
click("dismiss_push")
|
|
|
|
|
|
check(not game.notification_card.visible and game.unread == 1, "Dismiss keeps message unread")
|
|
|
|
|
|
click("keys_search")
|
|
|
|
|
|
at(34)
|
|
|
|
|
|
check(game.notifications.size() == 2 and not game.busy.is_empty(), "Second push during mom task")
|
|
|
|
|
|
click("open_push")
|
|
|
|
|
|
check(game.viewing_messages and game.unread == 0, "Open push reads inbox")
|
|
|
|
|
|
at(40)
|
|
|
|
|
|
check(game.items.has("keys") and game.elapsed >= 40, "Mom task and clock continue while reading")
|
|
|
|
|
|
click("close_messages")
|
|
|
|
|
|
check(not game.viewing_messages and game.overlay == null, "Return to call")
|
|
|
|
|
|
at(56)
|
|
|
|
|
|
check(game.notifications.size() == 3, "Third push")
|
|
|
|
|
|
at(76)
|
|
|
|
|
|
check(game.notifications.size() == 4, "Fourth push")
|
|
|
|
|
|
check(game.notifications[3].text == "Ты читала новости? Там переговоры, походу скоро все закончится", "Exact fourth text")
|
|
|
|
|
|
await capture("phone-fourth-push")
|
|
|
|
|
|
at(90)
|
|
|
|
|
|
check(game.impacted and game.notifications.size() == 4, "No fifth message before impact")
|
|
|
|
|
|
at(91.9)
|
|
|
|
|
|
check(game.notifications.size() == 4, "Fifth push waits until after impact")
|
|
|
|
|
|
game.show_ending()
|
|
|
|
|
|
at(92)
|
|
|
|
|
|
check(game.notifications.size() == 5 and game.notification_card.visible, "Fifth push over ending screen")
|
|
|
|
|
|
check(game.notifications[4].text == "Кать в твой дом походу попали...", "Exact fifth text")
|
|
|
|
|
|
await capture("phone-after-impact-push")
|
2026-10-30 01:38:31 +02:00
|
|
|
|
if DisplayServer.get_name() != "headless":
|
|
|
|
|
|
check(game.notification_card.size.y < 300, "Toast stays compact across all five pushes")
|
2026-10-29 22:36:22 +02:00
|
|
|
|
click("open_push")
|
|
|
|
|
|
check(game.viewing_messages and game.notifications.size() == 5, "All messages readable after impact")
|
|
|
|
|
|
await capture("phone-inbox")
|
|
|
|
|
|
at(96)
|
|
|
|
|
|
check(game.notifications.size() == 5, "No duplicate messages")
|
|
|
|
|
|
click("close_messages")
|
|
|
|
|
|
click("next")
|
|
|
|
|
|
check(game.notifications.is_empty() and game.unread == 0 and not game.notification_card.visible, "Redial resets message history")
|
|
|
|
|
|
# Use the production delayed transition once: a reader who opens the final
|
|
|
|
|
|
# push must not have the inbox closed by the ending coroutine a moment later.
|
|
|
|
|
|
start(2)
|
|
|
|
|
|
game.qa_mode = false
|
|
|
|
|
|
at(90)
|
|
|
|
|
|
await game.get_tree().create_timer(2.2).timeout
|
|
|
|
|
|
check(game.notifications.size() == 5 and game.notification_card.visible, "Production post-impact push arrives")
|
|
|
|
|
|
click("open_push")
|
|
|
|
|
|
await game.get_tree().create_timer(8.0).timeout
|
|
|
|
|
|
check(game.viewing_messages and game.action_button("close_messages") != null, "Ending transition preserves open inbox")
|
|
|
|
|
|
click("close_messages")
|
|
|
|
|
|
check(game.action_button("next") != null, "Inbox returns to production ending")
|
|
|
|
|
|
game.qa_mode = true
|
2026-10-29 22:31:17 +02:00
|
|
|
|
if "--phone-real-time" in OS.get_cmdline_user_args():
|
|
|
|
|
|
await realtime_check()
|
|
|
|
|
|
var file := FileAccess.open(directory().path_join("phone-result.json"), FileAccess.WRITE)
|
|
|
|
|
|
file.store_string(JSON.stringify({"passed": errors.is_empty(), "checks": checks, "errors": errors, "routes": results, "full_route_seconds": route_time}, " "))
|
|
|
|
|
|
file.close()
|
|
|
|
|
|
print("PHONE_QA ", "PASS" if errors.is_empty() else "FAIL", " checks=", checks, " route=", route_time, " errors=", errors)
|
|
|
|
|
|
await render()
|
2026-10-30 01:03:42 +02:00
|
|
|
|
game.soundscape.stop()
|
|
|
|
|
|
for player in [game.voice, game.siren, game.effect, game.hum, game.notification_sound]:
|
2026-10-29 22:31:17 +02:00
|
|
|
|
player.stop()
|
|
|
|
|
|
player.stream = null
|
|
|
|
|
|
await game.get_tree().create_timer(0.1).timeout
|
|
|
|
|
|
var tree: SceneTree = game.get_tree()
|
|
|
|
|
|
game = null
|
|
|
|
|
|
tree.quit(0 if errors.is_empty() else 1)
|