public override bool Execute(OpenInput input) { input.CreateMissingSpecFolder(); var reset = new ManualResetEvent(false); using (var runner = new WebApplicationRunner(input)) { runner.Start(); Console.WriteLine("Launching the browser to " + runner.BaseAddress); ProcessLauncher.GotoUrl(runner.BaseAddress); #if NET46 AppDomain.CurrentDomain.DomainUnload += (sender, args) => { runner.SafeDispose(); }; #else System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += context => runner.Dispose(); #endif Console.CancelKeyPress += (s, e) => { Console.WriteLine("Shutdown detected, tearing down the testing harness..."); runner.SafeDispose(); reset.Set(); }; tellUsersWhatToDo(runner.BaseAddress); reset.WaitOne(); } return(true); }
private void launchPage() { var url = Url.Contains("?") ? Url + $"&StorytellerPort={Server.Port}" : $"{Url}?StorytellerPort={Server.Port}"; _process = ProcessLauncher.GotoUrl(url); }
public override bool Execute(OpenInput input) { input.CreateMissingSpecFolder(); using (var app = new ApplicationController(input, input.BuildEngine(), new WebApplicationRunner(input))) { app.Start(); Console.WriteLine("Launching the browser to " + app.Website.BaseAddress); ProcessLauncher.GotoUrl(app.Website.BaseAddress); #if NET46 AppDomain.CurrentDomain.DomainUnload += (sender, args) => { app.SafeDispose(); }; #else System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += context => app.Dispose(); #endif Console.CancelKeyPress += (s, e) => { Console.WriteLine("Shutdown detected, tearing down the testing harness..."); app.SafeDispose(); }; tellUsersWhatToDo(app.Website.BaseAddress); while (true) { var key = Console.ReadKey(); if (key.Key == ConsoleKey.Q) { Console.WriteLine(); Console.WriteLine("Shutting down the Storyteller documentation preview runner...."); app.SafeDispose(); Console.WriteLine("Done, exiting..."); break; } } } return(true); }
public override void HandleMessage(OpenFixtureFile message, IApplication app) { var file = app.Fixtures.FileFor(message.key); if (message.export || !File.Exists(file)) { app.Fixtures.Export(message.key); } try { Console.WriteLine("Trying to open a file editor to " + file); ProcessLauncher.GotoUrl(file); } catch (Exception e) { ConsoleWriter.Write(ConsoleColor.Yellow, "Unable to start an editor for file " + file); } }
public override bool Execute(DocInput input) { var settings = input.ToSettings(); using (var project = new DocProject(settings)) { using (var server = project.LaunchRunner()) { ProcessLauncher.GotoUrl(project.BaseAddress); tellUsersWhatToDo(project.BaseAddress); ConsoleKeyInfo key = Console.ReadKey(); while (key.Key != ConsoleKey.Q) { Console.WriteLine(); Console.WriteLine("Shutting down the Storyteller documentation preview runner...."); Console.WriteLine(); } } } return(true); }
private static void OpenFile(string fileName) { ProcessLauncher.GotoUrl($"file://{fileName}"); }
public override void HandleMessage(CreateFixture message, IApplication app) { var file = app.Fixtures.CreateFixture(message.key); ProcessLauncher.GotoUrl(file); }