【发布时间】:2021-07-18 04:26:35
【问题描述】:
我一直在尝试将浏览器 Chromium 和 Firefox 的默认语言(在使用 CodeceptJS + Playwright 作为运行程序并行运行的自动化测试中)更改为法语语言,但没有成功。在 Chromium 中,我尝试使用 args --lang 没有成功,我也尝试使用 prefs: intl.accept_languages。在 Firefox 中,我尝试使用 firefoxUserPrefs。直到现在,没有任何工作。 有人知道如何更改使用 playwright 启动的浏览器中的默认语言吗?
CodeceptJS 版本 3.0.6
剧作家版 1.10.0
Chrome 版本 90.0.4430.0
Firefox 版本 87.0b10
codecept.conf.js - 完整的打印屏幕 codecept.conf.js
Playwright: {
url: process.env.baseUrl || DEFAULT_HOST,
show: true,
browser: 'chromium',
waitForAction: 250,
waitForNavigation: 'networkidle0',
chromium: {
channel: process.env.BROWSER,
args: ['--lang=fr-CA'],
prefs: {
'intl.accept_languages': 'fr-CA',
},
firefoxUserPrefs: {
'intl.accept_languages': 'fr-CA, fr',
},
},
},
【问题讨论】:
标签: selenium-chromedriver cross-browser geckodriver playwright codeceptjs