public TestSuiteRunner(SeleniumTestsConfiguration configuration, ITestContextProvider testContextProvider)
        {
            searchAssemblies = new[] { Assembly.GetExecutingAssembly() };

            this.Configuration       = configuration;
            this.TestContextProvider = testContextProvider;
            this.WebBrowserPool      = new WebBrowserPool(this);
            this.TestContextAccessor = new TestContextAccessor();

            // load configuration and get all loggers and factories
            LoggerService = CreateLoggerService(searchAssemblies);
            factories     = CreateWebBrowserFactories();

            this.LogInfo("RIGANTI Selenium-Utils Test framework initialized.");
            this.LogVerbose("WebBrowserFactories discovered: ");
            foreach (var factory in factories)
            {
                this.LogVerbose("* " + factory.Key);
            }
            this.LogVerbose("Loggers discovered: ");
            foreach (var logger in LoggerService.Loggers)
            {
                this.LogVerbose("* " + logger.Name);
            }

            // get test configurations
            testConfigurations = GetTestConfigurations();

            this.LogVerbose("Test configurations: ");
            foreach (var testConfiguration in testConfigurations)
            {
                this.LogVerbose($"* [{testConfiguration.BaseUrl}] {testConfiguration.Factory.Name}");
            }
        }
 public static IScenarioProgressNotifier CreateScenarioProgressNotifier(ITestContextProvider fixture)
 {
     if (fixture.TestContext == null)
     {
         throw new InvalidOperationException($"The {nameof(ITestContextProvider.TestContext)} property value is not set.\nPlease ensure that {fixture.GetType()} does not hide {nameof(FeatureFixture)}.{nameof(FeatureFixture.TestContext)} property and if not, report issue for LightBDD.");
     }
     return(new DefaultProgressNotifier(fixture.TestContext.WriteLine));
 }
示例#3
0
        public TestSuiteRunner(SeleniumTestsConfiguration configuration, ITestContextProvider testContextProvider, Action <ServiceFactory, TestSuiteRunner> registerServices = null)
        {
            SearchAssemblies = new List <Assembly>()
            {
                Assembly.GetExecutingAssembly()
            };
            ServiceFactory.RegisterTransient <WebBrowserFactoryResolver <TestSuiteRunner>, WebBrowserFactoryResolver <TestSuiteRunner> >();
            ServiceFactory.RegisterTransient <ResultReportersFactory, ResultReportersFactory>();

            registerServices?.Invoke(ServiceFactory, this);

            this.Configuration        = configuration;
            this.TestContextProvider  = testContextProvider;
            this.WebBrowserPool       = new WebBrowserPool(this);
            this.TestContextAccessor  = new TestContextAccessor();
            ReportingMetadataProvider = new DefaultReportingMetadataProvider(testContextProvider);
        }
示例#4
0
 public DefaultReportingMetadataProvider(ITestContextProvider testContextProvider)
 {
     this.testContextProvider = testContextProvider;
 }