Example #1
0
        private static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                Console.WriteLine("Usage: BrowseraPoller SiteName ApiKey ResultDir");
                return;
            }

            string siteName = args[0];
            string apiKey = args[1];
            string resultDir = args[2];

            Directory.CreateDirectory(resultDir);
            BrowseraTestExecutor executor = new BrowseraTestExecutor(apiKey);
            TestRun result = executor.RunTestOnSiteAndPollResult(siteName, resultDir);
            Console.WriteLine("Finished test run " + result.Name);
        }
        public override bool Execute()
        {
            if (!Directory.Exists(this.ResultDirectory))
            {
                this.Log.LogMessage(MessageImportance.Low, "Creating result directory " + this.ResultDirectory);
                Directory.CreateDirectory(this.ResultDirectory);
            }

            BrowseraTestExecutor executor = new BrowseraTestExecutor(this.ApiKey);
            if (this.createNewSite)
            {
                executor.CreateSiteAndRunTestAndPollResult(this.GetWebsiteTestConfiguration(), this.ResultDirectory);
            }
            else
            {
                executor.RunTestOnSiteAndPollResult(this.SiteName, this.ResultDirectory);
            }

            return true;
        }