Пример #1
0
        /// <summary>
        /// Move to Option Page(scan or print) after completing a navigation to the destination
        /// <param name="jobType">scan or print</param>
        /// </summary>
        public void SelectJobForSetOptions(iManageJobType jobType)
        {
            bool result = false;

            switch (jobType)
            {
            case iManageJobType.Scan:
                if (JetAdvantageLinkControlHelper.WaitingObjectAppear(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/fab"), 500, 600, _inactivityTimeLimit))
                {
                    result = LinkUI.Controller.Click(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/fab"));
                    Thread.Sleep(5000);
                    result = LinkUI.Controller.DoesScreenContains(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/bt_hide_options"));
                }
                break;

            case iManageJobType.Print:
                IsJobOptionScreenToPrint(jobType);
                _printPages = GetPrintPages();
                result      = true;
                break;

            default:
                DeviceWorkflowException e = new DeviceWorkflowException($"Unrecognized Connector Job Type: {jobType.GetDescription()} :: {_appName}");
                e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.FalseAlarm.GetDescription());
                throw e;
            }
            if (!result)
            {
                DeviceWorkflowException e = new DeviceWorkflowException($"Current Screen is not Job options page after navigation ({jobType.GetDescription()}):: {_appName} ");
                e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.SelectOptions.GetDescription());
                throw e;
            }
        }
Пример #2
0
        /// <summary>
        /// Navigate the location to save scan file(to select print file)
        /// <param name="filePath">Navigate to destination by FilePath</param>a
        /// <param name="jobType">IManageJobType</param>a
        /// </summary>
        public void NavigateToDestination(string filePath, iManageJobType jobType)
        {
            //Start - Init_Values
            string current_string = null;
            //Click Folder/File For navigating
            string filename = null;
            //parsed Filename/foldername
            string path = filePath;

            //Folder/File Path
            path = path.Trim();
            //Remove whitespace in front/end of path
            //It will return "abc def" if path is "abc def"
            //It will return "abc def" if path is " abc def" or "abc def "
            //End - Init_Values

            //Using Flag-"/", Parse Item to click for moving to destination
            while (path.Contains("/"))
            {
                current_string = path.Substring(0, path.IndexOf('/'));
                path           = path.Substring(path.IndexOf('/') + 1);
                filename       = current_string;
                ClickForParsedText(filename);
                //Search and Click Parsed Item on the list by _filename
            }

            if (!String.IsNullOrEmpty(path))
            {
                filename = path;
                UpdateStatus($"Final filename is  :: {filename}  {_appName}");
                //Final Destination(Scan : Final Folder, Print : Print Filename)
                ClickForParsedText(filename);
            }

            if (jobType == iManageJobType.Scan)//iv_filter
            {
                if (JetAdvantageLinkControlHelper.WaitingObjectAppear(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/iv_filter"), 500, 60, _inactivityTimeLimit))
                {
                    LinkUI.Controller.Click(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/btn_scan"));
                }
                else
                {
                    throw new DeviceWorkflowException($"Can not found Send button");
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Check that current UI is Job Option status or not.
        /// </summary>
        public void IsJobOptionScreenToPrint(iManageJobType jobType)
        {
            bool   result       = true;
            int    timeOut      = 0;
            string errorMessage = "No Error";

            RecordEvent(DeviceWorkflowMarker.PullingJobFromServerBegin);

            timeOut = LinkUI.Controller.GetTimeout();
            LinkUI.Controller.SetTimeout(0);
            result = JetAdvantageLinkControlHelper.WaitingObjectDisappear(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/pb_dialog_progress"), 500, 1000, _inactivityTimeLimit);

            if (!result)
            {
                errorMessage = $"Downloading file is abnormal status :: {_appName} ";
            }
            CheckServerErrorPopup();
            RecordEvent(DeviceWorkflowMarker.PullingJobFromServerEnd);
            LinkUI.Controller.SetTimeout(30);

            if (result)
            {
                result = LinkUI.Controller.DoesScreenContains(new UiSelector().ResourceId($"{iManageAppsPackageName}:id/btn_print"));
                // Check that Downloading is completed and Current UI is Job Option Screen on the print section
                if (!result)
                {
                    errorMessage = $"Cannot find Print Button :: {_appName} ";
                }
            }

            if (!result)
            {
                DeviceWorkflowException e = new DeviceWorkflowException($"{errorMessage}");
                e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.DownloadingPrintFile.GetDescription());
                throw e;
            }
            LinkUI.Controller.SetTimeout(timeOut);
        }