我尝试运行简单的实习生自动化测试示例,如下所示:
define([
'intern!object',
'intern/chai!assert',
'require'
], function (registerSuite, assert, require) {
registerSuite({
name: 'index',
'Greeting': function () {
return this.remote
.get(require.toUrl('index.html'))
.setFindTimeout(5000)
.findByCssSelector('body.loaded')
.findById('nameField')
.click()
.type('Elaine')
.end()
.findByCssSelector('#loginForm input[type=submit]')
.click()
.end()
.findById('greeting')
.getVisibleText()
.then(function (text) {
assert.strictEqual(text, 'Hello, ElaineqW!', 'Greeting should be displayed when the form is submitted');
});
}
});
});这应该是一件简单的事情。但是,当我尝试通过命令行运行配置时,我遇到了一个问题。

下面是我的配置片段:
// Non-functional test suite(s) to run in each browser
suites: [ 'C:/internKE/tests/functional/index' ],
// Functional test suite(s) to run in each browser once non-functional tests are completed
functionalSuites: [ 'C:/internKE/tests/functional/index' ],我想知道我做错了什么,以至于测试不会被编译。
谢谢
发布于 2015-01-27 13:28:47
不能将功能测试加载到单元测试系统中。注意你粘贴的代码中的注释,上面写着“非功能性”。在非功能性测试中没有this.remote。
另外,请注意模块ID不是文件系统路径。
您的配置应为:
// Non-functional test suite(s) to run in each browser
suites: [],
// Functional test suite(s) to run in each browser once non-functional tests are completed
functionalSuites: [ 'tests/functional/index' ],https://stackoverflow.com/questions/28163442
复制相似问题