如何通过IntelliJ运行/调试配置使wdio运行? [英] How to get wdio running through IntelliJ run/debug configurations?

查看:115
本文介绍了如何通过IntelliJ运行/调试配置使wdio运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用$ p
$ b

I can run the tests from the command line using

>  ./node_modules/.bin/wdio wdio.conf.js 

但是如果我尝试从IntelliJ的运行/调试配置我遇到各种不同的错误。

But if I try to run this from IntelliJ's run/debug configuration I get various different errors.


功能文件或目录:      /path_to_my_feature_file/myfeature.feature

Cucumber.js参数:    wdio.conf.js

可执行路径:                /path_to_my_project/node_modules/.bin/wdio

Featurefile or directory:      /path_to_my_feature_file/myfeature.feature
Cucumber.js arguments:    wdio.conf.js
Executable path:                 /path_to_my_project/node_modules/.bin/wdio

给我


指定了多个配置文件

more than one config file specified




如果删除黄瓜参数,它会无限期地运行。如果我停止运行它,则会出现错误



If I remove the Cucumber Arguments, it just runs indefinitely. If I stop it running I get the error


加载配置文件失败

Failed loading configuration file

加载配置文件似乎存在某种问题,但我不知道如何解决。有什么建议么? wdio.conf.js存在并且在项目根目录中。

It looks like there's some kind of issue with loading the config file, but I don't know how to fix it. Any suggestions? wdio.conf.js exists and is in the project root.

推荐答案

WebStorm对 wdio 测试运行程序不提供任何特殊支持。但您仍然可以使用 Node.js 运行/调试测试,如下所示:

WebStorm doesn't provide any special support for wdio test runner. But you can still run/debug the tests using Node.js run configuration like the following:

但是由于与使用非tty环境有关的问题,这不能立即使用(IDEA中的Node.js运行控制台不是非tty。 )。解决方法是,尝试注释掉<$ c $中的 if(process.stdin.isTTY) else 分支c> node_modules\webdriverio\build\lib\cli.js :

But this doesn't work out of the box due to problems related to using non-tty environment (Node.js run console in IDEA is non-tty). As a workaround, please try commenting out if (process.stdin.isTTY) and else branch in node_modules\webdriverio\build\lib\cli.js:

//if (process.stdin.isTTY) {
    launch();
/*
} else {
   var stdinData = '';
    /!*
     * get a list of spec files to run from stdin, overriding any other
     * configuration suite or specs.
     *!/
    var stdin = process.openStdin();
    stdin.setEncoding('utf8');
    stdin.on('data', function (data) {
        stdinData += data;
    });
    stdin.on('end', function () {
        if (stdinData.length > 0) {
            args['specs'] = stdinData.trim().split(/\r?\n/);
        }
        launch();
    });
}*/

请参见 WEB-31745

这篇关于如何通过IntelliJ运行/调试配置使wdio运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆