title: Testing ASP.NET Core app using Protractor in Visual Studio 2015
body: <p>I've got a ASP.NET Core Project based on the angular2 template from the core template pack. I added a second <a href="http://dotnetthoughts.net/end-to-end-testing-angularjs-apps-with-xunit-protractor-net/" rel="nofollow noreferrer">project with xunit and protractor</a> to run unit test against my main app. </p>
  
  <p>Both work nicely alone, there is just one small thing I miss:</p>
  
  <p>When I want to run the protractor tests I need to host the main project somewhere manually. If I don't host the main project manually it does not run, so all the Tests fail because my page is unreachable.</p>
  
  <p>I probably need to start the main app / project somehow from the test, but I got no idea how. All examples for protractor run against some already running Homepages, none does run against some other project.</p>
  
  <p>How do I start the main ASP.NET Core Project from my test Project, so it is running for testing?</p>
  
  <p>Weird thing is: after I started the main app once using Strg+F5 protractor with ChromeDriver will find the homepage of the app. But I need to run it once manually for the tests to work...</p>
  
  <pre><code>public class EndToEndTests : IDisposable
  {
    private const string Url = "https://localhost:44391/";
    private readonly IWebDriver _driver;
    private readonly NgWebDriver _browser;
  
    public EndToEndTests()
    {
  // TODO: somehow get the ASP.NET Core project up and running
      _driver = new ChromeDriver(@"\test\ChromeDriver");
      _driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10));
      _browser = new NgWebDriver(_driver);
    }
  
    public void Dispose()
    {
      _driver.Quit();
    }
  
    [Fact(DisplayName = "Has a title")]
    public void HasATitle()
    {
      _browser.Url = Url;
      Assert.Equal("My page", _browser.Title);
    }
  </code></pre>