英文:
Firefox and Edge capabilities settings for deactivating images - WDIO
问题
对于Firefox和Edge,你可以在wdio.conf.js
文件中使用以下配置来实现类似的功能:
对于Firefox:
browserName: 'firefox',
'moz:firefoxOptions': {
args: firefox_args,
prefs: {
'geo.enabled': false,
'permissions.default.image': 2
}
}
对于Edge:
browserName: 'MicrosoftEdge',
'ms:edgeOptions': {
args: edge_args,
prefs: {
'geo.enabled': false,
'permissions.default.image': 2
}
}
这些配置将禁用Firefox和Edge中的地理位置和图像加载,类似于Chrome中的设置。请确保在firefox_args
和edge_args
中设置相应的命令行参数。
英文:
I want to run cross browsing testing instead of only one browser (Chrome) for configuring Chrome to run headless and deactivate images i use the following in wdio.conf.js
file :
browserName: 'chrome',
'goog:chromeOptions': {
args: chrome_args,
prefs: {
"profile.managed_default_content_settings.geolocation": 2,
"profile.managed_default_content_settings.images": 2
}
},
what's the equivalent of that for firefox and Edge ?
答案1
得分: 1
Firefox 的等效配置是
browserName: 'firefox',
'moz:firefoxOptions': {
args: ['-headless'],
args: firefox_args,
prefs: {
"geo.enabled": false,
"permissions.default.image": 2
},
"windowSize": "1024x768"
}
Edge 的等效配置是
browserName: 'MicrosoftEdge',
'ms:edgeOptions': {
args: ['-headless'],
args: edge_args,
prefs: {
"geolocation": 2,
"images": 2
},
windowSize: "1280x1024"
}
英文:
The equivalent for Firefox is
browserName: 'firefox',
'moz:firefoxOptions': {
args: ['-headless'],
args: firefox_args,
prefs: {
"geo.enabled": false,
"permissions.default.image": 2
},
"windowSize": "1024x768"
},
The equivalent for Edge is
browserName: 'MicrosoftEdge',
'ms:edgeOptions': {
args: ['-headless'],
args: edge_args,
prefs: {
"geolocation": 2,
"images": 2
},
windowSize: "1280x1024"
},
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论