Skip to content

Commit

Permalink
[AI Test Tool] Improve compare page (#1927)
Browse files Browse the repository at this point in the history
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
### Summary <!-- Provide a general summary of your changes -->
This PR adds some improvements to the compare page, specifically:
1. Introduce new page that shows entire history of runs
1. Add capability to view by tag or version
1. Allow filtering results to specific test lines
1. Improve the tool tips, captions and variable names. Delete unused
fields and pages
1. Introduce new page for viewing test input/output and comparing
1. Add missing objects to permission sets

### Screenshots UI
#### Run history page, view by version:

![image](https://github.com/user-attachments/assets/f8085da0-8d00-4918-9073-389a0d9953fe)

#### Run history page, view by tag:

![image](https://github.com/user-attachments/assets/f436c771-9db5-4f5e-b601-5096ea25effe)

#### Run history page, filter history to specific lines:

![image](https://github.com/user-attachments/assets/00426d3c-87d4-4acf-b259-66bb6d2e4da3)

#### Compare test data

![image](https://github.com/user-attachments/assets/8f5c4370-9e20-4d7b-b737-85d6ea0d951c)

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#541857](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/541857/)
  • Loading branch information
stkillen authored Nov 8, 2024
1 parent 936bb22 commit 23d24db
Show file tree
Hide file tree
Showing 23 changed files with 877 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ permissionset 149033 "AI Test Toolkit - Read"

IncludedPermissionSets = "AI Test Toolkit - Obj";

Permissions = tabledata "AIT Test Suite" = R,
Permissions = tabledata "AIT Run History" = R,
tabledata "AIT Test Suite" = R,
tabledata "AIT Test Method Line" = R,
tabledata "AIT Log Entry" = R;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ permissionset 149034 "AI Test Toolkit - View"

IncludedPermissionSets = "AI Test Toolkit - Read";

Permissions = tabledata "AIT Test Suite" = IMD,
Permissions = tabledata "AIT Run History" = IMD,
tabledata "AIT Test Suite" = IMD,
tabledata "AIT Test Method Line" = IMD,
tabledata "AIT Log Entry" = IMD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,29 @@ permissionset 149031 "AI Test Toolkit - Obj"
Assignable = false;
Access = Public;

Permissions = table "AIT Test Suite" = X,
Permissions = table "AIT Run History" = X,
table "AIT Test Suite" = X,
table "AIT Test Method Line" = X,
table "AIT Log Entry" = X,
codeunit "AIT Test Suite Mgt." = X,
codeunit "AIT AL Test Suite Mgt" = X,
codeunit "AIT Install" = X,
codeunit "AIT Log Entry" = X,
codeunit "AIT Test Data" = X,
codeunit "AIT Test Suite Mgt." = X,
codeunit "AIT Test Run Iteration" = X,
codeunit "AIT Test Context" = X,
codeunit "AIT Test Context Impl." = X,
codeunit "AIT Run History" = X,
xmlport "AIT Test Suite Import/Export" = X,
page "AIT CommandLine Card" = X,
page "AIT Test Data" = X,
page "AIT Test Data Compare" = X,
page "AIT Batch Run Dialog" = X,
page "AIT Test Method Lines" = X,
page "AIT Test Method Lines Compare" = X,
page "AIT Test Method Lines Lookup" = X,
page "AIT Log Entries" = X,
page "AIT Log Entry API" = X,
page "AIT Test Suite" = X,
page "AIT Test Suite List" = X;
page "AIT Test Suite List" = X,
page "AIT Run History" = X;
}
18 changes: 15 additions & 3 deletions src/Tools/AI Test Toolkit/src/Logs/AITLogEntries.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ page 149033 "AIT Log Entries"

trigger OnDrillDown()
begin
Message(Rec.GetInputBlob());
Page.Run(Page::"AIT Test Data Compare", Rec);
end;
}
field("Output Text"; OutputText)
Expand All @@ -98,7 +98,7 @@ page 149033 "AIT Log Entries"

trigger OnDrillDown()
begin
Message(Rec.GetOutputBlob());
Page.Run(Page::"AIT Test Data Compare", Rec);
end;
}
field("Tokens Consumed"; Rec."Tokens Consumed")
Expand Down Expand Up @@ -241,7 +241,17 @@ page 149033 "AIT Log Entries"
begin
AITALTestSuiteMgt.DownloadTestOutputFromLogToFile(Rec);
end;
}
action("View Test Data")
{
Caption = 'View Test Data';
Image = CompareCOA;
ToolTip = 'View Test Data.';

trigger OnAction()
begin
Page.Run(Page::"AIT Test Data Compare", Rec);
end;
}
}
area(Promoted)
Expand All @@ -266,6 +276,9 @@ page 149033 "AIT Log Entries"
actionref("Download Test Output_Promoted"; "Download Test Output")
{
}
actionref("View Test Data_Promoted"; "View Test Data")
{
}
}
}
}
Expand Down Expand Up @@ -317,7 +330,6 @@ page 149033 "AIT Log Entries"
begin
InputText := '';
OutputText := '';

if Rec.Sensitive and not ShowSensitiveData then begin
Rec.CalcFields("Input Data", "Output Data");
if Rec."Input Data".Length > 0 then
Expand Down
16 changes: 15 additions & 1 deletion src/Tools/AI Test Toolkit/src/Logs/AITLogEntry.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,25 @@ codeunit 149032 "AIT Log Entry"
procedure DrillDownFailedAITLogEntries(AITSuiteCode: Code[100]; LineNo: Integer; VersionNo: Integer)
var
AITLogEntries: Record "AIT Log Entry";
begin
AITLogEntries.SetRange(Version, VersionNo);
DrillDownFailedAITLogEntries(AITLogEntries, AITSuiteCode, LineNo);
end;

procedure DrillDownFailedAITLogEntries(AITSuiteCode: Code[100]; LineNo: Integer; Tag: Text[20])
var
AITLogEntries: Record "AIT Log Entry";
begin
AITLogEntries.SetRange(Tag, Tag);
DrillDownFailedAITLogEntries(AITLogEntries, AITSuiteCode, LineNo);
end;

local procedure DrillDownFailedAITLogEntries(var AITLogEntries: Record "AIT Log Entry"; AITSuiteCode: Code[100]; LineNo: Integer)
var
AITLogEntry: Page "AIT Log Entries";
begin
AITLogEntries.SetFilterForFailedTestProcedures();
AITLogEntries.SetRange("Test Suite Code", AITSuiteCode);
AITLogEntries.SetRange(Version, VersionNo);
if LineNo <> 0 then
AITLogEntries.SetRange("Test Method Line No.", LineNo);
AITLogEntry.SetTableView(AITLogEntries);
Expand Down
7 changes: 7 additions & 0 deletions src/Tools/AI Test Toolkit/src/Logs/AITLogEntry.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ table 149034 "AIT Log Entry"
DataClassification = SystemMetadata;
DrillDownPageId = "AIT Log Entries";
LookupPageId = "AIT Log Entries";
DataCaptionFields = "Codeunit Name", "Procedure Name", "Test Input Code";
Extensible = false;
Access = Internal;
ReplicateData = false;
Expand Down Expand Up @@ -176,6 +177,12 @@ table 149034 "AIT Log Entry"
IncludedFields = Status;
SumIndexFields = "Duration (ms)";
}
key(Key3; Tag)
{
}
key(Key4; Version)
{
}
}

trigger OnInsert()
Expand Down
40 changes: 40 additions & 0 deletions src/Tools/AI Test Toolkit/src/Logs/AITRunHistory.Codeunit.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.TestTools.AITestToolkit;

codeunit 149036 "AIT Run History"
{
Access = Internal;

procedure GetHistory(Code: Code[100]; LineNo: Integer; AITViewBy: Enum "AIT Run History - View By"; var TempAITRunHistory: Record "AIT Run History" temporary)
var
AITRunHistory: Record "AIT Run History";
SeenTags: List of [Text[20]];
begin
TempAITRunHistory.DeleteAll();
AITRunHistory.SetRange("Test Suite Code", Code);

if AITViewBy = AITViewBy::Version then
if AITRunHistory.FindSet() then
repeat
TempAITRunHistory.TransferFields(AITRunHistory);
TempAITRunHistory.Insert();
until AITRunHistory.Next() = 0;

if AITViewBy = AITViewBy::Tag then
if AITRunHistory.FindSet() then
repeat
if not SeenTags.Contains(AITRunHistory.Tag) then begin
TempAITRunHistory.TransferFields(AITRunHistory);
TempAITRunHistory.Insert();
end;
SeenTags.Add(AITRunHistory.Tag);
until AITRunHistory.Next() = 0;

if (LineNo <> 0) then
TempAITRunHistory.SetRange("Line No. Filter", LineNo)
end;
}
Loading

0 comments on commit 23d24db

Please sign in to comment.