Firefox和Edge的图像停用功能设置 – WDIO

huangapple go评论61阅读模式
英文:

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_argsedge_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"
},

huangapple
  • 本文由 发表于 2023年2月8日 19:17:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384997.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定