PrintScreen code samples moved to core-java module

This commit is contained in:
Sameera
2016-10-20 23:10:17 +05:30
parent c1017af8a0
commit 511d96614d
3 changed files with 2 additions and 28 deletions

View File

@@ -0,0 +1,39 @@
package com.baeldung.printscreen;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import static org.junit.Assert.*;
public class ScreenshotTest {
private Screenshot screenshot;
private String filePath;
private String fileName;
private String fileType;
private File file;
@Before
public void setUp() throws Exception {
filePath = "";
fileName = "Screenshot";
fileType = "jpg";
file = new File(filePath + fileName + "." + fileType);
screenshot = new Screenshot(filePath, fileName, fileType, 2000);
}
@Test
public void testGetScreenshot() throws Exception {
screenshot.getScreenshot();
assertTrue(file.exists());
}
@After
public void tearDown() throws Exception {
file.delete();
}
}