Codeceptjs+Puppeteerでchromeの画面サイズを変更する
Codeceptjs+Puppeteerを使ってテストをする際に起動するChromeの画面サイズを設定する。
codecept.conf.jsに下記の設定を追加する。
"defaultViewport": { "width": 1280, "height": 960 }
設定追加後のcodecept.conf.js(一部抜粋)
exports.config = { tests: './*_test.js', output: './output', helpers: { Puppeteer: { url: 'https://xxxxx/', show: true, "chrome": { "ignoreHTTPSErrors": true, "defaultViewport": { "width": 1280, "height": 960 } }, } }, ・・・
環境
- CodeceptJS v2.0.7