public void Check(ICheckSettings settings, IDebugResourceWriter debugResourceWriter, FrameData frameData,
                          IList <VisualGridSelector[]> regionSelectors, IEyesConnector connector, UserAgent userAgent,
                          List <VisualGridTask> taskList, List <VisualGridTask> openTasks, RenderListener listener)
        {
            debugResourceWriter = debugResourceWriter ?? DebugResourceWriter ?? NullDebugResourceWriter.Instance;

            RenderingTask renderingTask = new RenderingTask(connector, frameData, regionSelectors, settings,
                                                            taskList, openTasks, this, userAgent, debugResourceWriter,
                                                            new RenderingTask.RenderTaskListener(
                                                                () =>
            {
                listener.OnRenderSuccess();
                NotifyAllServices();
            },
                                                                (e) =>
            {
                NotifyAllServices();
                listener.OnRenderFailed(e);
            })
                                                            );

            Logger.Verbose("locking renderingTaskList");
            lock (renderingTaskList_)
            {
                renderingTaskList_.Add(renderingTask);
            }
            Logger.Verbose("releasing renderingTaskList");
            NotifyAllServices();
            //Logger.Verbose("exit");
        }
예제 #2
0
        public RenderingTask(IEyesConnector connector, FrameData scriptResult, IList <VisualGridSelector[]> regionSelectors,
                             ICheckSettings settings, List <VisualGridTask> taskList, List <VisualGridTask> openTasks,
                             VisualGridRunner visualGridManager, UserAgent userAgent, IDebugResourceWriter debugResourceWriter, RenderTaskListener listener)
        {
            connector_           = connector;
            result_              = scriptResult;
            regionSelectors_     = regionSelectors;
            settings_            = settings;
            taskList_            = taskList;
            openTasks_           = openTasks;
            renderingInfo_       = visualGridManager.RenderingInfo;
            visualGridManager_   = visualGridManager;
            userAgent_           = userAgent;
            debugResourceWriter_ = debugResourceWriter;

            fetchedCacheMap_       = visualGridManager.CachedResources;
            putResourceCache_      = visualGridManager.PutResourceCache;
            cachedBlobsUrls_       = visualGridManager.CachedBlobsURLs;
            cachedResourceMapping_ = visualGridManager.CachedResourceMapping;

            CollectBlobsFromFrameData_(scriptResult);

            logger_ = visualGridManager_.Logger;

            listeners_.Add(listener);

            string renderingGridForcePut = Environment.GetEnvironmentVariable("APPLITOOLS_RENDERING_GRID_FORCE_PUT");

            isForcePutNeeded_ = "true".Equals(renderingGridForcePut, StringComparison.OrdinalIgnoreCase);
        }
예제 #3
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;
        }
예제 #4
0
        internal VisualGridEyes(ISeleniumConfigurationProvider configurationProvider, VisualGridRunner visualGridRunner)
        {
            ArgumentGuard.NotNull(visualGridRunner, nameof(visualGridRunner));
            configProvider_      = configurationProvider;
            Logger               = visualGridRunner.Logger;
            visualGridRunner_    = visualGridRunner;
            debugResourceWriter_ = visualGridRunner_.DebugResourceWriter ?? NullDebugResourceWriter.Instance;
            testListener_        = new RunningTest.RunningTestListener(
                (task, test) =>
            {
                if (task.TaskType == TaskType.Close || task.TaskType == TaskType.Abort)
                {
                    hasEyesIssuedOpenTasks_ = false;
                }
                listener_?.OnTaskComplete(task, this);
            },

                () => listener_?.OnRenderComplete());
        }