Пример #1
0
        internal VisualGridEyes(ISeleniumConfigurationProvider configurationProvider, VisualGridRunner visualGridRunner)
        {
            ArgumentGuard.NotNull(visualGridRunner, nameof(visualGridRunner));
            if (visualGridRunner.GetAllTestResultsAlreadyCalled)
            {
                throw new InvalidOperationException("Runner already returned its results");
            }
            configProvider_ = configurationProvider;
            Logger          = visualGridRunner.Logger;
            runner_         = visualGridRunner;

            IDebugResourceWriter drw = runner_.DebugResourceWriter;

            Ufg.IDebugResourceWriter ufgDrw = EyesSeleniumUtils.ConvertDebugResourceWriter(drw);
            debugResourceWriter_ = ufgDrw;
        }
        private void Init(string suiteName)
        {
            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
            int concurrentOpenSessions = ((IRunnerOptionsInternal)runnerOptions_).GetConcurrency();

            suiteName_ = suiteName;
            if (suiteName_ == null)
            {
                StackFrame frame = new StackFrame(2);
                suiteName_ = frame.GetMethod().DeclaringType.Name;
            }

            IDictionary <string, RGridResource>     resourcesCacheMap     = ((IVisualGridRunner)this).ResourcesCacheMap;
            IDictionary <string, HashSet <string> > cachedResourceMapping = ((IVisualGridRunner)this).CachedResourceMapping;

            Ufg.IDebugResourceWriter drw = EyesSeleniumUtils.ConvertDebugResourceWriter(DebugResourceWriter);

            eyesServiceRunner_ = new EyesServiceRunner(Logger, ServerConnector, allEyes_, concurrentOpenSessions,
                                                       drw, resourcesCacheMap, this, suiteName_);
            eyesServiceRunner_.Start();
        }