2017-10-09 76 views
-1

尝试运行我的夜班项目时,出现了npm run project_one,我收到了此回复。无法读取尝试执行任何操作的源文件夹

There was an error while starting the test runner: 

Error: Cannot read source folder: /Users/BenyJo/examples/tests 
    at /Users/BenyJo/node_modules/nightwatch/lib/runner/run.js:203:21 
    at /Users/BenyJo/node_modules/nightwatch/lib/runner/walk.js:97:18 
    at FSReqWrap.oncomplete (fs.js:153:21) 

npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] project_one: `nightwatch` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] project_one script. 
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

每当我用用NPM任何nightwatch命令,我得到了同样的错误,我的Nightwatch配置如下:

{ 
    "src_folders" : ["tests"], 
    "output_folder" : "reports", 

    "selenium" : { 
    "start_process" : true, 
    "server_path" : "./bin/selenium_v360.jar", 
    "log_path" : "", 
    "port" : 4444, 
    "cli_args" : { 
     "webdriver.chrome.driver" : "./bin/chromedriver" 
    } 
    }, 

    "test_settings" : { 
    "default" : { 
     "launch_url" : "http://localhost", 
     "selenium_port" : 4444, 
     "selenium_host" : "localhost", 
     "desiredCapabilities": { 
     "browserName": "chrome", 
     "javascriptEnabled": true, 
     "acceptSslCerts": true 
     } 
    } 
    } 
} 

screenshot

我注意到,在这个错误,没有文件叫,那里应该有个守夜文件夹。/Users/BenyJo/examples/tests

+0

[请勿发布图片的代码或错误!](https://meta.stackoverflow.com/q/303812/995714) – Rob

回答

1

有同样的问题,我的配置文件名中有一个错字。它必须命名为“nightwatch.json”(我的名字叫“nightwatch.js”)。

相关问题