< prev index next >

tools/SharedTestUtilsOpen/src/test/javaclient/shared/TestUtil.java

Print this page
rev 320 : 8151500: [TEST] Implement multiple golden image support
Summary: Makes possible using any number of golden images.

*** 1,7 **** /* ! * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 30,47 **** import javafx.scene.Scene; import javafx.stage.Stage; import javafx.stage.Window; import org.jemmy.TimeoutExpiredException; import org.jemmy.control.Wrap; - import org.jemmy.env.Timeout; import org.jemmy.fx.ByWindowType; import org.jemmy.fx.Root; - import org.jemmy.image.Image; import org.jemmy.timing.State; - import org.jemmy.timing.Waiter; import test.javaclient.shared.description.TreeNode; ! import test.javaclient.shared.screenshots.ImagesManager; /** * Utility methods * * @author Sergey Grinev --- 30,44 ---- import javafx.scene.Scene; import javafx.stage.Stage; import javafx.stage.Window; import org.jemmy.TimeoutExpiredException; import org.jemmy.control.Wrap; import org.jemmy.fx.ByWindowType; import org.jemmy.fx.Root; import org.jemmy.timing.State; import test.javaclient.shared.description.TreeNode; ! import test.javaclient.shared.screenshots.GoldenImageManager; /** * Utility methods * * @author Sergey Grinev
*** 125,137 **** * @param testName test name for a test * @param existingWrap wrap for object already placed on UI * @param oneToWaitForWrap wrap for object can be not yet placed on UI */ public static void compareScreenshots(String testName, final Wrap existingWrap, final Wrap oneToWaitForWrap) { ! String existingName = ImagesManager.getInstance().getScreenshotPath(testName + "-existing"); //= RESULT_PATH + testName + "-diff.png"; ! String waitingForName = ImagesManager.getInstance().getScreenshotPath(testName + "-waitingFor"); ! String diffName = ImagesManager.getInstance().getScreenshotPath(testName + "-diff"); //= RESULT_PATH + testName + IMAGE_POSTFIX; String OUTPUT = oneToWaitForWrap.getClass().getName() + ".OUTPUT"; try { oneToWaitForWrap.waitState(new State<Object>() { public Object reached() { return (existingWrap.getScreenImage().compareTo(oneToWaitForWrap.getScreenImage()) == null) ? true : null; --- 122,134 ---- * @param testName test name for a test * @param existingWrap wrap for object already placed on UI * @param oneToWaitForWrap wrap for object can be not yet placed on UI */ public static void compareScreenshots(String testName, final Wrap existingWrap, final Wrap oneToWaitForWrap) { ! String existingName = GoldenImageManager.getScreenshotPath(testName + "-existing"); //= RESULT_PATH + testName + "-diff.png"; ! String waitingForName = GoldenImageManager.getScreenshotPath(testName + "-waitingFor"); ! String diffName = GoldenImageManager.getScreenshotPath(testName + "-diff"); //= RESULT_PATH + testName + IMAGE_POSTFIX; String OUTPUT = oneToWaitForWrap.getClass().getName() + ".OUTPUT"; try { oneToWaitForWrap.waitState(new State<Object>() { public Object reached() { return (existingWrap.getScreenImage().compareTo(oneToWaitForWrap.getScreenImage()) == null) ? true : null;
< prev index next >