【发布时间】:2019-08-10 05:33:33
【问题描述】:
我的应用程序在某些时候将<base> 标记注入网站,然后创建一个新的<script> 标记与相对src
例如设置<base href="http://localhost:8080/chapters/de/auth/"> 并注入<script src="build.js" type="text/javascript" /> 导致浏览器从http://localhost:8080/chapters/de/auth/build.js 下载脚本。
在 testcafe 中运行相同的应用程序时,结果会略有不同。插入的碱基是<base href-hammerhead-stored-value="http://localhost:8080/chapters/de/auth/" href="http://localhost:1337/Lj6CFUfNF/http://localhost:8080/chapters/de/auth/">,脚本是<script src-hammerhead-stored-value="build.js" src="http://localhost:1337/Lj6CFUfNF!s!utf-8/http://localhost:8080/account/build.js" type="text/javascript" />
原来的相对网址build.js突然变成了http://localhost:8080/account/build.js,和<base>中设置的不符
知道如何解决这个问题吗?
我在跑步
testcafe:1.1.0
【问题讨论】:
标签: javascript automated-tests e2e-testing testcafe base-tag