Clarify restart-safe batches and scripted UI handler tests

Address Nikola's batching and UI-handler feedback on PR #132. Preserve existing false-positive guards and defer the unconfirmed IsHandled policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f841a18b-535a-498e-96f2-f279b5378da5
This commit is contained in:
wenjiefan 2026-09-14 09:29:35 +02:00
parent 35d0966a8d
commit 0561b12c96
7 changed files with 155 additions and 46 deletions

View file

@ -13,7 +13,6 @@ codeunit 50401 "Test UI Handler Proof Bad"
Page.RunModal(Page::"Customer Card", Customer);
// This only proves a value assigned before the action stayed true.
Assert.IsTrue(ActionSucceeded, 'The customer card action failed.');
end;
@ -51,6 +50,32 @@ codeunit 50401 "Test UI Handler Proof Bad"
Page.RunModal(Page::"Customer Card", Customer);
end;
[Test]
[HandlerFunctions('ConfirmHandler,PostMessageHandler')]
procedure ConfirmPostingAndShowMessage()
begin
Assert.IsTrue(RunPostingThatConfirmsAndMessages(), 'The posting confirmation was declined.');
end;
local procedure RunPostingThatConfirmsAndMessages(): Boolean
begin
if not Confirm('Post this document?', false) then
exit(false);
Message('Posting completed.');
exit(true);
end;
[ConfirmHandler]
procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)
begin
Reply := true;
end;
[MessageHandler]
procedure PostMessageHandler(MessageText: Text[1024])
begin
end;
[ModalPageHandler]
procedure CustomerCardHandler(var CustomerCard: TestPage "Customer Card")
begin