WebdriverIO を使用してページ全体のスクリーンショットを撮ろうとしています。
WebdriverCSSを使用して WebdriverIO フローを強化するのが最善の方法であると読みました。WebdriverCSS はページ全体のスクリーンショットを自動的に作成しますか??
問題は、WebdriverCSS が機能しないことです。まだ対応していないからだと思いますwebdriverio@3.0.x
。
それを機能させる方法や、使用できる別のソリューションはありますか?
私のコード:(コールバックで未定義の値しか生成していません)
// Initialize WebdriverCSS for `client` instance
require('webdrivercss').init(driver, {
// example options
screenshotRoot: '../../screenshots',
failedComparisonsRoot: '../../screenshots/diffs',
misMatchTolerance: 0.05
});
// ...
// driver gets initialized and url opened
// ...
driver.webdrivercss('page', {
name: 'body',
elem: 'body'
}, function(err, res) {
// here the values of err and res are always undefined
})
.saveScreenshot('../../screenshots/webdrivercsstest.png');
// the screenshot works, but it's not full page
!編集: これは Chromium の既知のバグであり、おそらく修正されません。詳しくはこちらのLINKをご覧ください。