@Test public void testTakeScreenshotWithTimestampEmptyDestinationSuite() throws Exception { TestSuite ts = mock(TestSuite.class); when(ts.getTestSuiteFolder()).thenReturn(rootpath); when(loader.getTestSuite()).thenReturn(ts); Path result = testling.takeScreenshotWithTimestamp("screenshot-suite", "", null, null); assertRegExMatch(result.toString(), ".*org.sakuli.actions.screenbased." + getDayPrefix() + ".*screenshot_suite.png"); assertTrue(Files.exists(result)); Path tcRoot = Files.createDirectories(rootpath.resolve("testcase_tmp")); TestCase tc = mock(TestCase.class); when(tc.getTcFile()).thenReturn(tcRoot.resolve("tc.js")); when(loader.getCurrentTestCase()).thenReturn(tc); Path result2 = testling.takeScreenshotWithTimestamp("screenshot-tc", "", null, null); assertRegExMatch(result2.toString(), ".*org.sakuli.actions.screenbased.testcase_tmp." + getDayPrefix() + ".*screenshot_tc.png"); assertTrue(Files.exists(result2)); assertNotEquals(result.toString(), result2.toString()); verify(loader, never()).getExceptionHandler(); }
public Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle) { Path folderPath = isEmpty(optFolderPath) ? resolveTakeScreenshotPath(filenamePostfix).getParent() : Paths.get(optFolderPath); return takeScreenshotWithTimestamp( filenamePostfix, folderPath, optFormat, optRectangle); }
ScreenshotActions { public Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle) { Path folderPath = isEmpty(optFolderPath) ? resolveTakeScreenshotPath(filenamePostfix).getParent() : Paths.get(optFolderPath); return takeScreenshotWithTimestamp( filenamePostfix, folderPath, optFormat, optRectangle); } }
ScreenshotActions { public Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle) { Path folderPath = isEmpty(optFolderPath) ? resolveTakeScreenshotPath(filenamePostfix).getParent() : Paths.get(optFolderPath); return takeScreenshotWithTimestamp( filenamePostfix, folderPath, optFormat, optRectangle); } @Autowired  ScreenshotActions(Screen screen, ActionProperties props, @Qualifier("baseLoader") BaseActionLoader baseActionLoader); }
ScreenshotActions { public Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle) { Path folderPath = isEmpty(optFolderPath) ? resolveTakeScreenshotPath(filenamePostfix).getParent() : Paths.get(optFolderPath); return takeScreenshotWithTimestamp( filenamePostfix, folderPath, optFormat, optRectangle); } @Autowired  ScreenshotActions(Screen screen, ActionProperties props, @Qualifier("baseLoader") BaseActionLoader baseActionLoader); Path takeScreenshot(Path picturePath); Path takeScreenshot(String filename, Rectangle rectangle); Path takeScreenshot(Path picturePath, Rectangle rectangle); Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle); Path takeScreenshotWithTimestamp(String message, Path folderPath); Path takeScreenshotWithTimestamp(String message, Path folderPath, String format, Rectangle rectangle); Path takeScreenshotWithTimestampThrowIOException(String message, Path folderPath, String format, Rectangle rectangle); Path resolveTakeScreenshotPath(String filename); }
ScreenshotActions { public Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle) { Path folderPath = isEmpty(optFolderPath) ? resolveTakeScreenshotPath(filenamePostfix).getParent() : Paths.get(optFolderPath); return takeScreenshotWithTimestamp( filenamePostfix, folderPath, optFormat, optRectangle); } @Autowired  ScreenshotActions(Screen screen, ActionProperties props, @Qualifier("baseLoader") BaseActionLoader baseActionLoader); Path takeScreenshot(Path picturePath); Path takeScreenshot(String filename, Rectangle rectangle); Path takeScreenshot(Path picturePath, Rectangle rectangle); Path takeScreenshotWithTimestamp(final String filenamePostfix, final String optFolderPath, final String optFormat, Rectangle optRectangle); Path takeScreenshotWithTimestamp(String message, Path folderPath); Path takeScreenshotWithTimestamp(String message, Path folderPath, String format, Rectangle rectangle); Path takeScreenshotWithTimestampThrowIOException(String message, Path folderPath, String format, Rectangle rectangle); Path resolveTakeScreenshotPath(String filename);  }