jjnair / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

new fixture to support pixel color #261

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I need to be able to tell whether a component is painted with a particular
color.

Original issue reported on code.google.com by vnguyen....@gmail.com on 15 Dec 2008 at 3:47

GoogleCodeExporter commented 8 years ago

Original comment by Alex.Rui...@gmail.com on 15 Dec 2008 at 6:39

GoogleCodeExporter commented 8 years ago
Assigned issue to myself.

Original comment by Alex.Rui...@gmail.com on 15 Dec 2008 at 6:40

GoogleCodeExporter commented 8 years ago
I'm not sure if we want to create a fixture for this. The problem is that we 
need a
AWT Robot to do this and FEST has two modes: Robot and AWT. In Robot mode this 
is
easy to do, but not in AWT mode.

There is already a way to do this. Not so obvious nor documented though:

1. Use org.fest.swing.image.ScreenshotTaker to take a screenshot of a component
2. The image is returned as BufferedImage
3. Use one of FEST assert methods (assertThat) to check the color of any pixel 
in the
BufferedImage.

Thanks,
-Alex

Original comment by Alex.Rui...@gmail.com on 18 Dec 2008 at 2:08

GoogleCodeExporter commented 8 years ago
I would like avoid having to work with awt robot.  Your suggestion about
ScreenshotTaker sounds good. I didn't know that it exists.

Original comment by vnguyen....@gmail.com on 19 Dec 2008 at 5:31

GoogleCodeExporter commented 8 years ago
I'm closing this issue. Please feel free to re-open it any time.

Original comment by Alex.Rui...@gmail.com on 16 Jan 2009 at 2:18