Skip to content

Instantly share code, notes, and snippets.

@matthewrwilton
Created February 12, 2017 05:01
Show Gist options
  • Save matthewrwilton/33de0ae07c82a2641ea8a306d65a6f80 to your computer and use it in GitHub Desktop.
Save matthewrwilton/33de0ae07c82a2641ea8a306d65a6f80 to your computer and use it in GitHub Desktop.
[Collection(nameof(WebAppFixture))]
public class _2_Running_A_Web_App
{
/*
* This is a bare minimum example of starting IIS Express to run a web application for testing.
* It uses xUnit collection fixtures to start the web application before running the test.
* Only a single instance of the application is started and is shared between all tests in the collection.
*/
[Fact]
public void Run_Application_And_Navigate_To_Home_Page()
{
using (var driver = new ChromeDriver(ProjectDirectories.GetDriversDirectory()))
{
driver.Navigate().GoToUrl("http://localhost:59837/Home/Index");
driver.FindElementById("hello");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment