This package offers basic implementation to use Selenium features with SpecFlow and MSTest framework
This package provides the base implementation of a SpecFlow binding and a configuration for this binding
The binding allows to automatically create a screenshot of the browser before and after each step. It also allows to create a screenshot before and after each scenario.
The configuration allows to control the behavior of the binding :
- Browser state initial
- Screenshot management
- ...
[BeforeScenario]
public void BeforeScenario()
{
var conf = new h18.SeleniumWithSpecFlow.Edge.EdgeHookConfiguration();
// Register configuration into ScenarioContext
Context.Set(conf, h18.SeleniumWithSpecFlow.Keys.DriverConfigurationRegistrationKey);
}
[Given(@"I go to the home page")]
public void GivenIGoToTheHomePage()
{
// Get the driver
_driver = Context.Get<IWebDriver>(h18.SeleniumWithSpecFlow.Keys.DriverRegistrationKey);
// Use the driver
_driver.Navigate().GoToUrl(ExecutionContext.Current.ApplicationUri);
}