Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions src/Tools/AI Test Toolkit/src/TestSuite/AITTestSuite.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ page 149031 "AIT Test Suite"
PageType = Document;
SourceTable = "AIT Test Suite";
Extensible = true;
SaveValues = true;
DataCaptionExpression = PageCaptionLbl + ' - ' + Format(Rec."Test Type") + ' (' + Format(Rec."Copilot Capability") + ') - ' + Rec."Code";
Comment thread
nikolakukrika marked this conversation as resolved.
UsageCategory = None;
UsageCategory = Administration;
AdditionalSearchTerms = 'AIT, AI Eval Tool, Eval Tool, AI Eval Suite, Eval Suite, Copilot, Copilot Eval, AI Test Tool, Test Tool, AI Test Suite, Test Suite, Copilot Test';

layout
{
Expand All @@ -27,8 +29,34 @@ page 149031 "AIT Test Suite"
Caption = 'AI Eval Suite';
Enabled = Rec.Status <> Rec.Status::Running;

field("Code"; Rec."Code")
field("Code"; CurrentSuiteCode)
{
Caption = 'Suite Code';
ToolTip = 'Specifies the currently selected AI Eval Suite.';

trigger OnLookup(var Text: Text): Boolean
var
AITTestSuite: Record "AIT Test Suite";
begin
AITTestSuite.Get(CurrentSuiteCode);
if not (Page.RunModal(Page::"AIT Test Suite List", AITTestSuite) in [Action::LookupOK, Action::Yes]) then
exit(false);

CurrentSuiteCode := AITTestSuite.Code;
ChangeTestSuite();
exit(true);
end;

trigger OnValidate()
begin
if IsNullGuid(Rec.SystemId) then begin
Rec.Code := CurrentSuiteCode;
Rec.Insert();
end;

ChangeTestSuite();
end;

}
field(Description; Rec.Description)
{
Expand Down Expand Up @@ -425,6 +453,7 @@ page 149031 "AIT Test Suite"

var
AITTestSuiteMgt: Codeunit "AIT Test Suite Mgt.";
CurrentSuiteCode: Code[10];
AvgTimeDuration: Duration;
AvgTokensConsumed: Integer;
TotalDuration: Duration;
Expand All @@ -439,6 +468,7 @@ page 149031 "AIT Test Suite"
FeatureTelemetry: Codeunit "Feature Telemetry";
begin
FeatureTelemetry.LogUptake('0000NEV', AITTestSuiteMgt.GetFeatureName(), Enum::"Feature Uptake Status"::Discovered);
SetCurrentTestSuite();
end;

trigger OnNewRecord(BelowxRec: Boolean)
Expand All @@ -452,6 +482,7 @@ page 149031 "AIT Test Suite"
TestSuiteMgt: Codeunit "Test Suite Mgt.";
begin
if Rec.Find() then;
CurrentSuiteCode := Rec.Code;
UpdateTotalDuration();
UpdateAverages();
Language := AITTestSuiteLanguage.GetLanguageDisplayName(Rec."Run Language ID");
Expand All @@ -478,4 +509,35 @@ page 149031 "AIT Test Suite"
else
AvgTokensConsumed := 0;
end;

local procedure SetCurrentTestSuite()
var
AITTestSuite: Record "AIT Test Suite";
begin
// If the page was opened with a specific record (e.g. from the list), use that record
if Rec.Code <> '' then begin
CurrentSuiteCode := Rec.Code;
exit;
end;

if CurrentSuiteCode <> '' then
if AITTestSuite.Get(CurrentSuiteCode) then
CurrentSuiteCode := AITTestSuite.Code
else
Clear(CurrentSuiteCode);

if CurrentSuiteCode = '' then begin
AITTestSuite.Copy(Rec);
AITTestSuite.FindFirst();
CurrentSuiteCode := AITTestSuite.Code;
end;

Rec.Get(CurrentSuiteCode);
end;

local procedure ChangeTestSuite()
begin
Rec.Get(CurrentSuiteCode);
CurrPage.Update(false);
end;
}
Loading