@BeforeTest
  private void initializeMocks() {
    parentProcessor = mock(CommandProcessor.class);
    when(parentProcessor.doCommand(eq(VALID_COMMAND), Matchers.<String[]>any())).thenReturn(null);
    when(parentProcessor.doCommand(eq(EXCEPTION_THROWING_COMMAND), Matchers.<String[]>any()))
        .thenThrow(new RuntimeException());
    exceptionThrowingScreenshotter = new ExceptionThrowingScreenshotter();

    processor = new ScreenshotHttpCommandProcessor(parentProcessor, exceptionThrowingScreenshotter);
  }
예제 #2
0
  private String executeCommand(String methodName, final String[] values) {
    String output = commandProcessor.doCommand(methodName, values);

    if (output != null && LOG.isDebugEnabled()) {
      LOG.debug("Command processor returned '" + output + "'");
    }

    return output;
  }
예제 #3
0
 private String executeCommand(String methodName, final String[] values) {
   return commandProcessor.doCommand(methodName, values);
 }
예제 #4
0
 private void waitForPageLoadIfNeeded(ExtendedSeleniumCommand command) {
   if (command.isAndWaitCommand()) {
     commandProcessor.doCommand("waitForPageToLoad", new String[] {"" + timeout});
   }
 }