Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created October 2, 2016 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/c7dfc7a86bbcd20dea24b921e77a51a3 to your computer and use it in GitHub Desktop.
Save angelovstanton/c7dfc7a86bbcd20dea24b921e77a51a3 to your computer and use it in GitHub Desktop.
public class TestExecutionEngine :
BaseTestExecutionEngine<WebDriverExecutionEngineAttribute>
{
public TestExecutionEngine(IUnityContainer container) : base(container)
{
}
public override void RegisterDependencies(Browsers executionBrowserType)
{
var browserSettings = new BrowserSettings(executionBrowserType);
this.driver = new SeleniumDriver(this.container, browserSettings);
this.container.RegisterType<IButton, Button>();
this.container.RegisterType<ITextBox, TextBox>();
this.container.RegisterType<IDiv, Div>();
this.container.RegisterType<ISearch, Search>();
this.container.RegisterType<IInputSubmit, InputSubmit>();
this.container.RegisterInstance<IDriver>(this.driver);
this.container.RegisterInstance<IBrowser>(this.driver);
this.container.RegisterInstance<ICookieService>(this.driver);
this.container.RegisterInstance<IDialogService>(this.driver);
this.container.RegisterInstance<IJavaScriptInvoker>(this.driver);
this.container.RegisterInstance<INavigationService>(this.driver);
this.container.RegisterInstance<IElementFinder>(this.driver);
# region 11. Failed Tests Аnalysis - Decorator Design Pattern
this.container.RegisterType<IEnumerable<
IExceptionAnalysationHandler>, IExceptionAnalysationHandler[]>();
this.container.RegisterType<IUiExceptionAnalyser, UiExceptionAnalyser>();
this.container.RegisterType<IElementFinder, ExceptionAnalyzedElementFinder>(
new InjectionFactory(x => new ExceptionAnalyzedElementFinder(
this.driver, this.container.Resolve<IUiExceptionAnalyser>())));
this.container.RegisterType<INavigationService, ExceptionAnalyzedNavigationService>(
new InjectionFactory(x => new ExceptionAnalyzedNavigationService(
this.driver, this.container.Resolve<IUiExceptionAnalyser>())));
#endregion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment