Skip to content

hangar18rip/h18.SeleniumWithSpecFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

h18.SeleniumWithSpecFlow

This package offers basic implementation to use Selenium features with SpecFlow and MSTest framework

Build Status Quality Gate Status

Get from NuGet

Implementation

This package provides the base implementation of a SpecFlow binding and a configuration for this binding

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.

Configuration

The configuration allows to control the behavior of the binding :

  • Browser state initial
  • Screenshot management
  • ...

Configure the binding

[BeforeScenario]
public void BeforeScenario()
{
    var conf = new h18.SeleniumWithSpecFlow.Edge.EdgeHookConfiguration();
    // Register configuration into ScenarioContext
    Context.Set(conf, h18.SeleniumWithSpecFlow.Keys.DriverConfigurationRegistrationKey);
}

Get the configured Driver

[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);
}

Implementations

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published