Exemplo n.º 1
0
        private bool GetFileNamesToBeUplaoded()
        {
            var localReportFiles = new List <string>();

            if (Directory.Exists(LocationOfReport))
            {
                foreach (string fileName in Directory.GetFiles(LocationOfReport))
                {
                    if (fileName.EndsWith(".xlsx", StringComparison.InvariantCultureIgnoreCase) || fileName.EndsWith(".html", StringComparison.InvariantCultureIgnoreCase))
                    {
                        localReportFiles.Add(fileName);
                    }
                }

                foreach (string imageName in Directory.GetFiles(LocationOfReport + "\\ScreenCapture"))
                {
                    localReportFiles.Add(imageName);
                }
            }

            if (localReportFiles.Count > 0)
            {
                FileManager = new ReportFilesManager(localReportFiles, Configuration.TestReportFilePath);
            }
            return(localReportFiles.Count > 0);
        }
Exemplo n.º 2
0
        public string UploadReport(string testName, List <string> filesToUpload, bool?deleteFilesAfterUpload = null)
        {
            if (Configuration.FTPUploadURL.isNull())
            {
                return(string.Empty);
            }

            if (!deleteFilesAfterUpload.HasValue)
            {
                deleteFilesAfterUpload = Configuration.FTPUpload_DeleteLocalFilesAfterUploadComplete;
            }

            TestName = testName;
            if (Configuration.TestReportFilePath.IsNotNull())
            {
                FileManager = new ReportFilesManager(filesToUpload, Configuration.TestReportFilePath);
                return(UploadLocalFilesFromALists(deleteFilesAfterUpload.Value));
            }

            return(string.Empty);
        }