             }
             return stepResult
         }
+    }
+
+    func jsRespondsOK(wv: UIWebView, js: String) -> Bool {
+      let result = wv.stringByEvaluatingJavaScriptFromString(js)
+      if let r = result where r == "true" {
+        return true
+      } else {
+        return false
+      }
     }
 
     /**


        var stepResult = KIFTestStepResult.Wait

        webView.evaluateJavaScript("typeof KIFHelper") { result, _ in
            if result as! String == "undefined" {
                let bundle = NSBundle(forClass: NavigationTests.self)
                let path = bundle.pathForResource("KIFHelper", ofType: "js")!
                let source = try! NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding)
                webView.evaluateJavaScript(source as String, completionHandler: nil)
            }
            stepResult = KIFTestStepResult.Success
        }

        runBlock { _ in return stepResult }


        var stepResult = KIFTestStepResult.Wait

        let escaped = text.stringByReplacingOccurrencesOfString("\"", withString: "\\\"")
        let js = "KIFHelper.enterTextIntoInputWithName(\"\(escaped)\", \"\(inputName)\");"
        stepResult = jsRespondsOK(webView, js: js) ?  KIFTestStepResult.Success : KIFTestStepResult.Failure

        runBlock { error in
            if stepResult == KIFTestStepResult.Failure {
