コード例 #1
0
        /// <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;
            }
        }
コード例 #2
0
ファイル: UCComboBox.xaml.cs プロジェクト: linuxerlj/Ginger
        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);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
ファイル: UCComboBox.xaml.cs プロジェクト: linuxerlj/Ginger
        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;
            }
        }
コード例 #5
0
        private void ParamsGridVEButton_Click(object sender, RoutedEventArgs e)
        {
            ActInputValue             AIV  = (ActInputValue)grdTestNGReportParameters.CurrentItem;
            ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, nameof(ActInputValue.Value), null);

            VEEW.ShowAsWindow();
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        private void VEGridInputGridVEButton_Click(object sender, RoutedEventArgs e)
        {
            ActInputValue             AIV  = (ActInputValue)VEGrid.CurrentItem;
            ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, nameof(ActInputValue.Value), mContext);

            VEEW.ShowAsWindow();
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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");
        }
コード例 #10
0
        private void InputGridVEButton_Click(object sender, RoutedEventArgs e)
        {
            ActInputValue             AIV  = (ActInputValue)DynamicXMLElementsGrid.CurrentItem;
            ValueExpressionEditorPage VEEW = new ValueExpressionEditorPage(AIV, ActInputValue.Fields.Value);

            VEEW.ShowAsWindow();
        }
コード例 #11
0
        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);
            }
        }
コード例 #12
0
        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();
        }
コード例 #13
0
        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;
        }
コード例 #14
0
        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();
        }
コード例 #15
0
 public ActSoapUiInputValue(ePropertyType properTpe, ActInputValue actInputValue)
 {
     this.Type           = properTpe.ToString();
     this.Param          = actInputValue.Param;
     this.Value          = actInputValue.Value;
     this.ValueForDriver = actInputValue.Value;
 }
コード例 #16
0
        private void SetXMLDynamicParameters(ObservableList <ActInputValue> dynamicElements, string param)
        {
            ActInputValue actInputValue = new ActInputValue();

            actInputValue.Param = param;
            dynamicElements.Add(actInputValue);
        }
コード例 #17
0
        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);
            }
        }
コード例 #18
0
 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);
 }
コード例 #19
0
 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);
 }
コード例 #20
0
        public BitmapPixelsComaprePage(ActVisualTesting mAct)
        {
            InitializeComponent();

            InitLayout();
            ActInputValue AIV = mAct.GetOrCreateInputParam(ActVisualTesting.Fields.ErrorMetric);

            ErrorMetricComboBox.Init(AIV, typeof(ImageMagick.ErrorMetric));
        }
コード例 #21
0
 /// <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);
 }
コード例 #22
0
        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);
        }
コード例 #23
0
        public ActionInputValueUserControl(ActInputValue actInputValue)
        {
            InitializeComponent();

            mActInputValue = actInputValue;

            ResetControls();

            SetControlToInputValue();
        }
コード例 #24
0
        public ActionInputValueUserControl(Context context, ActInputValue actInputValue)
        {
            InitializeComponent();

            mActInputValue = actInputValue;
            mContext       = context;

            ResetControls();

            SetControlToInputValue();
        }
コード例 #25
0
        /// <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);
        }
コード例 #26
0
        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);
        }
コード例 #27
0
        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);
        }
コード例 #28
0
        /// <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);
        }
コード例 #29
0
        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();
        }
コード例 #30
0
        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);
        }