@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);
  }
Exemplo n.º 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;
  }
Exemplo n.º 3
0
 private String executeCommand(String methodName, final String[] values) {
   return commandProcessor.doCommand(methodName, values);
 }
Exemplo n.º 4
0
 private void waitForPageLoadIfNeeded(ExtendedSeleniumCommand command) {
   if (command.isAndWaitCommand()) {
     commandProcessor.doCommand("waitForPageToLoad", new String[] {"" + timeout});
   }
 }