这是我的 refenceConf.js 文件,我在规范中给出了 testapp_spec,js,我把它们都放在了同一个地方
exports.config = {
seleniumServerJar: './selenium/selenium-server-standalone-2.35.0.jar',
seleniumPort: null,
chromeDriver: './selenium/chromedriver',
seleniumArgs: [],
sauceUser: null,
sauceKey: null,
seleniumAddress: null,
specs: [
'testapp_spec.js'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:8000',
rootElement: 'body',
onPrepare: function() {
},
jasmineNodeOpts: {
onComplete: null,
isVerbose: false,
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 30000
}
};
这是我的 testapp_spec.js,我正在编写一个测试用例来显示主页
var util = require('util');
describe('longer example', function() {
var ptor = protractor.getInstance();
beforeEach(function() {
ptor.get('../testapp/app/index.html')
})
it('should load the home page', function() {
body = ptor.findElement(protractor.By.tagName('body'));
body.isDisplayed().then(function() {
expect(body).toBeDefined()
})
})
})
当我执行此操作时,我收到一个错误,例如未定义角度帮助我摆脱此错误