Skip to content

Commit

Permalink
AI Test Toolkit: Remove the hard checks on the UI. Instead, we rely o…
Browse files Browse the repository at this point in the history
…n Installation code (#2024)

<!-- 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 -->
Remove the hard checks on the UI for OnPrem or  (SaaS and sandbox).
Instead, we rely on Installation code to check this.

#### 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#548709](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/548709)
  • Loading branch information
t-prda authored Sep 12, 2024
1 parent 8a8b8da commit de8fcb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
10 changes: 1 addition & 9 deletions src/Tools/AI Test Toolkit/src/AITCommandLineCard.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace System.TestTools.AITestToolkit;

using System.Environment;
using System.Telemetry;
using System.TestTools.TestRunner;
using System.Utilities;
Expand Down Expand Up @@ -129,7 +128,6 @@ page 149042 "AIT CommandLine Card"
{
action(RunSuite)
{
Enabled = EnableActions;
Caption = 'Run Suite';
Image = Start;
ToolTip = 'Starts running the AI test suite.';
Expand All @@ -141,7 +139,6 @@ page 149042 "AIT CommandLine Card"
}
action(RunNextTest)
{
Enabled = EnableActions;
Caption = 'Run Next Test';
Image = TestReport;
ToolTip = 'Starts running the next test in the AI test suite.';
Expand All @@ -153,7 +150,6 @@ page 149042 "AIT CommandLine Card"
}
action(ResetTestSuite)
{
Enabled = EnableActions;
Caption = 'Reset Test Suite';
Image = Restore;
ToolTip = 'Resets the test method lines status to run them again.';
Expand Down Expand Up @@ -208,18 +204,14 @@ page 149042 "AIT CommandLine Card"

trigger OnOpenPage()
var
EnvironmentInformation: Codeunit "Environment Information";
FeatureTelemetry: Codeunit "Feature Telemetry";
AITTestSuiteMgt: Codeunit "AIT Test Suite Mgt.";
begin
EnableActions := (EnvironmentInformation.IsSaaS() and EnvironmentInformation.IsSandbox()) or EnvironmentInformation.IsOnPrem();
if EnableActions then
FeatureTelemetry.LogUptake('0000NF0', AITTestSuiteMgt.GetFeatureName(), Enum::"Feature Uptake Status"::Discovered);
FeatureTelemetry.LogUptake('0000NF0', AITTestSuiteMgt.GetFeatureName(), Enum::"Feature Uptake Status"::Discovered);
end;

var
CannotFindAITSuiteErr: Label 'The specified Test Suite with code %1 cannot be found.', Comment = '%1 = Test Suite id.';
EnableActions: Boolean;
AITCode: Code[100];
NoOfPendingTests: Integer;
InputDataset: Text;
Expand Down
9 changes: 2 additions & 7 deletions src/Tools/AI Test Toolkit/src/TestSuite/AITTestSuite.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace System.TestTools.AITestToolkit;

using System.Environment;
using System.Telemetry;
using System.TestTools.TestRunner;

Expand Down Expand Up @@ -145,7 +144,7 @@ page 149031 "AIT Test Suite"
{
action(Start)
{
Enabled = (EnableActions and (Rec.Status <> Rec.Status::Running));
Enabled = Rec.Status <> Rec.Status::Running;
Caption = 'Start';
Image = Start;
ToolTip = 'Starts running the AI Test Suite.';
Expand Down Expand Up @@ -267,7 +266,6 @@ page 149031 "AIT Test Suite"

var
AITTestSuiteMgt: Codeunit "AIT Test Suite Mgt.";
EnableActions: Boolean;
AvgTimeDuration: Duration;
AvgTokensConsumed: Integer;
TotalDuration: Duration;
Expand All @@ -276,12 +274,9 @@ page 149031 "AIT Test Suite"

trigger OnOpenPage()
var
EnvironmentInformation: Codeunit "Environment Information";
FeatureTelemetry: Codeunit "Feature Telemetry";
begin
EnableActions := (EnvironmentInformation.IsSaaS() and EnvironmentInformation.IsSandbox()) or EnvironmentInformation.IsOnPrem();
if EnableActions then
FeatureTelemetry.LogUptake('0000NEV', AITTestSuiteMgt.GetFeatureName(), Enum::"Feature Uptake Status"::Discovered);
FeatureTelemetry.LogUptake('0000NEV', AITTestSuiteMgt.GetFeatureName(), Enum::"Feature Uptake Status"::Discovered);
end;

trigger OnNewRecord(BelowxRec: Boolean)
Expand Down

0 comments on commit de8fcb5

Please sign in to comment.