예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionTreeCommittedEventContext"/> class.
 /// </summary>
 /// <param name="info">The commit information.</param>
 /// <param name="solutionOperation">The solution operation.</param>
 /// <param name="rootPath">The path to the solution.</param>
 /// <param name="newRootPath">The new root path.</param>
 /// <param name="destinationPath">The commit destination path.</param>
 public SolutionTreeCommittedEventContext(CommitInfo info, SolutionOperation solutionOperation, IRootPath rootPath, IRootPath newRootPath, string destinationPath)
 {
     Info = info;
     SolutionOperation = solutionOperation;
     RootPath          = rootPath;
     NewRootPath       = newRootPath;
     DestinationPath   = destinationPath;
 }
예제 #2
0
        /// <summary>
        /// Performs the Safecom tasks on the Control panel
        /// </summary>
        /// <param name="action">action to be performed</param>
        public void DoSafecomAction(SolutionOperation action)
        {
            try
            {
                if (_controlPanel.WaitForActiveScreenLabel("view_sips_vert1colTxtOnly_multi", _defaultScreenWait))
                {
                    switch (action)
                    {
                    case SolutionOperation.Print:    //Printing single Job
                    {
                        _controlPanel.Press("sips_multi_vert1colTxtOnly.0");
                        _controlPanel.WaitForActiveScreenLabel("view_sips_vert1colTxtOnly_multi", _defaultScreenWait);
                        _controlPanel.Press("sips_common_footer_list.0");        //print
                        _controlPanel.WaitForActiveScreenLabel("view_sips_nolistorform_busy_job", _defaultScreenWait);
                    }
                    break;

                    case SolutionOperation.PrintAll:                      //Printing all Jobs
                    {
                        _controlPanel.Press("sips_common_footer_list.2"); //print all
                        _controlPanel.WaitForActiveScreenLabel("view_sips_nolistorform_busy_job", _defaultScreenWait);
                    }
                    break;

                    case SolutionOperation.Delete:    //Deleting single Job
                    {
                        _controlPanel.Press("sips_multi_vert1colTxtOnly.0");
                        _controlPanel.WaitForActiveScreenLabel("view_sips_vert1colTxtOnly_multi", _defaultScreenWait);
                        _controlPanel.Press("sips_common_footer_list.1");         //menu
                        _controlPanel.WaitForActiveScreenLabel("view_sips_horizMultiRowImgTxt_single", _defaultScreenWait);
                        _controlPanel.Press("sips_single_horizMultiRowImgTxt.2"); //delete
                    }
                    break;

                    case SolutionOperation.PrintKeep:    //Deleting single Job
                    {
                        _controlPanel.Press("sips_multi_vert1colTxtOnly.0");
                        _controlPanel.WaitForActiveScreenLabel("view_sips_vert1colTxtOnly_multi", _defaultScreenWait);
                        _controlPanel.Press("sips_common_footer_list.1"); //menu
                        _controlPanel.WaitForActiveScreenLabel("view_sips_horizMultiRowImgTxt_single", _defaultScreenWait);
                        _controlPanel.Press("Retain_controlName");        //delete
                    }
                    break;

                    case SolutionOperation.SignOut:
                        SafeComSignOut();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception($"Safecom operation failed with exception:{ex.Message}");
            }
        }
예제 #3
0
 public SolutionClosedEventContext(SolutionOperation solutionOperation, IRootPath closedRootPath, IRootPath newRootPath)
 {
     this.SolutionOperation = solutionOperation;
     this.ClosedRootPath    = closedRootPath;
     this.NewRootPath       = newRootPath;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionClosedEventContext"/> class.
 /// </summary>
 /// <param name="solutionOperation">The solution operation.</param>
 /// <param name="closedRootPath">The path to the closed solution.</param>
 /// <param name="newRootPath">The new root path.</param>
 public SolutionClosedEventContext(SolutionOperation solutionOperation, IRootPath closedRootPath, IRootPath newRootPath)
 {
     SolutionOperation = solutionOperation;
     ClosedRootPath    = closedRootPath;
     NewRootPath       = newRootPath;
 }
예제 #5
0
        /// <summary>
        /// Performs the HPAC tasks on the Control panel
        /// </summary>
        /// <param name="action">action to be performed</param>
        public void PerformHpacTasksOnCp(SolutionOperation action)
        {
            try
            {
                if (_siriusDevice.ControlPanel.WaitForActiveScreenLabel("view_sips_vert1colTxtOnly_multi",
                                                                        _longDelay))
                {
                    //Getting the control ID for the file name
                    string fileID = "sips_multi_vert1colTxtOnly.0";
                    //Validating if file id is null or empty

                    switch (action)
                    {
                    case SolutionOperation.Delete:
                    {
                        //Press on the File name
                        _siriusDevice.ControlPanel.Press(fileID);
                        Thread.Sleep(_shortDelay);
                        //Press delete button
                        _siriusDevice.ControlPanel.Press("sips_common_footer_list.1");
                        Thread.Sleep(_shortDelay);
                    }
                    break;

                    case SolutionOperation.Print:
                    {
                        //Press on the File name
                        _siriusDevice.ControlPanel.Press(fileID);
                        Thread.Sleep(_shortDelay);
                        //Press Print Button
                        _siriusDevice.ControlPanel.Press("sips_common_footer_list.0");
                        Thread.Sleep(_shortDelay);
                    }
                    break;

                    case SolutionOperation.Cancel:
                    {
                        //Press on the File name
                        _siriusDevice.ControlPanel.Press(fileID);
                        Thread.Sleep(_shortDelay);
                        //Press print button
                        _siriusDevice.ControlPanel.Press("sips_common_footer_list.0");
                        Thread.Sleep(_shortDelay);
                        //Going to home screen
                        _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Home);
                        Thread.Sleep(_shortDelay);
                        //Press on Cancel print
                        _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Cancel);
                        Thread.Sleep(_shortDelay);
                        //Press on cancel on the Scrren for the specified job
                        _siriusDevice.ControlPanel.Press("concurrent_job_status_nameval.0");
                        Thread.Sleep(_shortDelay);
                    }
                    break;

                    case SolutionOperation.PrintAll:
                    {
                        _siriusDevice.ControlPanel.Press("sips_common_footer_list.2");
                        Thread.Sleep(_shortDelay);
                        _siriusDevice.ControlPanel.Press("sips_common_footer_list.0");
                        Thread.Sleep(_shortDelay);
                    }
                    break;

                    default:
                    {
                        _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Home);
                        throw new Exception($"{ (object)action} is not supported on Sirius devices");
                    }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception($"HPAC navigation failed with exception:{ex.Message}");
            }
        }
예제 #6
0
        /// <summary>
        /// Performs the Safecom tasks on the Control panel
        /// </summary>
        /// <param name="action">action to be performed</param>
        public void DoSafecomAction(SolutionOperation action)
        {
            try
            {
                //Getting the control ID for the file name model.0
                string fileID = "model.0";
                //Validating if file id is null or empty
                switch (action)
                {
                case SolutionOperation.Delete:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        _pacekeeper.Pause();
                        //Press on the File name
                        _siriusDevice.ControlPanel.PerformAction(WidgetAction.Check, fileID);
                        _pacekeeper.Pause();
                        //Press Menu button
                        _siriusDevice.ControlPanel.Press("fb_footerCenter");
                        _pacekeeper.Pause();

                        //Press Delete button
                        _siriusDevice.ControlPanel.Press("model.sipsnamevalmapmodel.2");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception("Unable to navigate to Safecom main screen");
                    }
                }
                break;

                case SolutionOperation.Print:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        //Press on the File name
                        _siriusDevice.ControlPanel.PerformAction(WidgetAction.Check, fileID);
                        _pacekeeper.Pause();
                        //Press Print Button
                        _siriusDevice.ControlPanel.Press("fb_footerRight");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception("Unable to navigate to Safecom main screen");
                    }
                }
                break;

                case SolutionOperation.Cancel:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        _pacekeeper.Pause();
                        //Press on the File name
                        _siriusDevice.ControlPanel.PerformAction(WidgetAction.Check, fileID);
                        _pacekeeper.Pause();
                        //Press print button
                        _siriusDevice.ControlPanel.Press("fb_footerRight");
                        _pacekeeper.Pause();
                        //Press on cancel on the Scrren for the specified job
                        _siriusDevice.ControlPanel.Press("sips_status_cancel");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception("Unable to navigate to Safecom main screen");
                    }
                }
                break;

                case SolutionOperation.PrintAll:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        _siriusDevice.ControlPanel.Press("fb_footerLeft");
                        _pacekeeper.Pause();
                        _siriusDevice.ControlPanel.Press("fb_footerRight");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception("Unable to navigate to Safecom main screen");
                    }
                }
                break;

                case SolutionOperation.SignOut:
                {
                    _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Home);
                    _pacekeeper.Pause();

                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("Home", _longDelay))
                    {
                        SignOut();
                    }
                    else
                    {
                        throw new Exception("Unable to navigate to Safecom main screen");
                    }
                }
                break;

                default:
                {
                    _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Home);
                    throw new Exception($"{action} is not supported on Sirius devices");
                }
                }
            }
            catch (Exception ex)
            {
                throw new Exception($"Safecom Task failed with exception: { (object)ex.Message}");
            }
        }
예제 #7
0
        /// <summary>
        /// Adds an activity to the tasks list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addactivity_button_Click(object sender, EventArgs e)
        {
            tasks_dataGridView.Visible    = false;
            tasks_dataGridView.DataSource = null;

            SolutionOperation selectedOperation = EnumUtil.GetByDescription <SolutionOperation>(operations_comboBox.SelectedItem.ToString());

            _activityData.PullPrintingSolution = EnumUtil.GetByDescription <PullPrintingSolution>(solutionApp_comboBox.SelectedItem.ToString());

            switch (selectedOperation)
            {
            case SolutionOperation.Print:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.Print, Description = $"Print one job using { (object)solutionApp_comboBox.SelectedItem.ToString()} App"
                    });
            }
            break;

            case SolutionOperation.PrintAll:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.PrintAll, Description = $"Print All jobs using { (object)solutionApp_comboBox.SelectedItem.ToString()} App"
                    });
            }
            break;

            case SolutionOperation.Delete:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.Delete, Description = $"Delete one job using { (object)solutionApp_comboBox.SelectedItem.ToString()} App"
                    });
            }
            break;

            case SolutionOperation.Cancel:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.Cancel, Description = $"Cancel one job using { (object)solutionApp_comboBox.SelectedItem.ToString()} App"
                    });
            }
            break;

            case SolutionOperation.PrintDelete:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.PrintDelete, Description = $"Print and Delete job using { (object)solutionApp_comboBox.SelectedItem.ToString()} App"
                    });
            }
            break;

            case SolutionOperation.PrintKeep:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.PrintKeep, Description = $"Print and Retain job using { (object)solutionApp_comboBox.SelectedItem.ToString()} App"
                    });
            }
            break;

            case SolutionOperation.UIValidation:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.UIValidation, Description = $"Refresh Toggle Button UI Validation"
                    });
            }
            break;

            case SolutionOperation.SignOut:
            {
                _activityData.PullPrintTasks.Add(new PrintManagementTask()
                    {
                        Operation = SolutionOperation.SignOut, Description = "Sign out the current logged in user"
                    });
            }
            break;
            }
            tasks_dataGridView.DataSource = _activityData.PullPrintTasks;
            tasks_dataGridView.Visible    = true;
        }
예제 #8
0
        /// <summary>
        /// Performs the HPAC tasks on the Control panel
        /// </summary>
        /// <param name="action">action to be performed</param>
        public void PerformHpacTasksOnCp(SolutionOperation action)
        {
            try
            {
                //Getting the control ID for the file name model.0
                string fileID = "model.0";

                if (!Retry.UntilTrue(() => HasConnected(), 50, TimeSpan.FromSeconds(5)))
                {
                    throw new Exception($"Unable to navigate to HPAC main screen within prescribed time limit and retries (50)");
                }

                //Validating if file id is null or empty
                switch (action)
                {
                case SolutionOperation.Delete:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        _pacekeeper.Pause();
                        //Press on the File name
                        _siriusDevice.ControlPanel.PerformAction(WidgetAction.Check, fileID);
                        //_siriusDevice.ControlPanel.Press(fileID);
                        _pacekeeper.Pause();
                        //Press delete button
                        _siriusDevice.ControlPanel.Press("fb_footerCenter");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception($"Unable to navigate to HPAC main screen within {_longDelay.TotalMinutes} minutes");
                    }
                }
                break;

                case SolutionOperation.Print:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        if (_siriusDevice.ControlPanel.WaitForWidget("sipsemptyscreentype", _mediumDelay) != null)
                        {
                            throw new Exception("No documents to print");
                        }
                        _pacekeeper.Pause();
                        //Press on the File name
                        _siriusDevice.ControlPanel.PerformAction(WidgetAction.Check, fileID);
                        _pacekeeper.Pause();
                        //Press Print Button
                        _siriusDevice.ControlPanel.Press("fb_footerRight");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception($"Unable to navigate to HPAC main screen within {_longDelay.TotalMinutes} minutes");
                    }
                }
                break;

                case SolutionOperation.Cancel:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        _pacekeeper.Pause();
                        //Press on the File name
                        _siriusDevice.ControlPanel.PerformAction(WidgetAction.Check, fileID);
                        //_siriusDevice.ControlPanel.Press(fileID);
                        _pacekeeper.Pause();
                        //Press print button
                        _siriusDevice.ControlPanel.Press("fb_footerRight");
                        _pacekeeper.Pause();
                        //Press on cancel on the Scrren for the specified job
                        _siriusDevice.ControlPanel.Press("sips_status_cancel");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception($"Unable to navigate to HPAC main screen within {_longDelay.TotalMinutes} minutes");
                    }
                }
                break;

                case SolutionOperation.PrintAll:
                {
                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("vw_sips_apps_state", _longDelay))
                    {
                        if (_siriusDevice.ControlPanel.WaitForWidget("sipsemptyscreentype") != null)
                        {
                            throw new Exception("No documents to print");
                        }
                        _pacekeeper.Pause();
                        _siriusDevice.ControlPanel.Press("fb_footerLeft");
                        _pacekeeper.Pause();
                        _siriusDevice.ControlPanel.Press("fb_footerRight");
                        _pacekeeper.Pause();
                    }
                    else
                    {
                        throw new Exception($"Unable to navigate to HPAC main screen within {_longDelay.TotalMinutes} minutes");
                    }
                }
                break;

                case SolutionOperation.SignOut:
                {
                    _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Home);
                    _pacekeeper.Pause();

                    if (_siriusDevice.ControlPanel.WaitForScreenLabel("Home", _mediumDelay))
                    {
                        SignOut();
                    }
                    else
                    {
                        throw new Exception("Unable to navigate to Home screen");
                    }
                }
                break;

                default:
                {
                    _siriusDevice.ControlPanel.PressKey(SiriusSoftKey.Home);
                    throw new Exception($"{ (object)action} is not supported on Sirius devices");
                }
                }
            }
            catch (Exception ex)
            {
                throw new Exception($"HPAC Task failed with exception: {ex.Message}");
            }
        }
예제 #9
0
        /// <summary>
        /// PerformJediHpacTasksOnCp
        /// </summary>
        /// <param name="action"></param>
        public void PerformJediHpacTasksOnCp(SolutionOperation action)
        {
            try
            {
                bool success =
                    Wait.ForTrue(
                        () =>
                        _jediDevice.ControlPanel.CurrentForm().StartsWith("OXP", StringComparison.OrdinalIgnoreCase),
                        _longDelay);
                if (success)
                {
                    // Get the document id - refer to SampleHpacPrint.html for example
                    var    results    = GetDocumentsInfo();
                    string checkBoxId = "";
                    if (results != null)
                    {
                        checkBoxId = results.ElementAt(0).Id;
                    }
                    ExecutionServices.SystemTrace.LogDebug($"CheckBox Id of first print job: { (object)checkBoxId}");
                    //_engine.ExecuteJavaScript(HpacSelectFirstDocument); //Selects the First Document
                    if (results != null)
                    {
                        switch (action)
                        {
                        case SolutionOperation.PrintKeep:
                        {
                            ClickById(checkBoxId, _shortDelay);
                            ClickPrintJobsByName(PrintAndKeep);
                            ClickById(PrintAndKeep, _shortDelay);
                        }
                        break;

                        case SolutionOperation.PrintDelete:
                        {
                            ClickById(checkBoxId, _shortDelay);
                            ClickPrintJobsByName(PrintAndDelete);
                            ClickById(PrintAndDelete, _shortDelay);
                        }
                        break;

                        case SolutionOperation.Print:
                        {
                            ClickById(checkBoxId, _shortDelay);
                            ClickPrintJobsByName(PrintAll);
                            ClickById(PrintAll, _shortDelay);
                        }
                        break;

                        case SolutionOperation.Cancel:
                        {
                            ClickPrintJobsByName(PrintAll);
                            ClickById(PrintAll, _mediumDelay);
                            _jediDevice.ControlPanel.PressKey(JediHardKey.Menu);
                            Thread.Sleep(_mediumDelay);

                            _jediDevice.ControlPanel.PressToNavigate("mStopButton", "PauseDevicePopup", true);
                            Thread.Sleep(TimeSpan.FromSeconds(15));

                            _jediDevice.ControlPanel.PressToNavigate("m_CancelButton", "TwoButtonMessageBox", true);
                            Thread.Sleep(TimeSpan.FromSeconds(3));

                            _jediDevice.ControlPanel.Press("m_OKButton");
                        }
                        break;

                        case SolutionOperation.PrintAll:
                        {
                            ClickById(PrintAll, _shortDelay);
                        }
                        break;

                        case SolutionOperation.UIValidation:
                        {
                            string result = _engine.ExecuteJavaScript(this.CheckButtonRefreshValue);
                            if (result.ToLower() == "\"true\"")
                            {
                                ClickById(checkBoxId, _shortDelay);
                                var res = _engine.ExecuteJavaScript(this.CheckButtonDeleteValue);
                                {
                                    if (res.ToLower() == "\"false\"")
                                    {
                                        throw new Exception("The button did not toggle to Delete");
                                    }
                                }
                            }
                            else
                            {
                                throw new Exception("The button did not toggle to Refresh");
                            }
                        }
                        break;

                        default:
                        {
                            _jediDevice.ControlPanel.PressKey(JediHardKey.Menu);
                            throw new Exception($"{action} is not supported on Jedi devices");
                        }
                        }


                        //Press home sceeen
                        _jediDevice.ControlPanel.PressKey(JediHardKey.Menu);
                        _pacekeeper.Pause();

                        //Press on Signout
                        _jediDevice.ControlPanel.Press("mSignInButton");
                    }
                }
            }
            catch (Exception ex)
            {
                ExecutionServices.SystemTrace.LogDebug(ex.Message);
                throw;
            }
        }