Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using Env parameters in VRT Config by use of Value Expressions #3642

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
27 changes: 17 additions & 10 deletions Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using GingerCore.Environments;
using GingerCoreNET.GeneralLib;
using System;
using System.Drawing;
Expand Down Expand Up @@ -45,19 +46,12 @@ public class VRTAnalyzer : IVisualAnalyzer
VisualRegressionTracker.VisualRegressionTracker vrt;
VisualRegressionTracker.Config config;

public VRTAnalyzer()
{
if (vrt == null)
{
CreateVRTConfig();
}
}

private void CreateVRTConfig()
{
ValueExpression VE = new ValueExpression(null, null);
ValueExpression VE = new ValueExpression(GetCurrentProjectEnvironment(), null);

config = new VisualRegressionTracker.Config
config = new Config
{
BranchName = VE.Calculate(WorkSpace.Instance.Solution.VRTConfiguration.BranchName),
Project = VE.Calculate(WorkSpace.Instance.Solution.VRTConfiguration.Project),
Expand All @@ -67,6 +61,19 @@ private void CreateVRTConfig()
};
}

private ProjEnvironment GetCurrentProjectEnvironment()
{
foreach (ProjEnvironment env in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<ProjEnvironment>())
{
if (env.Name.Equals(mDriver.GetEnvironment()))
{
return env;
}
}

return null;
}

public enum eVRTAction
{
[EnumValueDescription("Start Test")]
Expand Down Expand Up @@ -188,7 +195,7 @@ private void StartVRT()
{
}

}
}
private void TrackVRT()
{

Expand Down
Loading