Ejemplo n.º 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, string initialDirectory = null)
        {
            // If the VE is on stand alone form:
            this.obj      = AIV;
            this.AttrName = nameof(ActInputValue.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;
                this.initialDirectory   = initialDirectory;

                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;
            }
        }
Ejemplo n.º 2
0
        public void Init(Context context, object obj, string AttrName, bool isVENeeded = true, bool isBrowseNeeded = false, eBrowserType browserType = eBrowserType.File, string fileType = "*", RoutedEventHandler extraBrowserSelectionHandler = null)
        {
            this.obj      = obj;
            this.AttrName = AttrName;
            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;
            }
        }
Ejemplo n.º 3
0
        private void SetUp(Eyes eyes, string AppilToolServerUrl, string AppilToolsApiKey, eBrowserType BrowserType, string Environment)
        {
            Applitools.Selenium.Configuration config = new Applitools.Selenium.Configuration();
            if (WorkSpace.Instance.RunsetExecutor.RunSetConfig != null && WorkSpace.Instance.RunsetExecutor.RunSetConfig.GingerRunners.Any() && ((GingerExecutionEngine)WorkSpace.Instance.RunsetExecutor.RunSetConfig.GingerRunners[0].Executor).ExecutedFrom == eExecutedFrom.Run)
            {
                BatchInfo batchInfo = new BatchInfo(WorkSpace.Instance.RunsetExecutor.RunSetConfig.ItemName);

                batchInfo.Id = WorkSpace.Instance.RunsetExecutor.RunSetConfig.ExecutionID.ToString();
                config.SetBatch(batchInfo);
            }

            config.SetApiKey(AppilToolsApiKey);
            config.SetServerUrl(AppilToolServerUrl);
            OperatingSystem Os_info = System.Environment.OSVersion;

            config.SetHostOS(Os_info.VersionString);
            config.SetHostApp(BrowserType.ToString());
            eyes.AddProperty("Environment ID", !String.IsNullOrEmpty(Environment) ? Environment : "Default");
            eyes.SetConfiguration(config);
        }