Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.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
Protractor 在Yadda框架中使用量角器_Protractor_Yadda - Fatal编程技术网

Protractor 在Yadda框架中使用量角器

Protractor 在Yadda框架中使用量角器,protractor,yadda,Protractor,Yadda,我试图找到一些使用(茉莉花或其他fw)的案例,但没有运气。 有人有这方面的经验吗?好的,我在回答我自己的问题 步骤1-定义量角器配置文件的规格: specs: ['test/yadda-runner.js'] 步骤2-创建“test/yadda runner.js” var exports = module.exports = {}; exports.runner = (function () { var Yadda = require('yadda'); Yadda

我试图找到一些使用(茉莉花或其他fw)的案例,但没有运气。
有人有这方面的经验吗?

好的,我在回答我自己的问题

步骤1-定义量角器配置文件的规格:

specs: ['test/yadda-runner.js']
步骤2-创建“test/yadda runner.js”

    var exports = module.exports = {};

exports.runner = (function () {
    var Yadda = require('yadda');
    Yadda.plugins.jasmine.StepLevelPlugin.init();

    new Yadda.FeatureFileSearch('./test/features').each(function foundFeatureFiles(file) {
        featureFile(file, function test(feature) {

            var a = file.match(/[a-zA-Z0-9-_]*\.feature/gi)[0],
                name = a.replace(".feature","");

            var definitions = require('./definitions/' + name + '-steps.js');
            var yadda = Yadda.createInstance(definitions);

            scenarios(feature.scenarios, function execute(scenario) {
                steps(scenario.steps, function executeStep(step) {
                    yadda.run(step);
                });
            });
        });
    });
}());
步骤3-创建功能和步骤文件


“test/features/瓶子.feature”->“test/definitions/瓶子-steps.js”

我想你忘记了已完成的回调。如果您没有通过它,那么下一个函数可能无法正常工作。