Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 实习生功能测试:跳过套件/测试_Javascript_Intern - Fatal编程技术网

Javascript 实习生功能测试:跳过套件/测试

Javascript 实习生功能测试:跳过套件/测试,javascript,intern,Javascript,Intern,我正在用实习生/领足编写一些功能测试。这些测试是端到端测试(也称为故事),它们之间存在某种数据依赖关系。我的意思是,如果前一个测试(test1)没有成功完成,那么测试(即test2)将失败。因此,为了避免运行失败的测试,我想跳过它们(或其中的一部分)。因此,我想知道是否有办法做到这一点 考虑所有test.js文件如下所示: define([ "require", "intern", "intern!object", "../../support/executor

我正在用实习生/领足编写一些功能测试。这些测试是端到端测试(也称为故事),它们之间存在某种数据依赖关系。我的意思是,如果前一个测试(test1)没有成功完成,那么测试(即test2)将失败。因此,为了避免运行失败的测试,我想跳过它们(或其中的一部分)。因此,我想知道是否有办法做到这一点

考虑所有test.js文件如下所示:

define([
    "require",
    "intern", 
    "intern!object",
    "../../support/executor/executor"],
    function(require, intern, registerSuite, Executor) {

    var executor;
    var steps = [

        // set of actions, 
        // like login, click this button,
        // then assert that ....
    ];

    registerSuite(function() {
        return {
            setup: function() {
                executor = new Executor(this.remote, steps.slice(0));
            },

            "Test 1": function() {
                return executor.run();
            },
        };
    });
});

这意味着每个js文件都是一个只包含一个测试的套件。换句话说,这就像我想跳过所有剩余的套件,如果前一个套件失败。

Intern文档指定了一个this.skip方法,该方法可用于单元测试(),也可用于功能/e2e测试

"skipped test":function(){
    this.skip('skipping this');
}
它们还指定了一个grep regex选项,用于通过config()跳过测试