public BrowserWrapper(IWebBrowser browser, IWebDriver driver, ITestInstance testInstance, ScopeOptions scope) { this.browser = browser; this.driver = driver; this.TestInstance = testInstance; ActionWaitTime = browser.Factory?.TestSuiteRunner?.Configuration.TestRunOptions.ActionTimeout ?? 250; ScopeOptions = scope; SetCssSelector(); }
public void shoule_get_instance_with_inline_dependencies() { ListInstance <string> instance = new ListInstance <string>(typeof(IList <string>)); instance.AddInline(new ObjectInstance(typeof(string), "a")); instance.AddInline(new ObjectInstance(typeof(string), "b")); ConstructorInstance @object = new ConstructorInstance(typeof(ITestInstance), typeof(TestInstance), ServiceLifetime.Transient); @object.AddInline(instance); IContainer container = new Container(p => { p.For <ITestInstance>().Use(@object); }); ITestInstance value = container.GetInstance <ITestInstance>(); value.Data.ShouldHaveTheSameElementsAs(new string[] { "a", "b" }); }
public override async Task Initialize(TestContext ctx, CancellationToken cancellationToken) { if (customHost == null) { if (UseFixtureInstance) { customHost = (ITestHost <ITestInstance>)GetFixtureInstance().Instance; } else if (HostType != null) { customHost = (ITestHost <ITestInstance>)Activator.CreateInstance(HostType); } else { throw new InternalErrorException(); } } instance = customHost.CreateInstance(ctx); await instance.Initialize(ctx, cancellationToken); }
public BrowserWrapperLambdaApi(IWebBrowser browser, IWebDriver driver, ITestInstance testInstance, ScopeOptions scope) : base(browser, driver, testInstance, scope) { }