コード例 #1
0
        private void RestartBrowser(ServicesCollection container)
        {
            var currentBrowserConfiguration = container.Resolve <BrowserConfiguration>("_currentBrowserConfiguration");

            ShutdownBrowser(container);

            // Register the ExecutionEngine that should be used for the current run. Will be used in the next test as PreviousEngineType.
            var testExecutionEngine = new TestExecutionEngine();

            container.RegisterInstance(testExecutionEngine);

            // Register the Browser type that should be used for the current run. Will be used in the next test as PreviousBrowserType.
            container.RegisterInstance(currentBrowserConfiguration);

            // Start the current engine with current browser type.
            testExecutionEngine.StartBrowser(currentBrowserConfiguration, container);
        }
コード例 #2
0
        private void RestartBrowser(ServicesCollection container)
        {
            if (_previousBrowserConfiguration.BrowserType != BrowserType.NotSet) // NotSet = initial browser start
            {
                ShutdownBrowser(container);
            }

            // Register the ExecutionEngine that should be used for the current run. Will be used in the next test as PreviousEngineType.
            var testExecutionEngine = new TestExecutionEngine();

            container.RegisterInstance(testExecutionEngine);

            // Register the Browser type that should be used for the current run. Will be used in the next test as PreviousBrowserType.
            container.RegisterInstance(_currentBrowserConfiguration);

            // Start the current engine with current browser type.
            testExecutionEngine.StartBrowser(_currentBrowserConfiguration, container);
        }