static public void AssemblyInit(TestContext tc) { var config = new SpecsForMvcConfig(); //SpecsFor.Mvc can spin up an instance of IIS Express to host your app //while the specs are executing. config.UseIISExpress() //To do that, it needs to know the name of the project to test... .With(Project.Named("Bonobo.Git.Server")) .UsePort(20000); //And optionally, it can apply Web.config transformations if you want //it to. //.ApplyWebConfigTransformForConfig("Test"); //In order to leverage the strongly-typed helpers in SpecsFor.Mvc, //you need to tell it about your routes. Here we are just calling //the infrastructure class from our MVC app that builds the RouteTable. config.BuildRoutesUsing(r => Bonobo.Git.Server.App_Start.RouteConfig.RegisterRoutes(r)); //SpecsFor.Mvc can use either Internet Explorer or Firefox. Support //for Chrome is planned for a future release. config.UseBrowser(BrowserDriver.InternetExplorer); config.AuthenticateBeforeEachTestUsing <AuthHandler>(); //Does your application send E-mails? Well, SpecsFor.Mvc can intercept //those while your specifications are executing, enabling you to write //tests against the contents of sent messages. //config.InterceptEmailMessagesOnPort(13565); //The host takes our configuration and performs all the magic. We //need to keep a reference to it so we can shut it down after all //the specifications have executed. _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .UsePort(44300) .UseHttps() .With(Project.Named("SpecsFor.Mvc.Demo")) .CleanupPublishedFiles() .ApplyWebConfigTransformForConfig("Test"); //TODO: The order of registration matters right now, but it shouldn't. config.RegisterArea <TasksAreaRegistration>(); config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r)); //NOTE: You can use whatever browser you want. For build servers, you can check an environment // variable to determine which browser to use, enabling you to re-run the same suite of // tests once for each browser. //config.UseBrowser(BrowserDriver.InternetExplorer); config.UseBrowser(BrowserDriver.Chrome); //config.UseBrowser(BrowserDriver.Firefox); config.InterceptEmailMessagesOnPort(13565); config.AuthenticateBeforeEachTestUsing <StandardAuthenticator>(); config.SetBrowserWindowSize(width: 1024, height: 768); _host = new SpecsForIntegrationHost(config); _host.Start(); }
private void HostStart() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("NHibernate.AspNet.Web")) .CleanupPublishedFiles() .ApplyWebConfigTransformForConfig("Debug"); //TODO: The order of registration matters right now, but it shouldn't. //config.RegisterArea<TasksAreaRegistration>(); config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r)); //NOTE: You can use whatever browser you want. For build servers, you can check an environment // variable to determine which browser to use, enabling you to re-run the same suite of // tests once for each browser. //config.UseBrowser(BrowserDriver.InternetExplorer); //config.UseBrowser(BrowserDriver.Chrome); config.UseBrowser(BrowserDriver.Firefox); config.InterceptEmailMessagesOnPort(13565); //config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>(); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .UsePort(44300) .UseHttps() .With(Project.Named("SpecsFor.Mvc.Demo")) .CleanupPublishedFiles() .ApplyWebConfigTransformForConfig("Test"); //TODO: The order of registration matters right now, but it shouldn't. config.RegisterArea<TasksAreaRegistration>(); config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r)); //NOTE: You can use whatever browser you want. For build servers, you can check an environment // variable to determine which browser to use, enabling you to re-run the same suite of // tests once for each browser. //config.UseBrowser(BrowserDriver.InternetExplorer); config.UseBrowser(BrowserDriver.Chrome); //config.UseBrowser(BrowserDriver.Firefox); config.InterceptEmailMessagesOnPort(13565); config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>(); config.SetBrowserWindowSize(width: 1024, height: 768); _host = new SpecsForIntegrationHost(config); _host.Start(); }
private void HostStart() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("NHibernate.AspNet.Web")) .CleanupPublishedFiles() .ApplyWebConfigTransformForConfig("Debug"); //TODO: The order of registration matters right now, but it shouldn't. //config.RegisterArea<TasksAreaRegistration>(); config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r)); //NOTE: You can use whatever browser you want. For build servers, you can check an environment // variable to determine which browser to use, enabling you to re-run the same suite of // tests once for each browser. //config.UseBrowser(BrowserDriver.InternetExplorer); //config.UseBrowser(BrowserDriver.Chrome); config.UseBrowser(BrowserDriver.Firefox); config.InterceptEmailMessagesOnPort(13565); config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>(); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); //SpecsFor.Mvc can spin up an instance of IIS Express to host your app //while the specs are executing. config.UseIISExpress() //To do that, it needs to know the name of the project to test... .With(Project.Named("MusicInstructor.Web")) //And optionally, it can apply Web.config transformations if you want //it to. .ApplyWebConfigTransformForConfig("Integration"); //In order to leverage the strongly-typed helpers in SpecsFor.Mvc, //you need to tell it about your routes. Here we are just calling //the infrastructure class from our MVC app that builds the RouteTable. config.BuildRoutesUsing(RouteConfig.RegisterRoutes); //SpecsFor.Mvc can use either Internet Explorer or Firefox. Support //for Chrome is planned for a future release. config.UseBrowser(BrowserDriver.InternetExplorer); //Does your application send E-mails? Well, SpecsFor.Mvc can intercept //those while your specifications are executing, enabling you to write //tests against the contents of sent messages. config.InterceptEmailMessagesOnPort(13565); config.Use<SeedDataConfig>(); //The host takes our configuration and performs all the magic. We //need to keep a reference to it so we can shut it down after all //the specifications have executed. _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetUp() { var configuration = new Allors.Adapters.Object.SqlClient.Configuration { ConnectionString = ConfigurationManager.ConnectionStrings["allors"].ConnectionString, ObjectFactory = Config.ObjectFactory, CommandTimeout = 0 }; Config.Default = new Allors.Adapters.Object.SqlClient.Database(configuration); var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("Website")) .CleanupPublishedFiles(); config.BuildRoutesUsing(RouteConfig.RegisterRoutes); //config.UseBrowser(BrowserDriver.InternetExplorer); //config.UseBrowser(BrowserDriver.Chrome); config.UseBrowser(BrowserDriver.Firefox); config.InterceptEmailMessagesOnPort(13565); this.host = new SpecsForIntegrationHost(config); // If you encounter errors then please run the following command at the command prompt // (make sure msbuild is in your path, e.g. use the Visual Studio Command Prompt) // // msbuild [SolutionName].sln /p:DeployOnBuild=true;DeployTarget=Package;_PackageTempDir="C:\github\allors\Base\Tests\bin\x64\Debug\SpecsForMvc.TempIntermediateDir using (var stringWriter = new StringWriter()) { TextWriter console = null; try { console = Console.Out; Console.SetOut(stringWriter); this.host.Start(); } catch (Exception ex) { try { if (this.host != null) { this.host.Shutdown(); } } finally { if (console != null) { Console.SetOut(console); } throw new Exception("Build failed. Output: " + stringWriter, ex); } } } }
static public void AssemblyInit(TestContext tc) { // so we can use the resources in our test even if your language is not en-US Resources.Culture = new System.Globalization.CultureInfo("en-US"); LoadedConfig = LoadConfiguration(); var config = new SpecsForMvcConfig(); //SpecsFor.Mvc can spin up an instance of IIS Express to host your app //while the specs are executing. config.UseIISExpress() //To do that, it needs to know the name of the project to test... .With(Project.Named("Bonobo.Git.Server")) .UsePort(20000) //And optionally, it can apply Web.config transformations if you want //it to. .ApplyWebConfigTransformForConfig("Test") .UseMSBuildExecutableAt(@"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe"); //.UseMSBuildExecutableAt(@"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"); //In order to leverage the strongly-typed helpers in SpecsFor.Mvc, //you need to tell it about your routes. Here we are just calling //the infrastructure class from our MVC app that builds the RouteTable. config.BuildRoutesUsing(r => Bonobo.Git.Server.App_Start.RouteConfig.RegisterRoutes(r)); //SpecsFor.Mvc can use either Internet Explorer or Firefox. Support //for Chrome is planned for a future release. config.UseBrowser(BrowserDriver.InternetExplorer); // We cannot use the authenticate before each step helper // because it is only executed once per class. // So if class A test1 runs, then class B test2 (this leaves us logged out) // then class A test2 (which assumes we are logged in). It will fail //config.AuthenticateBeforeEachTestUsing<AuthHandler>(); //Does your application send E-mails? Well, SpecsFor.Mvc can intercept //those while your specifications are executing, enabling you to write //tests against the contents of sent messages. //config.InterceptEmailMessagesOnPort(13565); // If we set a WithPublishDirectory above, then this would change WebApplicationDirectory = Path.Combine(Directory.GetCurrentDirectory(), "SpecsForMvc.TestSite"); //The host takes our configuration and performs all the magic. We //need to keep a reference to it so we can shut it down after all //the specifications have executed. _host = new SpecsForIntegrationHost(config); //try{ _host.Start(); //} //catch(Exception ex) //{ //} }
public static void InitialHost(TestContext testContext) { SpecsForMvcConfig config = new SpecsForMvcConfig(); config.UseIISExpress().With(Project.Named("ParatabLib")) .CleanupPublishedFiles() .UseMSBuildExecutableAt(@"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe") .ApplyWebConfigTransformForConfig("Debug"); config.BuildRoutesUsing(r => ParatabLib.RouteConfig.RegisterRoutes(r)); config.UseBrowser(BrowserDriver.InternetExplorer); host = new SpecsForIntegrationHost(config); host.Start(); }
public void Startup() { var config = new SpecsForMvcConfig(); config.UseIISExpress().With(Project.Named("HeroicSupport.Web")).ApplyWebConfigTransformForConfig("Test"); config.BuildRoutesUsing(RouteConfig.RegisterRoutes); config.UseBrowser(BrowserDriver.Chrome); config.AuthenticateBeforeEachTestUsing <RegularUserAuthenticator>(); config.InterceptEmailMessagesOnPort(12345); config.Use <SeedDataConfig>(); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public static void AssemblyInit(TestContext tc) { // so we can use the resources in our test even if your language is not en-US Resources.Culture = new System.Globalization.CultureInfo("en-US"); LoadedConfig = LoadConfiguration(); var config = new SpecsForMvcConfig(); //SpecsFor.Mvc can spin up an instance of IIS Express to host your app //while the specs are executing. config.UseIISExpress() //To do that, it needs to know the name of the project to test... .With(Project.Named("Bonobo.Git.Server")) .UsePort(20000) //And optionally, it can apply Web.config transformations if you want //it to. .ApplyWebConfigTransformForConfig("Test"); //In order to leverage the strongly-typed helpers in SpecsFor.Mvc, //you need to tell it about your routes. Here we are just calling //the infrastructure class from our MVC app that builds the RouteTable. config.BuildRoutesUsing(r => Bonobo.Git.Server.App_Start.RouteConfig.RegisterRoutes(r)); //SpecsFor.Mvc can use either Internet Explorer or Firefox. Support //for Chrome is planned for a future release. config.UseBrowser(BrowserDriver.InternetExplorer); // We cannot use the authenticate before each step helper // because it is only executed once per class. // So if class A test1 runs, then class B test2 (this leaves us logged out) // then class A test2 (which assumes we are logged in). It will fail //config.AuthenticateBeforeEachTestUsing<AuthHandler>(); //Does your application send E-mails? Well, SpecsFor.Mvc can intercept //those while your specifications are executing, enabling you to write //tests against the contents of sent messages. //config.InterceptEmailMessagesOnPort(13565); // If we set a WithPublishDirectory above, then this would change WebApplicationDirectory = Path.Combine(Directory.GetCurrentDirectory(), "SpecsForMvc.TestSite"); //The host takes our configuration and performs all the magic. We //need to keep a reference to it so we can shut it down after all //the specifications have executed. _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void Start() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("FailTracker.Web")) .ApplyWebConfigTransformForConfig("Test"); config.BuildRoutesUsing(r => new RouteBootstrapper(r).Execute()); config.Use<TestSeedData>(); config.AuthenticateBeforeEachTestUsing<RegularUserAuthenticator>(); config.InterceptEmailMessagesOnPort(49999); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("SpecsFor.Mvc.Demo")) .ApplyWebConfigTransformForConfig("Test"); config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r)); config.RegisterArea<TasksAreaRegistration>(); config.UseBrowser(BrowserDriver.InternetExplorer); config.InterceptEmailMessagesOnPort(13565); config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>(); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .UsePort(44300) .With(Project.Named("Timesheet")) .CleanupPublishedFiles(); config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(RouteTable.Routes)); //config.UseBrowser(BrowserDriver.InternetExplorer); config.UseBrowser(BrowserDriver.Chrome); //config.UseBrowser(BrowserDriver.Firefox); config.SetBrowserWindowSize(width: 1024, height: 768); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("SpecsFor.Mvc.Demo")) .ApplyWebConfigTransformForConfig("Test"); config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r)); config.RegisterArea <TasksAreaRegistration>(); config.UseBrowser(BrowserDriver.InternetExplorer); config.InterceptEmailMessagesOnPort(13565); config.AuthenticateBeforeEachTestUsing <StandardAuthenticator>(); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public void SetupTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("Xvolt.Web")); //.ApplyWebConfigTransformForConfig("Test"); config.BuildRoutesUsing(RouteConfig.RegisterRoutes); //NOTE: You can use whatever browser you want. For build servers, you can check an environment // variable to determine which browser to use, enabling you to re-run the same suite of // tests once for each browser. //config.UseBrowser(BrowserDriver.InternetExplorer); config.UseBrowser(BrowserDriver.Chrome); //config.UseBrowser(BrowserDriver.Firefox); config.InterceptEmailMessagesOnPort(13565); _host = new SpecsForIntegrationHost(config); _host.Start(); }
public static void SetupTestRun() { if (IsRun) { return; } string msBuild = ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", "16.0"); var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("WeatherApp.FrontEnd")) .UseMSBuildExecutableAt(msBuild); config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r)); config.UseBrowser(BrowserDriver.InternetExplorer); config.PostOperationDelay(new TimeSpan(0, 0, 0, 4)); _host = new SpecsForIntegrationHost(config); _host.Start(); app = new MvcWebApp(); IsRun = true; }
public static void InitializeTestRun() { var config = new SpecsForMvcConfig(); config.UseIISExpress() .With(Project.Named("Demo")) .ApplyWebConfigTransformForConfig("Debug"); config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r)); // If you want to be authenticated for each request, // implement IHandleAuthentication //config.AuthenticateBeforeEachTestUsing<SampleAuthenticator>(); // I originally tried to use Chrome, but the Selenium // Chrome WebDriver, but it must be out of date because // Chrome gave me an error and the tests didn't run (NOTE: // I used the latest Selenium NuGet package as of // 23-08-2014). However, Firefox worked fine, so I used that. config.UseBrowser(BrowserDriver.Firefox); integrationHost = new SpecsForIntegrationHost(config); integrationHost.Start(); }