Example #1
0
        public void Execute()
        {
            var browsers = ConfigurationManager.AppSettings["browsers"].Split(',');
            foreach (var browser in browsers)
            {

                ExcelRepository target = new ExcelRepository();
                TestManager manager = new TestManager(target);
                string masterfile = Path.IsPathRooted(ConfigurationManager.AppSettings["masterfile"]) ? ConfigurationManager.AppSettings["masterfile"] :
                    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["masterfile"]);
                string sequenceFilename = Path.IsPathRooted(ConfigurationManager.AppSettings["sequencefile"]) ? ConfigurationManager.AppSettings["sequencefile"] :
                    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["sequencefile"]);
                string uimapFilename = Path.IsPathRooted(ConfigurationManager.AppSettings["uimapfile"]) ? ConfigurationManager.AppSettings["uimapfile"] :
                    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["uimapfile"]);
                string dataDirectory = Path.IsPathRooted(ConfigurationManager.AppSettings["datadirectory"]) ? ConfigurationManager.AppSettings["datadirectory"] :
                    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["datadirectory"]);
                string resultsFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Results");
                var config = new WebAutoConfiguration();
                config.DataDirectory = dataDirectory;
                config.UIMapFile = uimapFilename;
                config.ResultsFolder = resultsFolder;
                config.Browser = browser.Trim();
                config.FileExtension = ".xlsx";

                manager.Execute(target.GetTestSuites(masterfile, sequenceFilename), config);
            }
        }
 public void GetTestSuites()
 {
     ExcelRepository target = new ExcelRepository(); // TODO: Initialize to an appropriate value
     string filename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..//..//TestFiles//master.xlsx");
     string filename2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..//..//TestFiles//sequences.xlsx");
     Assert.IsTrue(File.Exists(filename), "file doesnt exist " + filename);
     var result = target.GetTestSuites(filename, filename2);
     Assert.AreNotEqual(result.Length, 0);
 }