我正在尝试使用量角器编写基本的 e2e 测试。下面是我的测试。我添加了 console.log 以查看我是否可以访问 URL,日志中的输出显示调用的结果browser.getLocationAbsUrl()
是一个“待定”( Promise::105 {[[PromiseStatus]]: "pending"}
) 的承诺。我得到的错误是Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
describe "routes", () ->
it "should automatically redirect to / when location hash/fragment is empty", () ->
browser.navigate 'index.html'
console.log browser.getLocationAbsUrl()
expect(browser.getLocationAbsUrl()).toBe '/'
我的配置文件很简单:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
baseUrl: 'http://localhost:8000',
capabilities: {
'browserName': 'chrome'
},
troubleshoot: true,
specs: ['app/spec/e2e/**/*.coffee']
}