Пример #1
0
        private static bool AreTextBoxLocationsCorrect(WidgetCollection widgets)
        {
            WidgetCollection textBoxes = widgets.OfType(WidgetType.EditBox);
            int distinctLocations      = textBoxes.Select(n => n.Location).Distinct().Count();

            return(distinctLocations == textBoxes.Count);
        }
Пример #2
0
        private static bool ArePromptLocationsCorrect(WidgetCollection widgets)
        {
            WidgetCollection prompts = widgets.OfType(WidgetType.Prompt);
            int distinctLocations    = prompts.Select(n => n.Location).Distinct().Count();

            return(distinctLocations == prompts.Count);
        }
Пример #3
0
        private bool AreLocationsIncorrect()
        {
            WidgetCollection editBoxes = _controlPanel.GetWidgets().OfType(WidgetType.EditBox);
            int distinctLocations      = editBoxes.Select(n => n.Location).Distinct().Count();

            return(distinctLocations < editBoxes.Count);
        }
Пример #4
0
        /// <summary>
        /// Gets the current control ids.
        /// </summary>
        public override void GetCurrentControlIds()
        {
            WidgetCollection wc = _controlPanel.GetScreenInfo().Widgets;

            ControlPanelControlIds = string.Join(",", wc.Select(x => x.Id).ToArray());
        }
Пример #5
0
        /// <summary>
        /// Selects the workflow with the specified name from the default workflow menu.
        /// </summary>
        /// <param name="workflowName">The workflow name.</param>
        public void SelectWorkflow(string workflowName)
        {
            Widget groupWidget = _controlPanel.GetWidgets().Find("1.", StringMatch.StartsWith);

            _controlPanel.Press(groupWidget);

            // Wait for the workflows to load, then let it settle for a moment
            Wait.ForNotNull(() => _controlPanel.GetWidgets().Find("Workflow >", StringMatch.StartsWith), TimeSpan.FromSeconds(20));
            Thread.Sleep(TimeSpan.FromSeconds(2));
            Pacekeeper.Sync();

            // Find the workflow and select it
            WidgetCollection workflowWidgets = _controlPanel.GetWidgets().OfType(WidgetType.HelpListItem);
            string           workflowMatch   = StringMatcher.FindBestMatch(workflowName, workflowWidgets.Select(n => n.Text), StringMatch.Contains, ignoreCase: true);

            if (workflowMatch != null)
            {
                Widget workflow = _controlPanel.ScrollToItem("StringContent1", workflowMatch);
                _controlPanel.Press(workflow);
            }
            else
            {
                throw new DeviceWorkflowException($"Could not find workflow named '{workflowName}'.");
            }

            // Wait for the parameters to load, then let it settle for a moment
            _controlPanel.WaitForScreen(_workflowMain, TimeSpan.FromSeconds(20));
            Thread.Sleep(TimeSpan.FromSeconds(2));
            Pacekeeper.Sync();
        }
Пример #6
0
        /// <summary>
        /// Selects the folder quickset with the specified name.
        /// </summary>
        /// <param name="quicksetName">The quickset name.</param>
        public void SelectQuickset(string quicksetName)
        {
            WidgetCollection quicksetWidgets = _controlPanel.GetWidgets().OfType(WidgetType.HelpListItem);
            string           bestMatch       = StringMatcher.FindBestMatch(quicksetName, quicksetWidgets.Select(n => n.Text),
                                                                           StringMatch.StartsWith, ignoreCase: true, ignoreWhiteSpace: true, allowPartialMatch: true);

            if (bestMatch != null)
            {
                Widget quickset = _controlPanel.ScrollToItem("StringContent1", bestMatch);
                _controlPanel.Press(quickset);
                Pacekeeper.Sync();
            }
            else
            {
                throw new DeviceWorkflowException($"Could not find the quickset '{quicksetName}'.");
            }
        }