Exemple #1
0
        private MatchResult PerformMatch_(IList <Trigger> userInputs,
                                          AppOutputWithScreenshot appOutput,
                                          string tag, bool replaceLast,
                                          ImageMatchSettings imageMatchSettings,
                                          string agentSetupStr,
                                          string source,
                                          string renderId)
        {
            // Prepare match data.
            MatchWindowData data = new MatchWindowData(appOutput.AppOutput, tag, agentSetupStr);

            data.IgnoreMismatch         = false;
            data.Options                = new ImageMatchOptions(imageMatchSettings);
            data.Options.Name           = tag;
            data.Options.UserInputs     = userInputs;
            data.Options.IgnoreMismatch = false;
            data.Options.IgnoreMatch    = false;
            data.Options.ForceMismatch  = false;
            data.Options.ForceMatch     = false;
            data.Options.Source         = source;
            data.Options.RenderId       = renderId;
            data.Options.ReplaceLast    = replaceLast;
            data.RenderId               = renderId;

            return(serverConnector_.MatchWindow(runningSession_, data));
        }
Exemple #2
0
        public MatchResult PerformMatch(IList <Trigger> userInputs,
                                        AppOutputWithScreenshot appOutput,
                                        string tag, bool replaceLast,
                                        ImageMatchSettings imageMatchSettings,
                                        EyesBase eyes, string source)
        {
            // called from regular flow and from check many flow.
            string agentSetupStr = eyes.GetAgentSetupString();

            return(PerformMatch_(userInputs, appOutput, tag, replaceLast, imageMatchSettings, agentSetupStr, source, null));
        }
Exemple #3
0
        public MatchResult PerformMatch(AppOutputWithScreenshot appOutput,
                                        string tag, bool ignoreMismatch,
                                        ICheckSettingsInternal checkSettingsInternal,
                                        ImageMatchSettings imageMatchSettings,
                                        IList <IRegion> regions,
                                        IList <VisualGridSelector[]> regionSelectors,
                                        EyesBase eyes, string source, string renderId = null)
        {
            EyesScreenshot screenshot    = appOutput.Screenshot;
            string         agentSetupStr = eyes.GetAgentSetupString();

            CollectRegions_(imageMatchSettings, regions, regionSelectors);
            CollectRegions_(imageMatchSettings, checkSettingsInternal);
            return(PerformMatch_(new Trigger[0], appOutput, tag, ignoreMismatch, imageMatchSettings, agentSetupStr, source, renderId));
        }
Exemple #4
0
        private EyesScreenshot TryTakingScreenshot_(Rectangle?region, IList <Trigger> userInputs, string tag, bool replaceLast, ICheckSettingsInternal checkSettingsInternal,
                                                    ImageMatchSettings imageMatchSettings, string source)
        {
            Logger_.Verbose("enter");
            AppOutputWithScreenshot appOutputWithScreenshot = GetAppOutput_(region, checkSettingsInternal, imageMatchSettings);
            EyesScreenshot          screenshot = appOutputWithScreenshot.Screenshot;
            AppOutput appOutput             = appOutputWithScreenshot.AppOutput;
            string    currentScreenshotHash = screenshot == null ? appOutput.ScreenshotUrl : CommonUtils.GetSha256Hash(appOutput.ScreenshotBytes);

            Logger_.Verbose("current screenshot hash: {0}", currentScreenshotHash);
            if (lastScreenshotHash_ == currentScreenshotHash)
            {
                Logger_.Log("second screenshot is the same as the first, no point in uploading to server.");
            }
            else
            {
                matchResult_ = PerformMatch(userInputs, appOutputWithScreenshot, tag,
                                            replaceLast || (lastScreenshotHash_ != null), imageMatchSettings, eyes_, source);
                lastScreenshotHash_ = currentScreenshotHash;
            }
            Logger_.Verbose("exit");
            return(screenshot);
        }