public void CheckReportXML(string resultsName, string version, string expectedFileName) { ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractResultsTo(null, null, resultsName); var resultsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "temp", version); var actualXML = File.ReadAllText(Directory.GetFiles(resultsFolder, "*.report.xml").First()).Replace(" ", "").Replace("\r\n", ""); /* * We will split the expected file on several lines and will validate an existence each of one * because the *.report.xml file contains date and time (till seconds). * It may cause differences in seconds and test will not be stable. */ var expectedXMLStrings = File.ReadAllLines(Path.Combine(HelperConstants.getExeAssemblyPath(), @"ExpectedRunDetails\QualityControl", expectedFileName)); Report.Info("Actual xml:" + actualXML); Report.Info("Expected xml:" + expectedXMLStrings[0] + expectedXMLStrings[1]); if (actualXML.Contains(expectedXMLStrings[0]) && actualXML.Contains(expectedXMLStrings[1])) { Report.Success("Tables was added to *.report.xml"); } else { Report.Failure("QC analysis report is not as expected."); } ExtractProtocolHelper.DeleteTempFolder(); }
public void CheckXML_Text(string expectedFile) { var xmlText = repo.ResultsAnalysis.xmlText.Element.GetAttributeValueText("XmlText"); var expected = File.ReadAllText(Path.Combine(HelperConstants.getExeAssemblyPath(), @"ExpectedRunDetails\XMLs", expectedFile)); Report.Info("The settings display/update the BestFitSearch WeightCSV attribute and the BestFitSearch Methods."); Validate.IsTrue(xmlText.Contains(expected)); }
public void CompareExportedFile(string fileName) { ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractResultsTo(null, null, fileName + ".assay-results"); var pathToResultsXML = Path.Combine(HelperConstants.getDesktopTempFolder(), "2"); var pathToReportXML = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"MyAssays\Reports"); var resultsXML = File.ReadAllText(Directory.GetFiles(pathToResultsXML, "*.report.xml").First()); var reportXML = File.ReadAllText(Directory.GetFiles(pathToReportXML, "*.xml").First()); Report.Info("Comparing xml file in *.assay-results file and in Report folder."); Validate.AreEqual(reportXML, resultsXML); }
public void CommandLineImport(string protocolName, string param) { var file = Path.Combine(HelperConstants.getExeAssemblyPath(), @"Inputs\ImportMeasurements\ELISA Absorbance 405nm.xml"); var arg = " \"/import-raw:" + file + "\"" + param; Report.Info("Argument string: " + arg); Report.Info(String.Format("Validating Exists on file '{0}'. {1}.", file, File.Exists(file))); StartAnalysisHelper.Protocol = protocolName; StartAnalysisHelper.StartAnalysis(arg); Delay.Seconds(HelperConstants.TIME_TO_OPEN_PROTOCOL); }
public void ValidateUnitsInXML(string protocolName, string filename) { ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractProtocolTo(null, null, protocolName); var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "temp"); var actualXML = File.ReadAllText(Directory.GetFiles(path, "*.assay.xml").First()).Replace(" ", "").Replace("\r", "").Replace("\n", ""); Report.Info("Actual units in xml file:" + actualXML); var expectedXML = File.ReadAllText(Path.Combine(HelperConstants.getExeAssemblyPath(), @"ExpectedRunDetails\XMLs", filename)).Replace(" ", "") .Replace("\r", "") .Replace("\n", ""); Report.Info("Expected units in xml file:" + expectedXML); Validate.IsTrue(actualXML.Contains(expectedXML), "Actual *.assay.xml file contains expected units."); ExtractProtocolHelper.DeleteTempFolder(); }
public void PasteDataToPad(string fileName) { var file = Path.Combine(HelperConstants.getExeAssemblyPath(), "Inputs", fileName); var fileContent = File.ReadAllText(file); if (decimalSeparator.Equals(".")) { fileContent = fileContent.Replace(",", "."); } System.Windows.Clipboard.SetText(fileContent); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'NewProtocolWizard.TabPagePad.ClearButton' at 41;15.", repo.NewProtocolWizard.TabPagePad.ClearButtonInfo, new RecordItemIndex(33)); repo.NewProtocolWizard.TabPagePad.ClearButton.Click("41;15"); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'NewProtocolWizard.TabPagePad.SomeElement' at 86;52.", repo.NewProtocolWizard.TabPagePad.SomeElementInfo, new RecordItemIndex(34)); repo.NewProtocolWizard.TabPagePad.SomeElement.Click("86;52"); Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'NewProtocolWizard.TabPagePad.PasteButton' at 44;13.", repo.NewProtocolWizard.TabPagePad.PasteButtonInfo, new RecordItemIndex(35)); repo.NewProtocolWizard.TabPagePad.PasteButton.Click("44;13"); }
public void CheckQCInProtocol(string protocolName) { ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractProtocolTo(null, null, protocolName); var tempFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "temp"); var resultsFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"MyAssays\Results\"); var settingsQC = Directory.GetFiles(tempFolder, "settings.qc.xml"); if (settingsQC.Length == 0) { Report.Failure("Protocol does not contains a settings.qc.xml file."); } else { var actualQC = File.ReadAllText(settingsQC.First()).Replace(" ", "").Replace("\r\n", ""); var expectedQC = File.ReadAllText(Path.Combine(HelperConstants.getExeAssemblyPath(), @"ExpectedRunDetails\QualityControl\SettingsMTA.qc.txt")).Replace("PATH_TO_RESULTS", resultsFolder) .Replace(" ", "") .Replace("\r\n", ""); Report.Info("Actual xml:" + actualQC); Report.Info("Expected xml:" + expectedQC); if (actualQC.Equals(expectedQC.Replace("BIT_NUM", "8")) || actualQC.Equals(expectedQC.Replace("BIT_NUM", "16"))) { Report.Success("QC analysis report contains selected table output types for observation."); } else { Report.Failure("QC analysis settings file is not as expected."); } } ExtractProtocolHelper.DeleteTempFolder(); }
public void WaitForCalculation() { HelperConstants.waitForCalculation(); }
public void CopyToClipboard(string addedPath) { var pathToText = Path.Combine(HelperConstants.getExeAssemblyPath(), addedPath); System.Windows.Clipboard.SetText(File.ReadAllText(pathToText)); }
public void EnterFileToImport(Ranorex.Adapter adapter) { adapter.Click(); Keyboard.Press(Path.Combine(HelperConstants.getExeAssemblyPath(), @"Inputs\ImportMeasurements\ELISA Absorbance_20180126_145323.xlsx")); }