/// <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(ClioJobType JobType) { bool result = false; switch (JobType) { case ClioJobType.Scan: result = LinkUI.Controller.DoesScreenContains(new UiSelector().ResourceId($"{ClioAppsPackageName}:id/bt_hide_options")); break; case ClioJobType.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; } }
/// <summary> /// Check that current UI is Job Option status or not. /// </summary> public void IsJobOptionScreenToPrint(ClioJobType JobType) { string reason = $"Fail to check UI screen for printing job :: {_appName}"; bool result = true; int timeOut = 0; RecordEvent(DeviceWorkflowMarker.PullingJobFromServerBegin); timeOut = LinkUI.Controller.GetTimeout(); LinkUI.Controller.SetTimeout(0); CheckServerErrorPopup(); RecordEvent(DeviceWorkflowMarker.PullingJobFromServerEnd); LinkUI.Controller.SetTimeout(60); if (result) { result = LinkUI.Controller.DoesScreenContains(new UiSelector().ResourceId($"{ClioAppsPackageName}:id/btn_print")); // Check that Downloading is completed and Current UI is Job Option Screen on the print section if (!result) { reason = $"Fail to check UI screen for printing job - Print button is not displayed :: {_appName} "; } } if (!result) { DeviceWorkflowException e = new DeviceWorkflowException(reason); e.Data.Add(_exceptionCategoryData, ConnectorExceptionCategory.DownloadingPrintFile.GetDescription()); throw e; } }
/// <summary> /// Navigate the location to save scan file(to select print file) /// <param name="filePath">Navigate to destination by FilePath</param> /// <param name="jobType">ClioJobType</param> /// </summary> public void NavigateToDestination(string filePath, ClioJobType 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; SearchForParsedText(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) SearchForParsedText(filename); } }