gpt4 book ai didi

js-test-driver 不提供静态文件

转载 作者:行者123 更新时间:2023-12-03 21:30:35 25 4
gpt4 key购买 nike

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

我的目录结构是:

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

afile.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 似乎有这个 problem of not serving静态文件。我知道服务器发现文件没问题,因为将 conf 文件中的名称更改为 aFi.html 会引发错误:

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

最佳答案

从字面上看只是解决了它。您需要导航到 http://localhost:9876/test/aFile.html。显然!

关于js-test-driver 不提供静态文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12657701/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com