2017-10-09 15 views
-1

Lorsque j'essaie d'exécuter mon projet Nightwatch avec npm run project_one, j'obtiens cette réponse.Impossible de lire le dossier source essayant d'effectuer une action

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. 

Chaque fois que je l'utilise toute commande Nightwatch en utilisant NPM, je reçois la même erreur, ma config Nightwatch est la suivante:

{ 
    "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

J'ai remarqué que dans cette erreur, il n'y a pas de fichier appelé, il devrait y avoir un dossier nightwatch là-dedans./Users/BenyJo/examples/tests

+0

[Ne pas publier d'images de code ou d'erreurs!] (Https://meta.stackoverflow.com/q/303812/995714) – Rob

Répondre

1

J'avais le même problème, il y avait une faute de frappe dans mon nom de fichier de configuration. Il doit s'appeler "nightwatch.json" (le mien s'appelait "nightwatch.js").