/// <summary> /// Initiate and Bind the UCValue Expression Control, manage the Browse and VE buttons and configure the Extra functionality Handler. /// </summary> /// <param name="AIV">ActInputValue related to the Param configured under the Fields of the Action</param> /// <param name="isVENeeded">Determine whether the VE Button will be appeared or not</param> /// <param name="isBrowseNeeded">Determine whether the Browse Button will be appeared or not</param> /// <param name="browserType">Can be eBrowserType.File or eBrowserType.Folder</param> /// <param name="fileType">Type of the files for filter the Browser Dialog</param> /// <param name="extraBrowserSelectionHandler">To be used whenever extra functionality is needed after clicking OK or cancel at the Dialog window</param> public void Init(Context context, ActInputValue AIV, bool isVENeeded = true, bool isBrowseNeeded = false, eBrowserType browserType = eBrowserType.File, string fileType = "*", RoutedEventHandler extraBrowserSelectionHandler = null) { // If the VE is on stand alone form: this.obj = AIV; this.AttrName = ActInputValue.Fields.Value; mContext = context; GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(ValueTextBox, TextBox.TextProperty, obj, AttrName); if (isBrowseNeeded) { mBrowserType = browserType; LastCol.Width = new GridLength(55); BrowseButton.Visibility = Visibility.Visible; this.fileType = fileType; BrowseButton.AddHandler(Button.ClickEvent, new RoutedEventHandler(BrowseButton_Click)); if (extraBrowserSelectionHandler != null) { BrowseButton.Click += extraBrowserSelectionHandler; } } if (!isVENeeded) { MidCol.Width = new GridLength(0); OpenExpressionEditorButton.Visibility = Visibility.Collapsed; } }
public void Init(ActInputValue AIV, List <GingerCore.General.ComboItem> comboBoxItemsList, bool isVENeeded = false, SelectionChangedEventHandler UCselectionChange = null) { // If the VE is on stand alone form: this.obj = AIV; this.AttrName = ActInputValue.Fields.Value; //fill items ComboBox.Items.Clear(); ComboBox.SelectedValuePath = "Value"; foreach (GingerCore.General.ComboItem item in comboBoxItemsList) { ComboBox.Items.Add(item); } if (UCselectionChange != null) { ComboBox.SelectionChanged += UCselectionChange; } if (isVENeeded) { Col.Width = new GridLength(22); VEButton.Visibility = Visibility.Visible; ComboBox.IsEditable = true; GingerCore.General.ActInputValueBinding(ComboBox, ComboBox.TextProperty, AIV); } else { GingerCore.General.ActInputValueBinding(ComboBox, ComboBox.SelectedValueProperty, AIV); } }
private void ProcessUDFile() { string FileName = PCPath.Text; if (FileName.Contains("~\\")) { FileName = FileName.Replace("~", App.UserProfile.Solution.ContainingFolderFullPath); } mAct.DynamicUDElements.Clear(); string[] lines = System.IO.File.ReadAllLines(FileName); foreach (string s in lines) { int firstSpace = s.IndexOf("\t"); string Param; string Value; if (firstSpace > 0) { Param = s.Substring(0, firstSpace); Value = s.Substring(firstSpace).Trim(); } else { Param = s; Value = ""; } ActInputValue AIV = new ActInputValue(); AIV.Param = Param; AIV.Value = Value; mAct.DynamicUDElements.Add(AIV); } }
public void Init(ActInputValue AIV, Type optionalEnumType, int DefaultIndexValue, bool isVENeeded = false, SelectionChangedEventHandler UCselectionChange = null) { // If the VE is on stand alone form: this.obj = AIV; this.AttrName = ActInputValue.Fields.Value; GingerCore.General.FillComboFromEnumType(ComboBox, optionalEnumType); if (UCselectionChange != null) { ComboBox.SelectionChanged += UCselectionChange; } if (isVENeeded) { Col.Width = new GridLength(22); VEButton.Visibility = Visibility.Visible; ComboBox.IsEditable = true; GingerCore.General.ActInputValueBinding(ComboBox, ComboBox.TextProperty, AIV); } else { GingerCore.General.ActInputValueBinding(ComboBox, ComboBox.SelectedValueProperty, AIV); } if (ComboBox.Items.Count > 0 && DefaultIndexValue != -1) { ComboBox.SelectedIndex = DefaultIndexValue; } }
private void ParamsGridVEButton_Click(object sender, RoutedEventArgs e) { ActInputValue AIV = (ActInputValue)grdTestNGReportParameters.CurrentItem; ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, nameof(ActInputValue.Value), null); VEEW.ShowAsWindow(); }
public void TestActionLog_InputAndReturnValues() { //Arrange string fileName = TestResources.GetTempFile("ActionLog\\ActionLogTest_4.log"); GingerRunnerLogger gingerRunnerLogger = new GingerRunnerLogger(fileName); ActDummy actDummy = new ActDummy(); // set all the values in the action ActInputValue actInputValue = new ActInputValue(); actInputValue.ItemName = "TestInput"; actInputValue.Value = INP_VAL_EXPECTED; actDummy.InputValues.Add(actInputValue); ActReturnValue actReturnValue = new ActReturnValue(); actReturnValue.ItemName = "TestReturn"; actReturnValue.Expected = RET_VAL_EXPECTED; actReturnValue.Actual = RET_VAL_EXPECTED; actDummy.ReturnValues.Add(actReturnValue); actDummy.ActionLogConfig = new ActionLogConfig(); actDummy.ActionLogConfig.LogInputVariables = true; actDummy.ActionLogConfig.LogOutputVariables = true; actDummy.EnableActionLogConfig = true; //Act gingerRunnerLogger.LogAction(actDummy); //Assert Assert.IsTrue(IsFileContains(fileName, INP_VAL_EXPECTED)); Assert.IsTrue(IsFileContains(fileName, RET_VAL_EXPECTED)); }
private void VEGridInputGridVEButton_Click(object sender, RoutedEventArgs e) { ActInputValue AIV = (ActInputValue)VEGrid.CurrentItem; ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, nameof(ActInputValue.Value), mContext); VEEW.ShowAsWindow(); }
private void QueryParamGridVEButton_Click(object sender, RoutedEventArgs e) { ActInputValue AIV = (ActInputValue)QueryParamsGrid.CurrentItem; ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, ActInputValue.Fields.Value, Context.GetAsContext(mValidationDB.Context)); VEEW.ShowAsWindow(); }
void IVisualAnalyzer.Compare() { MagickImage magickBaseImg = new MagickImage(mAct.baseImage); MagickImage magickTargetImg = new MagickImage(mAct.targetImage); var diffImg = new MagickImage(); double percentageDifference; // TODO: add combo with list of options for user to choose the Error Matic and Cahnnels ActInputValue AIV = mAct.GetOrCreateInputParam(ActVisualTesting.Fields.ErrorMetric); //TODO: fix me - removed hard code //caused build problem on build machine so temp fix for now ErrorMetric EM = ErrorMetric.Fuzz; percentageDifference = magickBaseImg.Compare(magickTargetImg, EM, diffImg, Channels.Red); percentageDifference = percentageDifference * 100; percentageDifference = Math.Round(percentageDifference, 2); Bitmap ImgToSave = diffImg.ToBitmap(); mAct.CompareResult = ImgToSave; mAct.AddOrUpdateReturnParamActual("Percentage Difference", percentageDifference + ""); mAct.AddScreenShot(ImgToSave, "Compare Result"); }
private void InputGridVEButton_Click(object sender, RoutedEventArgs e) { ActInputValue AIV = (ActInputValue)DynamicXMLElementsGrid.CurrentItem; ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, ActInputValue.Fields.Value); VEEW.ShowAsWindow(); }
private void ProcessUDFile() { string FileName = PCPath.Text; //if (FileName.Contains("~\\")) //{ // FileName = FileName.Replace("~", WorkSpace.UserProfile.Solution.ContainingFolderFullPath); //} FileName = amdocs.ginger.GingerCoreNET.WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(FileName); mAct.DynamicUDElements.Clear(); string[] lines = System.IO.File.ReadAllLines(FileName); foreach (string s in lines) { int firstSpace = s.IndexOf("\t"); string Param; string Value; if (firstSpace > 0) { Param = s.Substring(0, firstSpace); Value = s.Substring(firstSpace).Trim(); } else { Param = s; Value = ""; } ActInputValue AIV = new ActInputValue(); AIV.Param = Param; AIV.Value = Value; mAct.DynamicUDElements.Add(AIV); } }
private void InputGridVEButton_Click(object sender, RoutedEventArgs e) { ActInputValue AIV = (ActInputValue)DynamicParametersGrid.CurrentItem; ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, nameof(ActInputValue.Value), Context.GetAsContext(mAct.Context)); VEEW.ShowAsWindow(); }
public void parseScriptHeader(string FileName) { mAct.QueryParams.Clear(); string[] script = File.ReadAllLines(amdocs.ginger.GingerCoreNET.WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(FileName)); foreach (string line in script) { var pattern = @"<<([^<^>].*?)>>"; // like div[1] // Parse the XPath to extract the nodes on the path var matches = Regex.Matches(line, pattern); foreach (Match match in matches) { ActInputValue AIV = (from aiv in mAct.QueryParams where aiv.Param == match.Groups[1].Value select aiv).FirstOrDefault(); if (AIV == null) { AIV = new ActInputValue(); // AIV.Active = true; AIV.Param = match.Groups[1].Value; mAct.QueryParams.Add(AIV); AIV.Value = ""; } } } if (mAct.QueryParams.Count > 0) { QueryParamsPanel.Visibility = Visibility.Visible; } else { QueryParamsPanel.Visibility = Visibility.Collapsed; } QueryParamsGrid.DataSourceList = mAct.QueryParams; }
private void HttpHeadersInputGridVEButton_Click(object sender, RoutedEventArgs e) { ActInputValue AIV = (ActInputValue)HttpHeadersGrid.CurrentItem; ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, ActInputValue.Fields.Value, Context.GetAsContext(mActREST.Context)); VEEW.ShowAsWindow(); }
public ActSoapUiInputValue(ePropertyType properTpe, ActInputValue actInputValue) { this.Type = properTpe.ToString(); this.Param = actInputValue.Param; this.Value = actInputValue.Value; this.ValueForDriver = actInputValue.Value; }
private void SetXMLDynamicParameters(ObservableList <ActInputValue> dynamicElements, string param) { ActInputValue actInputValue = new ActInputValue(); actInputValue.Param = param; dynamicElements.Add(actInputValue); }
private void SetActionInputsControls() { List <ActionInputValueInfo> actionInputsDetails = WorkSpace.Instance.PlugInsManager.GetActionEditInfo(mAct.PluginId, mAct.ServiceId, mAct.ActionId); foreach (ActionInputValueInfo actionInputValueInfo in actionInputsDetails) { ActInputValue actInputValue = (from x in mAct.InputValues where x.Param == actionInputValueInfo.Param select x).SingleOrDefault(); if (actInputValue == null) { actInputValue = new ActInputValue(); actInputValue.Param = actionInputValueInfo.Param; actInputValue.ParamType = actionInputValueInfo.ParamType; mAct.InputValues.Add(actInputValue); } else { actInputValue.ParamType = actionInputValueInfo.ParamType; } // Add ActionInputValueUserControl for the param value to edit ActionInputValueUserControl actionInputValueUserControl = new ActionInputValueUserControl(Context.GetAsContext(mAct.Context), actInputValue); DockPanel.SetDock(actionInputValueUserControl, Dock.Top); actionInputValueUserControl.Margin = new Thickness(0, 10, 0, 0); xActionInputControlsPnl.Children.Add(actionInputValueUserControl); } }
public void Init(ActInputValue AIV, bool mMakePathsRelative = false) { // If the VE is on stand alone form: MakePathsRelative = mMakePathsRelative; this.obj = AIV; this.AttrName = ActInputValue.Fields.Value; App.ObjFieldBinding(FilePathTextBox, TextBox.TextProperty, obj, AttrName); }
public void Init(ActInputValue AIV, bool mMakePathsRelative = false) { // If the VE is on stand alone form: MakePathsRelative = mMakePathsRelative; this.obj = AIV; this.AttrName = nameof(ActInputValue.Value); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(FilePathTextBox, TextBox.TextProperty, obj, AttrName); }
public BitmapPixelsComaprePage(ActVisualTesting mAct) { InitializeComponent(); InitLayout(); ActInputValue AIV = mAct.GetOrCreateInputParam(ActVisualTesting.Fields.ErrorMetric); ErrorMetricComboBox.Init(AIV, typeof(ImageMagick.ErrorMetric)); }
/// <summary> /// Initilized and Bind the UCComboBox with ActInputValue based on the dynamic list /// </summary> /// <param name="AIV">The ActInputValue related to the Param Name saved on the Action Field</param> /// <param name="comboBoxEnumItemsList"> List of items to be binded with combo box values</param> /// <param name="isVENeeded">boolean value to specify is value expression is needed</param> /// <param name="UCselectionChange">Selection changed event to attach to the field</param> /// <param name="context">Context of the input value. If Value expression is needed then context is must</param> public void Init(ActInputValue AIV, dynamic comboBoxEnumItemsList, bool isVENeeded = false, SelectionChangedEventHandler UCselectionChange = null, Context context = null) { // If the VE is on stand alone form: this.obj = AIV; this.AttrName = ActInputValue.Fields.Value; mContext = context; FillComboBoxFromDynamicList(comboBoxEnumItemsList); BindVEAndSelectionChangedEvent(isVENeeded, UCselectionChange); }
private static void SetRestActionInputValues(Act act, string sFileName, string sValue) { ActInputValue inputValue = new ActInputValue() { FileName = sFileName, ItemName = sFileName, Param = sFileName, Value = sValue }; act.InputValues.Add(inputValue); }
public ActionInputValueUserControl(ActInputValue actInputValue) { InitializeComponent(); mActInputValue = actInputValue; ResetControls(); SetControlToInputValue(); }
public ActionInputValueUserControl(Context context, ActInputValue actInputValue) { InitializeComponent(); mActInputValue = actInputValue; mContext = context; ResetControls(); SetControlToInputValue(); }
/// <summary> /// Initilized and Bind the UCComboBox with ActInputValue based on the enum type. /// </summary> /// <param name="AIV">The ActInputValue related to the Param Name saved on the Action Field</param> /// <param name="optionalEnumType">Type of the Enum created under the Action represents the values on the ComboBox</param> /// <param name="isVENeeded">boolean value to specify is value expression is needed</param> /// <param name="UCselectionChange">Selection changed event to attach to the field</param> /// <param name="context">Context of the input value. If Value expression is needed then context is must</param> public void Init(ActInputValue AIV, Type optionalEnumType = null, bool isVENeeded = false, SelectionChangedEventHandler UCselectionChange = null, Context context = null) { // If the VE is on stand alone form: this.obj = AIV; this.AttrName = ActInputValue.Fields.Value; mContext = context; if (optionalEnumType != null) { GingerCore.General.FillComboFromEnumType(ComboBox, optionalEnumType); } BindVEAndSelectionChangedEvent(isVENeeded, UCselectionChange); }
private static ObservableList <ActInputValue> SetJSONDynamicParameters() { ObservableList <ActInputValue> temp = new ObservableList <ActInputValue>(); ActInputValue inp = new ActInputValue(); inp.Param = ".info.description"; temp.Add(inp); inp = null; inp = new ActInputValue(); inp.Param = ".parameters.query-salesChannel.description"; temp.Add(inp); inp = null; return(temp); }
private ObservableList <ActInputValue> SetXMLDynamicParameters() { ObservableList <ActInputValue> temp = new ObservableList <ActInputValue>(); ActInputValue inp = new ActInputValue(); inp.Param = "//book[@publisher='amdocs']"; temp.Add(inp); inp = null; inp = new ActInputValue(); inp.Param = "/catalog/book[2]"; temp.Add(inp); inp = null; return(temp); }
/// <summary> /// Apply Ws-Security Header /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReplaceWSSecurityHeader_Click(object sender, RoutedEventArgs e) { string txtBoxBodyContent = RequestBodyTextBox.Text; List <string> SoapSecurityContent = ApplicationModelBase.GetSoapSecurityHeaderContent(ref txtBoxBodyContent); string wsSecuritySettings = SoapSecurityContent.ElementAt(0); RequestBodyTextBox.Text = txtBoxBodyContent; ActInputValue user = new ActInputValue(); if (string.IsNullOrEmpty(txtBoxBodyContent)) { return; } SetCredentialPlaceHolders(SoapSecurityContent); }
public ActionInputValueUserControl(Context context, ActInputValue actInputValue, List <Attribute> actionParamProperties) { InitializeComponent(); mActInputValue = actInputValue; mContext = context; mActionParamProperties = actionParamProperties; ResetControls(); mLabel = Regex.Replace(Regex.Replace(Regex.Replace(mActInputValue.Param, @"(\P{Ll})(\P{Ll}\p{Ll})", "$1 $2"), @"(\p{Ll})(\P{Ll})", "$1 $2"), @"(\P{Ll}\p{Ll})", m => m.ToString().ToLower()); mLabel = char.ToUpper(mLabel[0]) + mLabel.Substring(1); SetParamLayout(); SetControlToInputValue(); SetParamValidations(); }
private ObservableList <ActInputValue> ConvertAPIModelKeyValueToActInputValues(ObservableList <APIModelKeyValue> GingerCoreNETHttpHeaders, ActWebAPIModel actWebAPIModel) { ObservableList <ActInputValue> GingerCoreHttpHeaders = new ObservableList <ActInputValue>(); if (GingerCoreNETHttpHeaders != null) { foreach (APIModelKeyValue AMKV in GingerCoreNETHttpHeaders) { ActInputValue AIV = new ActInputValue(); AIV.Param = AMKV.Param; AIV.ValueForDriver = ReplacePlaceHolderParameneterWithActual(AMKV.Value, actWebAPIModel.APIModelParamsValue); GingerCoreHttpHeaders.Add(AIV); } } return(GingerCoreHttpHeaders); }