1
我正尝试编写一个代码,用于使用量角器将其重定向到index.html文件。当我输入终端量角器protractor.conf.js以执行e2e测试时。它表明我这个错误:量角器不推荐使用getLocationAbsUr
W /量角器 -
browser.getLocationAbsUrl()
已过时,请使用browser.getCurrentUrl
代替。
为什么会这样呢?是不是getLocationAbsUrl量角器的话?
的配置量角器
exports.config = {
allScriptsTimeout: 11000,
specs: [
'e2e/*.js'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:3000/',
framework: 'jasmine',
directConnect: true,
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
代码的代码,E2E测试
'use strict';
describe('conFusion App E2E Testing', function() {
it('should automatically redirect to/when location hash/fragment is empty', function() {
browser.get('index.html');
expect(browser.getLocationAbsUrl()).toMatch("/");
});
'expect(browser.getCurrentUrl())。toMatch(“/”);'Use this –