-
-
Save testautomationtribe/6150b33769b0a5730b2ace343b5bab67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Chrome; | |
using TechTalk.SpecFlow; | |
namespace TatAuto.Bindings.Hooks | |
{ | |
[Binding] | |
public class GeneralHooks | |
{ | |
private IWebDriver _driver; | |
[BeforeScenario] | |
public void RunBeforeScenario() | |
{ | |
_driver = new ChromeDriver(); | |
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); | |
_driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(10); | |
_driver.Manage().Window.Maximize(); | |
ScenarioContext.Current.Add("currentDriver", _driver); | |
} | |
[AfterScenario] | |
public void RunAfterScenario() | |
{ | |
_driver?.Quit(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment