{"action":"created","issue":{"url":"https://api.github.com/repos/gextech/grunt-nightwatch/issues/33","labels_url":"https://api.github.com/repos/gextech/grunt-nightwatch/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/gextech/grunt-nightwatch/issues/33/comments","events_url":"https://api.github.com/repos/gextech/grunt-nightwatch/issues/33/events","html_url":"https://github.com/gextech/grunt-nightwatch/issues/33","id":59653480,"number":33,"title":"Custom settings path: json file is not interpreted correctly","user":{"login":"tortila","id":5598055,"avatar_url":"https://avatars.githubusercontent.com/u/5598055?v=3","gravatar_id":"","url":"https://api.github.com/users/tortila","html_url":"https://github.com/tortila","followers_url":"https://api.github.com/users/tortila/followers","following_url":"https://api.github.com/users/tortila/following{/other_user}","gists_url":"https://api.github.com/users/tortila/gists{/gist_id}","starred_url":"https://api.github.com/users/tortila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tortila/subscriptions","organizations_url":"https://api.github.com/users/tortila/orgs","repos_url":"https://api.github.com/users/tortila/repos","events_url":"https://api.github.com/users/tortila/events{/privacy}","received_events_url":"https://api.github.com/users/tortila/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-03-03T15:02:31Z","updated_at":"2015-03-12T10:12:18Z","closed_at":"2015-03-11T05:13:50Z","body":"Hi, so this issue relates to [#30](gextech/grunt-nightwatch#30). Starting from `v0.4.1` `grunt-nightwatch` supports custom json object with settings for nightwatch, but these settings are not read correctly. Let me give you an example:\r\n\r\nIn options for grunt task I have:\r\n````javascript\r\n    var selenium_version = \"2.42.2\";\r\n    var path = require(\"path\");\r\n    options: {\r\n        standalone: true,\r\n        jar_path: path.resolve(__dirname + \"/../tests/functional/lib/selenium-server-standalone-\" + selenium_version + \".jar\"),\r\n        jar_version: selenium_version,\r\n        config_path: path.resolve(__dirname + \"/../tests/functional/nightwatch.json\")\r\n    }\r\n````\r\n\r\nAnd in `nightwatch.json` specified by `config_path`, among other things, I specify `test_settings`:\r\n\r\n````javascript\r\n    \"test_settings\": {\r\n        \"default\": {\r\n            \"launch_url\": \"\",\r\n            \"selenium_port\": 4444,\r\n            \"selenium_host\": \"localhost\",\r\n            \"silent\": true,\r\n            \"desiredCapabilities\": {\r\n                \"browserName\": \"chrome\",\r\n                \"javascriptEnabled\": true,\r\n                \"acceptSslCerts\": true\r\n            }\r\n        }\r\n````\r\nand, in the same file, some basic config:\r\n\r\n````javascript\r\n    \"src_folders\": [\"spec\"],\r\n    \"output_folder\": \"../../test-reports\",\r\n    \"custom_commands_path\": \"commands\",\r\n    \"custom_assertions_path\": \"assertions\",\r\n    \"globals_path\": \"globals.json\",\r\n````\r\n\r\nNow, by running this task I have the following output (well, a piece of it, the rest is not necessary):\r\n\r\n````\r\nRunning \"nightwatch\" task\r\nReading <absolute_path>/tests/functional/nightwatch.json...OK\r\nParsing <absolute_path>/tests/functional/nightwatch.json...OK\r\n>> Custom JSON-file: <absolute_path>/tests/functional/nightwatch.json\r\n>> Task options\r\n{\"standalone\":true,\"jar_path\":\"<absolute_path>/tests/functional/lib/selenium-server-standalone-2.42.2.jar\",\r\n\"jar_url\":\"http://selenium-release.storage.googleapis.com/{x}.{y}/selenium-server-standalone-{x}.{y}.{z}.jar\",\r\n\"jar_version\":\"2.42.2\",\"config_path\":\"<absolute_path>/tests/functional/nightwatch.json\"}\r\n>> Using Selenium from <absolute_path>/tests/functional/lib/selenium-server-standalone-2.42.2.jar\r\nStarting selenium server... started - PID:  <selenium_pid>\r\n\r\n\r\n[Sorted] Test Suite\r\n===================\r\n\r\nRunning:  assertion \r\n\r\nINFO Request: POST /wd/hub/session \r\n - data:  {\"desiredCapabilities\":{\"browserName\":\"firefox\",\"javascriptEnabled\":true,\"acceptSslCerts\":true,\r\n\"platform\":\"ANY\",\"name\":\"Sorted\"}} \r\n - headers:  {\"Content-Type\":\"application/json; charset=utf-8\",\"Content-Length\":129}\r\n\r\n````\r\n\r\nAnd here are 2 things that bother me:\r\n1. `desiredCapabilities` has now `firefox` as default browser, and not `chrome` as I specified in my custom settings file\r\n3. the first test that is being run (or at least started) is actually a custom assertion, that is being started only because it's the first folder (alphabetically) in the same directory as my custom settings file - even though I specified `src_folders`.\r\n\r\nSo my conclusion is that the settings are not read/interpreted correctly. Could you please take a look at this problem?"},"comment":{"url":"https://api.github.com/repos/gextech/grunt-nightwatch/issues/comments/78453394","html_url":"https://github.com/gextech/grunt-nightwatch/issues/33#issuecomment-78453394","issue_url":"https://api.github.com/repos/gextech/grunt-nightwatch/issues/33","id":78453394,"user":{"login":"tortila","id":5598055,"avatar_url":"https://avatars.githubusercontent.com/u/5598055?v=3","gravatar_id":"","url":"https://api.github.com/users/tortila","html_url":"https://github.com/tortila","followers_url":"https://api.github.com/users/tortila/followers","following_url":"https://api.github.com/users/tortila/following{/other_user}","gists_url":"https://api.github.com/users/tortila/gists{/gist_id}","starred_url":"https://api.github.com/users/tortila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tortila/subscriptions","organizations_url":"https://api.github.com/users/tortila/orgs","repos_url":"https://api.github.com/users/tortila/repos","events_url":"https://api.github.com/users/tortila/events{/privacy}","received_events_url":"https://api.github.com/users/tortila/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T10:12:18Z","updated_at":"2015-03-12T10:12:18Z","body":"That fix kind of destroyed what was already working. \r\n\r\nRight now (tried master branch) the path to screenshots is resolved properly, but additionally `src_folders` is not resolved properly (and it was working on develop before). \r\n"}}