3

我正在使用 js-test-driver 运行一些测试,并想针对 html 文档测试一些代码。我希望将其加载到 iframe 中的当前文档中并针对它测试我的代码,但我什至无法获取文件。

我的目录结构是:

  • simpleJsTestDriver
    • aFile.html
    • aTest.js
    • jsTestDriver.conf
    • jsTestDriver.jar
    • 一些代码.js

文件.html

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    hello
  </body>
</html>

jsTestDriver.conf

server: http://localhost:9876

load:
  - "someCode.js"

test:
  - "aTest.js"

serve:
  - "aFile.html"

运行java -jar JsTestDriver.jar --port 9876 --runnerMode=DEBUG 并导航到http://localhost:9876/aFile.html给出:

HTTP ERROR 404

Problem accessing /aFile.html. Reason:

    Not found.
Powered by Jetty://

我正在使用最新版本的 js-test-driver (1.3.4.b),因为 1.3.4.a 似乎存在不提供静态文件的问题。我知道服务器发现文件没问题,因为更改 conf 文件中的名称会aFi.html引发错误:

Configuration Error: 
Cannot read [
/Users/james/Documents/simpleJSTestDriver/./aFi.html
] derived from aFi.html
4

1 回答 1

3

字面上刚刚解决了它。您需要导航到http://localhost:9876/test/aFile.html。明显地!

于 2012-09-30T00:35:59.863 回答