首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法运行实习生自动化测试示例

无法运行实习生自动化测试示例
EN

Stack Overflow用户
提问于 2015-01-27 12:48:27
回答 1查看 79关注 0票数 0

我尝试运行简单的实习生自动化测试示例,如下所示:

代码语言:javascript
复制
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');
                });
        }
    });
});

这应该是一件简单的事情。但是,当我尝试通过命令行运行配置时,我遇到了一个问题。

下面是我的配置片段:

代码语言:javascript
复制
// 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' ],

我想知道我做错了什么,以至于测试不会被编译。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2015-01-27 13:28:47

不能将功能测试加载到单元测试系统中。注意你粘贴的代码中的注释,上面写着“非功能性”。在非功能性测试中没有this.remote

另外,请注意模块ID不是文件系统路径。

您的配置应为:

代码语言:javascript
复制
// 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' ],
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28163442

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档