use of org.definitylabs.flue2ent.plugin.screenshot.ScreenshotImage in project flue2ent by DefinityLabs.
the class ScreenshotPluginTest method takeAnd_returnsScreenshotImage.
@Test
public void takeAnd_returnsScreenshotImage() throws Exception {
File file = mock(File.class);
RemoteWebDriver mockedDriver = mock(RemoteWebDriver.class);
when(mockedDriver.getScreenshotAs(OutputType.FILE)).thenReturn(file);
PowerMockito.mockStatic(ImageIO.class);
BufferedImage image = mock(BufferedImage.class);
PowerMockito.when(ImageIO.class, "read", file).thenReturn(image);
ScreenshotPlugin screenshotPlugin = new ScreenshotPlugin(mockedDriver);
ScreenshotImage screenshotImage = screenshotPlugin.takeAnd();
assertThat(screenshotImage).isEqualTo(new ScreenshotImage(image));
}
Aggregations