public void ExtractProtocol(string resultFileName) { var reportPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MyAssays\\Results\\"); ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractResultsTo(null, null, Directory.GetFiles(reportPath, "*.assay-results")[0]); }
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 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 checkTemplateDocs(string name) { ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractResultsTo(null, null, name + " (1).assay-results"); string pathTo1Template = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), @"temp\1"); string innerPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), @"temp\inner"); ExtractProtocolHelper.ExtractProtocolTo(pathTo1Template, innerPath, name + ".assay-protocol"); string innerPathFull = Path.Combine(innerPath, "Template.docx"); if (File.Exists(innerPathFull)) { Report.Error("Template.docx file have not to exists in the Version 1."); } else { Report.Success("Template.docx file does not exist in the Version 1."); } Delay.Seconds(2); ExtractProtocolHelper.DeleteTempFolder(); ExtractProtocolHelper.ExtractResultsTo(null, null, name + " (1).assay-results"); string pathTo2Template = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), @"temp\2"); ExtractProtocolHelper.ExtractProtocolTo(pathTo2Template, innerPath, name + ".assay-protocol"); if (!File.Exists(innerPathFull)) { Report.Error("Template.docx file have to exists in the Version 2."); } else { Report.Success("Template.docx file does exist in the Version 2."); } Delay.Seconds(2); ExtractProtocolHelper.DeleteTempFolder(); }
public void extractResult(string name) { ExtractProtocolHelper.ExtractResultsTo(null, null, name + " (1).assay-results"); }