private static void RunFeature(MyArguments args) { var c = $@"exec cucumber -p {args.Profile} features\CPP\common_pages\automatic_pif_policy_runner.feature BROWSER=chrome"; var psi = new ProcessStartInfo(@"C:\RailsInstaller\Ruby1.9.3\bin\bundle.bat", c); psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; psi.WorkingDirectory = GetFeatureRootPath(args.Branch); var proc = Process.Start(psi); var output = proc.StandardOutput.ReadToEnd(); var error = proc.StandardError.ReadToEnd(); proc.WaitForExit(); Console.WriteLine(string.IsNullOrWhiteSpace(output) ? error : output); var result = new TestResult { Symbol = args.Symbol, PolicyNumber = args.Number, Mod = args.Mod, MasterCompany = args.MasterCompany, PCName = Environment.MachineName, Output = string.IsNullOrWhiteSpace(output) ? error : output, Fail = proc.ExitCode != 0, Pass = proc.ExitCode == 0, IsErrorOutput = string.IsNullOrWhiteSpace(output), Completed = DateTime.Now }; result.SetDetails(); new ResultLogger().Log(result); }
private static void BuildFeature(MyArguments args) { var featureText = File.ReadAllText(Path.Combine(GetFeatureRootPath(args.Branch), @"features\CPP\common_pages\automatic_pif_policy_runner_template.feature")); featureText = featureText.Replace("<mco>", args.MasterCompany) .Replace("<policy_number>", args.Number) .Replace("<symbol>", args.Symbol) .Replace("<mod>", args.Mod); File.WriteAllText(Path.Combine(GetFeatureRootPath(args.Branch), @"features\CPP\common_pages\automatic_pif_policy_runner.feature"), featureText); }