Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/43.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 NightwatchJS-没有用于报告XML文件的此类文件或目录_Javascript_Node.js_Selenium_Automated Tests - Fatal编程技术网

Javascript NightwatchJS-没有用于报告XML文件的此类文件或目录

Javascript NightwatchJS-没有用于报告XML文件的此类文件或目录,javascript,node.js,selenium,automated-tests,Javascript,Node.js,Selenium,Automated Tests,在我的测试成功运行后,我不断收到报告XML文件没有这样的文件或目录的错误。它似乎在查找错误的目录: no such file or directory 'E:\source\test\nightwatch\reports\E:\source\test\nightwatch\tests\file1.xml' 我使用了settings.json,但没有用。如何让it部门成功创建报告 NightwatchJS版本:0.2.7 文件夹结构: nightwatch.js: settings.json:

在我的测试成功运行后,我不断收到报告XML文件没有这样的文件或目录的错误。它似乎在查找错误的目录:

no such file or directory 'E:\source\test\nightwatch\reports\E:\source\test\nightwatch\tests\file1.xml'
我使用了settings.json,但没有用。如何让it部门成功创建报告

NightwatchJS版本:0.2.7

文件夹结构:

nightwatch.js:

settings.json:

样本输出:


您正在运行一个过时的nightwatch版本,该版本在Windows上保存报告文件时存在错误。可用的最新版本是0.3.7。 要更新至最新版本,您可以运行:

npm update nightwatch

您可以尝试更新src的设置,并将输出更新为相对于运行程序:

"src_folders": ["./tests"],
"output_folder": "./reports",

从GitHub下载并复制粘贴到我的node_模块/nightwatch文件夹可以吗?因为做npm更新夜表什么都做不了。
{
  "src_folders" : ["tests"],
  "output_folder" : "reports",
  "custom_commands_path" : "",

  "selenium" : {
    "start_process" : true,
    "server_path" : "C:/Program Files/Selenium/selenium-server-standalone-2.39.0.jar",
    "log_path" : "reports",
    "host" : "127.0.0.1",
    "port" : 4444  
  },

  "test_settings" : {
    "default" : {
      "launch_url" : "http://localhost",
      "port"  : 4444,
      "silent": true,
      "firefox_profile": false,
      "screenshots" : {
        "enabled" : true,
        "path" : "screenshots"
      },
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    }
  }
}
E:\source\test\nightwatch>node nightwatch.js -t tests/file1.js
Starting selenium server... started - PID:  7472
Running tests

[ E:\source\test\nightwatch\tests\file1 module ]

Running:  Test File1
✔  [some assertions here...]
OK. 6 assertions passed.

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'E:\source\test\nightwatch\reports\E:\source\test\nightwatch\tests\file1.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at E:\source\node_modules\nightwatch\runner\reporters\junit.js:36:10
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
npm update nightwatch
"src_folders": ["./tests"],
"output_folder": "./reports",