我正在尝试测试依赖localStorage的应用程序.当我手动与浏览器交互时,一切正常.但是,在nightwatch.js请求localStorage时,我得到一个null响应而不是所需的字符串.这适用于Chrome和Firefox.
我已经尝试过通过分配,使localStore在夜巡JSON "webStorageEnabled" : true在desiredCapabilities这样的:
{
"src_folders" : ["tests/functional/tests"],
"output_folder" : "tests/functional/reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "/Library/WebDevelopment/selenium-server/selenium-server-standalone-2.45.0.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "/usr/local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver",
"webdriver.ie.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : …Run Code Online (Sandbox Code Playgroud)