最近,Chrome在其设置中具有一项功能,用户可以阻止Cookie 。
我正在为我的平台运行夜视位测试,我想知道如何阻止cookie并运行测试。
夜视配置的一个片段是这样的:
module.exports = {
src_folders: ["test/type/bit/test"],
output_folder: "test/type/bit/out",
page_objects_path: "test/type/bit/pages",
globals_path: "test/type/bit/utils/globals.js",
selenium: {
start_process: false
},
test_settings: {
default: {
launch_url: "http://localhost:8080",
// ChromeDriver default port.
selenium_port: 9515,
selenium_host: "localhost",
// Clear the default Selenium path prefix.
default_path_prefix: "",
silent: true,
screenshots: {
enabled: true,
on_failure: true,
on_error: true,
path: "test/type/bit/out/reports/screenshots"
},
desiredCapabilities: {
browserName: "chrome",
javascriptEnabled: true,
acceptSslCerts: true,
acceptInsecureCerts: true,
chromeOptions: {
args: [
"--headless",
"--disable-gpu",
"--no-sandbox",
"--disable-web-security",
"--user-data-dir=/tmp/chrome-test-profile",
"--start-maximized",
"--ignore-certificate-errors",
"--allow-running-insecure-content"
]
}
}
}
}
};
将寻求任何帮助。