It's unclear today how the bootstrap method sets up webdrivers, it would be good to be able to provide your own webdriver instance in many cases (newer drivers, custom drivers, parallelll tests).
We have the following setup:
- We have some tests
- We run nunit 3 because it supports parallell execution
- We use browserstack so all our tests are running towards clean instances
We have a base fixture like this:
[TestFixture("Edge", "12.0", "Windows", "10", "TestData.json")]
[TestFixture("IE", "11.0", "Windows", "8.1", "TestData.json")]
[TestFixture("Chrome", "47.0", "Windows", "8.1", "TestData.json")]
[TestFixture("Firefox", "43.0", "Windows", "8.1", "TestData.json")]
[Parallelizable(ParallelScope.Fixtures)]
public class BaseTestFixture : FluentTest
{
public string Browser { get; set; }
public string BrowserVersion { get; set; }
public string Os { get; set; }
public string OsVersion { get; set; }
public string TestDataPath { get; set; }
public Dictionary<string, object> Capabilities { get; set; }
public BaseTestFixture(string browser, string browserVersion, string os, string osVersion, string testDataPath)
{
Browser = browser;
BrowserVersion = browserVersion;
Os = os;
OsVersion = osVersion;
TestDataPath = Path.Combine(@".\Data", testDataPath);
}
[SetUp]
public void Init()
{
ReadTestData();
Capabilities = GetCapabilitites();
SeleniumWebDriver.Bootstrap(
BrowserStack.Uri,
Capabilities);
LogCapabilities();
// Setup settings
FluentSettings.Current.ExpectIsAssert = true;
// Navigate to root page to initialize the provider
I.Open(new Uri(string.Format(TestHelper.BaseUrl, TestData.customer.domain.Value)));
// Show session state
LogCookies();
}
...
I expected each test having it's own driver using this, but it doesn't seem like it since fluentautomaiton is using the TinyIoCContainer.
Would it be possible to have some initialization like this and for fluentautomation to not use any static state sharing between instances?
SeleniumWebDriver.Bootstrap(new MyDriver(Capabilities));
It's unclear today how the bootstrap method sets up webdrivers, it would be good to be able to provide your own webdriver instance in many cases (newer drivers, custom drivers, parallelll tests).
We have the following setup:
We have a base fixture like this:
I expected each test having it's own driver using this, but it doesn't seem like it since fluentautomaiton is using the TinyIoCContainer.
Would it be possible to have some initialization like this and for fluentautomation to not use any static state sharing between instances?