static int Main(string[] argumentsArray) { var args = GetArguments(argumentsArray); if (args == null || args.RunType == RunType.Help) { Arguments.WriteHelp(); return ExitCode.ErrorOnArgument; } var environment = new LocalEnvironment(); IPhantomJS phantomJS; try { phantomJS = new PhantomJSFactory(args, environment).Create(); } catch (JasmineConfigurationFileDoesNotExistException) { WriteError("Jasmine configuration file for default run could not be found at '{0}'.", environment.GetJasmineConfigurationFileLocation()); Arguments.WriteHelp(); return ExitCode.JasmineConfigurationFileForDefaultRunCouldNotBeFound; } var program = new JasmineRunner(new Tools(environment), phantomJS); var runSucceeded = program.Run(); phantomJS.Dispose(); return runSucceeded ? ExitCode.TestsPassed : ExitCode.TestsFailed; }
static int Main(string[] argumentsArray) { var args = GetArguments(argumentsArray); if (args == null || args.RunType == RunType.Help) { Arguments.WriteHelp(); return(ExitCode.ErrorOnArgument); } var environment = new LocalEnvironment(); IPhantomJS phantomJS; try { phantomJS = new PhantomJSFactory(args, environment).Create(); } catch (JasmineConfigurationFileDoesNotExistException) { WriteError("Jasmine configuration file for default run could not be found at '{0}'.", environment.GetJasmineConfigurationFileLocation()); Arguments.WriteHelp(); return(ExitCode.JasmineConfigurationFileForDefaultRunCouldNotBeFound); } var program = new JasmineRunner(new Tools(environment), phantomJS); var runSucceeded = program.Run(); phantomJS.Dispose(); return(runSucceeded ? ExitCode.TestsPassed : ExitCode.TestsFailed); }
public static Test RunTestWithHtmlFile(string jasmineTestDir, string fileName) { var args = new Arguments { VerbosityLevel = VerbosityLevel.Verbose, Timeout = 10, FileName = Path.Combine(jasmineTestDir, fileName) }; var environment = new LocalEnvironment(); var test = new Test( new PhantomJSFromHtmlFile(environment.GetPhantomJSExeFileLocation(), environment.GetRunJasmineTestFileLocation(), args.VerbosityLevel, args.GetTimeOut(), args.FileName), new Tools(environment)); return test; }
public static Test RunTestWithConfig(string configFile) { var args = new Arguments { VerbosityLevel = VerbosityLevel.Verbose, Timeout = 10, ConfigFile = configFile }; var environment = new LocalEnvironment(); var test = new Test( new PhantomJSFromConfigFile(environment, environment.GetPhantomJSExeFileLocation(), environment.GetRunJasmineTestFileLocation(), args.VerbosityLevel, args.GetTimeOut(), args.ConfigFile), new Tools(environment)); return test; }
public static Test RunTestWithJSFiles(string[] sourceFiles, string[] testFiles) { var args = new Arguments { VerbosityLevel = VerbosityLevel.Verbose, Timeout = 10, SourceFiles = sourceFiles, TestFiles = testFiles }; var environment = new LocalEnvironment(); var test = new Test( new PhantomJSFromJSFiles(environment, environment.GetPhantomJSExeFileLocation(), environment.GetRunJasmineTestFileLocation(), args.VerbosityLevel, args.GetTimeOut(), args.SourceFiles, args.TestFiles), new Tools(environment)); return test; }