public void testRun() throws Throwable {
      addMocksToTestContextLocalDef(caseDef.getLocalDefs());

      open(getUrl(), Mode.AUTOJSTEST);

      String ret =
          (String)
              auraUITestingUtil.getEval(
                  String.format(
                      "return window.aura.test.run('%s', '%s', 30)",
                      AuraTextUtil.escapeForJavascriptString(caseDef.getName()),
                      AuraTextUtil.escapeForJavascriptString(suite.getCode())));

      if (ret != null && !"null".equals(ret)) {
        @SuppressWarnings("unchecked")
        Map<String, Object> e = (Map<String, Object>) new JsonReader().read(ret);
        fail((String) e.get("message"));
      }
      // Actions run on servers need special handling because their call
      // back methods are called asynchronously.
      // This check is to make sure all such calls were complete
      waitForCondition("return window.aura.test.isComplete()", 30);
    }