/** * Internal function for performing an image verification for a region of * a buffered image. * * @param regionProvider The region for which verification will be * performed. see * {@link #checkWindowBase(RegionProvider, String, * boolean, int)}. * @param tag An optional tag to be associated with the validation * checkpoint. * @param ignoreMismatch True if the server should ignore a negative * result for the visual validation. * @return True if the image matched the expected output, false otherwise. */ private boolean checkImage_(RegionProvider regionProvider, String tag, boolean ignoreMismatch) { // Set the title to be linked to the screenshot. title = (tag != null) ? tag : ""; MatchResult mr = checkWindowBase(regionProvider, tag, ignoreMismatch); return mr.getAsExpected(); } }
result = new MatchResult(); result.setAsExpected(true); return result; logger.verbose("MatchWindow Done!"); if (!result.getAsExpected()) { if (!ignoreMismatch) { clearUserInputs(); lastScreenshot = result.getScreenshot(); lastScreenshot = result.getScreenshot();
while ((retry < retryTimeout) && !matchResult.getAsExpected()) { if (!matchResult.getAsExpected()) { logger.verbose(String.format("Completed in %.2f seconds", elapsedTime)); matchResult.setScreenshot(appOutput.getScreenshot()); return matchResult;
result = new MatchResult(); validationResult.setAsExpected(result.getAsExpected()); getSessionEventHandlers().validationEnded(getAUTSessionId(), validationInfo.getValidationId(), validationResult);
result = new MatchResult(); result.setAsExpected(true); return result; logger.verbose("MatchWindow Done!"); if (!result.getAsExpected()) { if (!ignoreMismatch) { clearUserInputs(); lastScreenshot = result.getScreenshot(); lastScreenshot = result.getScreenshot();
while ((retry < retryTimeout) && !matchResult.getAsExpected()) { if (!matchResult.getAsExpected()) { logger.verbose(String.format("Completed in %.2f seconds", elapsedTime)); matchResult.setScreenshot(appOutput.getScreenshot()); return matchResult;
result = new MatchResult(); result.setAsExpected(true); return result; logger.verbose("MatchWindow Done!"); if (!result.getAsExpected()) { if (!ignoreMismatch) { clearUserInputs(); lastScreenshot = result.getScreenshot(); lastScreenshot = result.getScreenshot();
while (!matchResult.getAsExpected() && !Thread.interrupted()) { if (matchResult.getAsExpected()) { theMatch = currentMatchData; } else {
while ((retry < retryTimeout) && !matchResult.getAsExpected()) { if (!matchResult.getAsExpected()) { logger.verbose(String.format("Completed in %.2f seconds", elapsedTime)); matchResult.setScreenshot(appOutput.getScreenshot()); return matchResult;
while (!matchResult.getAsExpected() && !Thread.interrupted()) { if (matchResult.getAsExpected()) { theMatch = currentMatchData; } else {
dataToSearch.get(currentMatchIndex).getMatchWindowData()); if (matchResult.getAsExpected()) { logger.verbose("Match!"); earliestMatchIndex = currentMatchIndex; (toIndex == currentMatchIndex && !matchResult.getAsExpected())) { if (matchResult.getAsExpected()) { toIndex = currentMatchIndex - 1; } else {
while (!matchResult.getAsExpected() && !Thread.interrupted()) { if (matchResult.getAsExpected()) { theMatch = currentMatchData; } else {
dataToSearch.get(currentMatchIndex).getMatchWindowData()); if (matchResult.getAsExpected()) { logger.verbose("Match!"); earliestMatchIndex = currentMatchIndex; (toIndex == currentMatchIndex && !matchResult.getAsExpected())) { if (matchResult.getAsExpected()) { toIndex = currentMatchIndex - 1; } else {
dataToSearch.get(currentMatchIndex).getMatchWindowData()); if (matchResult.getAsExpected()) { logger.verbose("Match!"); earliestMatchIndex = currentMatchIndex; (toIndex == currentMatchIndex && !matchResult.getAsExpected())) { if (matchResult.getAsExpected()) { toIndex = currentMatchIndex - 1; } else {
/** * Internal function for performing an image verification for a region of * a buffered image. * @param regionProvider The region for which verification will be * performed. see {@link #checkWindowBase(RegionProvider, String, boolean, int)}. * @param tag An optional tag to be associated with the validation checkpoint. * @param ignoreMismatch True if the server should ignore a negative result for the visual validation. * @param checkSettings The settings to use when checking the image. * @return True if the image matched the expected output, false otherwise. */ private boolean checkImage_(RegionProvider regionProvider, String tag, boolean ignoreMismatch, ICheckSettings checkSettings) { // Set the title to be linked to the screenshot. title = (tag != null) ? tag : ""; ValidationInfo validationInfo = this.fireValidationWillStartEvent(tag); MatchResult result = checkWindowBase(regionProvider, tag, ignoreMismatch, checkSettings); ValidationResult validationResult = new ValidationResult(); validationResult.setAsExpected(result.getAsExpected()); getSessionEventHandlers().validationEnded(getAUTSessionId(), validationInfo.getValidationId(), validationResult); return result.getAsExpected(); } }
private void matchRegion(ICheckSettingsInternal checkSettingsInternal, MatchWindowTask mwt, List<EyesScreenshot> subScreenshots) { String name = checkSettingsInternal.getName(); for (EyesScreenshot subScreenshot : subScreenshots) { debugScreenshotsProvider.save(subScreenshot.getImage(), String.format("subscreenshot_%s", name)); ImageMatchSettings ims = mwt.createImageMatchSettings(checkSettingsInternal, subScreenshot); AppOutput appOutput = new AppOutput(name, ImageUtils.base64FromImage(subScreenshot.getImage()), null, null); AppOutputWithScreenshot appOutputWithScreenshot = new AppOutputWithScreenshot(appOutput, subScreenshot); MatchResult matchResult = mwt.performMatch( new Trigger[0], appOutputWithScreenshot, name, false, ims); logger.verbose("matchResult.asExcepted: " + matchResult.getAsExpected()); } }