< prev index next >
functional/ControlsTests/test/javafx/commons/ControlsTest.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) 2014, 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) 2014, 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
*** 43,54 ****
import org.jemmy.image.pixel.Raster;
import org.jemmy.image.pixel.RasterComparator;
import org.jemmy.timing.State;
import org.jemmy.timing.Waiter;
import org.junit.Assert;
! import test.javaclient.shared.screenshots.ImagesManager;
!
/**
*
* @author Dmitry Zinkevich <dmitry.zinkevich@oracle.com>
*/
@RunWith(FilteredTestRunner.class)
--- 43,53 ----
import org.jemmy.image.pixel.Raster;
import org.jemmy.image.pixel.RasterComparator;
import org.jemmy.timing.State;
import org.jemmy.timing.Waiter;
import org.junit.Assert;
! import test.javaclient.shared.screenshots.GoldenImageManager;
/**
*
* @author Dmitry Zinkevich <dmitry.zinkevich@oracle.com>
*/
@RunWith(FilteredTestRunner.class)
*** 119,139 ****
});
} catch (Exception ex) {
System.out.println(ex.getMessage());
Image imgTranslucent = testedControl.getScreenImage();
! String screenshotPath = ImagesManager.getInstance().getScreenshotPath(String.format("%s_img_opacity40", nodeName));
imgOpacity40.save(screenshotPath);
! screenshotPath = ImagesManager.getInstance().getScreenshotPath(String.format("%s_control_opacity40", nodeName));
imgTranslucent.save(screenshotPath);
Image diff = Environment.getEnvironment().getProperty(ImageComparator.class).compare(imgOpacity40, imgTranslucent);
Assert.assertTrue(diff != null);
! screenshotPath = ImagesManager.getInstance().getScreenshotPath(String.format("%s_diff", nodeName));
diff.save(screenshotPath);
}
setPropertyBySlider(settingType, TestedProperties.opacity, 1);
}
clearCache();
--- 118,138 ----
});
} catch (Exception ex) {
System.out.println(ex.getMessage());
Image imgTranslucent = testedControl.getScreenImage();
! String screenshotPath = GoldenImageManager.getScreenshotPath(String.format("%s_img_opacity40", nodeName));
imgOpacity40.save(screenshotPath);
! screenshotPath = GoldenImageManager.getScreenshotPath(String.format("%s_control_opacity40", nodeName));
imgTranslucent.save(screenshotPath);
Image diff = Environment.getEnvironment().getProperty(ImageComparator.class).compare(imgOpacity40, imgTranslucent);
Assert.assertTrue(diff != null);
! screenshotPath = GoldenImageManager.getScreenshotPath(String.format("%s_diff", nodeName));
diff.save(screenshotPath);
}
setPropertyBySlider(settingType, TestedProperties.opacity, 1);
}
clearCache();
< prev index next >