Skip to content

Commit

Permalink
Merge pull request #3603 from Ginger-Automation/Beta/BugFix/D40078_D4…
Browse files Browse the repository at this point in the history
…0077_VRTFixes

D40077_D40078_D40079_VRT Related Fixes
  • Loading branch information
Maheshkale447 authored Apr 11, 2024
2 parents 2ed1693 + e2e592f commit e4ba381
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public VRTComparePage(GingerCore.Actions.ActVisualTesting mAct)

xBaselineImageRadioButton.Init(typeof(VRTAnalyzer.eBaselineImageBy), xBaselineImageRadioButtonPnl, mAct.GetOrCreateInputParam(VRTAnalyzer.BaselineImage, VRTAnalyzer.eBaselineImageBy.ActiveWindow.ToString()), BaselineImageButton_Clicked);

VRTCurrentBaselineImagePathTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(VRTAnalyzer.VRTSavedBaseImageFilenameString), true, true, UCValueExpression.eBrowserType.File, "*.png;", BaseLineFileSelected_Click);
VRTCurrentBaselineImagePathTxtBox.Init(Context.GetAsContext(mAct.Context), mAct.GetOrCreateInputParam(VRTAnalyzer.VRTSavedBaseImageFilenameString), true, true, UCValueExpression.eBrowserType.File, "png", BaseLineFileSelected_Click);
WeakEventManager<TextBoxBase, TextChangedEventArgs>.AddHandler(source: VRTCurrentBaselineImagePathTxtBox.ValueTextBox, eventName: nameof(TextBoxBase.TextChanged), handler: ValueTextBox_TextChanged);
UpdateBaseLineImage();

Expand Down Expand Up @@ -109,6 +109,8 @@ public void InitLayout()
visualCompareAnalyzerIntegration.OnVisualTestingEvent(VisualTestingEventArgs.eEventType.SetTargetSectionVisibility, eVisualTestingVisibility.Collapsed);
visualCompareAnalyzerIntegration.OnVisualTestingEvent(VisualTestingEventArgs.eEventType.SetResultsSectionVisibility, eVisualTestingVisibility.Collapsed);
xVRTNote.Visibility = Visibility.Visible;
xCreateBaseline.Visibility = Visibility.Visible;
xCreateBaselineCheckbox.Visibility = Visibility.Visible;
switch (vrtAction)
{
case VRTAnalyzer.eVRTAction.Start:
Expand Down Expand Up @@ -335,7 +337,7 @@ private void UpdateBaseLineImage()
b = GetFreeBitmapCopy(FileName);
}
// send with null bitmap will show image not found
ScreenShotViewPage p = new ScreenShotViewPage("Baseline Image", b);
ScreenShotViewPage p = new ScreenShotViewPage("Preview Image", b);
VRTBaseImageFrame.ClearAndSetContent(p);
}

Expand Down
11 changes: 9 additions & 2 deletions Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ private void StartVRT()
}
private void TrackVRT()
{
if (!vrt.IsStarted)

if (vrt == null || !vrt.IsStarted)
{
mAct.Error = "VRT is not Started";
mAct.ExInfo = "You require to add VRT Start Action one step before.";
mAct.ExInfo = "Please include a VRT Start Action one step before the current one, if it has not been done already, and ensure that it runs before the current action.";
return;
}
try
Expand Down Expand Up @@ -399,6 +400,12 @@ private void StopVRT()
{
try
{
if (vrt == null || !vrt.IsStarted)
{
mAct.Error = "VRT is not Started";
mAct.ExInfo = "Please include a VRT Start Action one step before the current one, if it has not been done already, and ensure that it runs before the current action..";
return;
}
if (vrt.IsStarted)
{
vrt.Stop().GetAwaiter().GetResult();
Expand Down

0 comments on commit e4ba381

Please sign in to comment.