守夜人JS。 Chrome启动后关闭,配置问题

时间:2017-07-05 16:19:48

标签: javascript testing nightwatch.js

在我的本地计算机上安装了Chrome v.54,它支持chromedriver v.2.27 但是当我开始测试时,镀铬在发射后立即关闭。我知道,这是一个配置问题。

这是我的nightwatch.json文件

    {
        "src_folders" : ["tests"],
    "output_folder" : "reports",
    "custom_commands_path" : "",
    "custom_assertions_path" : "",
    "page_objects_path" : "",
    "globals_path" : "global.js",

    "selenium" : {
    "start_process" : false,
  "server_path" : "./bin/selenium-server-standalone-3.3.1.jar",
  "log_path" : "",
  "port" : 4444,
  "cli_args" : {
   "webdriver.chrome.driver" : "./bin/chromedriver"
  }
 },
 "test_settings" : {
        "default" : {
            "launch_url" : "https://www.site.ru",
            "selenium_port"  : 9515,
            "selenium_host"  : "localhost",
            "default_path_prefix" : "",
            "silent": true,
            "screenshots" : {
                "enabled" : false
            },
            "desiredCapabilities" : {
                "browserName" : "chrome",
                "javascriptEnabled" : true,
                "acceptSslCerts" : true,
                "chromeOptions" : {
                    "args" : ["start-fullscreen"]
                }
            }   
        },
                "chrome" : {
            "desiredCapabilities": {
                "browserName": "chrome",
                "javascriptEnabled" : true,
                "acceptSslCerts" : true,
                "chromeOptions" : {
                    "args" : ["start-fullscreen"]
            }
        }
        }
 }
}

这是我的package.json文件

    {
  "name": "test_js",
  "version": "1.0.0",
  "description": "",
  "main": "hello.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "nightwatch": "./node_modules/.bin/nightwatch",
    "lint": "eslint ./src ./functions ./selectors ./data"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel-eslint": "^7.1.1",
    "chromedriver": "^2.2",
    "eslint": "^3.18.0",
    "nightwatch": "^0.9.13",
    "selenium-server-standalone-jar": "^3.0.1"
  }
}

出了什么问题?

0 个答案:

没有答案