kapieciiのブログ

日々学んだことを残しておくためのブログです。このブログはGoogle Analyticsを利用しています。

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

参照

github.com

kapieciiのブログについてお問い合わせがある場合、下記のフォームからご連絡をお願い致します。
お問い合わせはこちら