Upgrade to Pro — share decks privately, control downloads, hide ads and more …

E2Eテストを継続するために

 E2Eテストを継続するために

E2Eテストを継続していくためのあれこれ

Transcript

  1. function runTest() { const browser = puppeteer.launch(...) const page =

    browser.newPage(); ... let retryCount = 0; page.on('error', () => { if (++retryCount < 3) { setTimeout(runTest, 10); } }) page.on('pageerror', () => { if (++retryCount < 3) { setTimeout(runTest, 10); } }) }
  2. await page.evaluate( `(() => { const newStyle = document.createElement('style'); newStyle.type

    = "text/css"; document.getElementsByTagName(‘head')[0] .appendChild(newStyle); const css = document.styleSheets[0]; const idx = document.styleSheets[0] .cssRules.length; css.insertRule( "body * {-webkit-font-smoothing: none ! important}”, idx ); })()`, );
  3. new BlinkDiff({ imageA: baselineImage, imageB: image, thresholdType: BlinkDiff.THRESHOLD_PERCENT, threshold: 0.0001,

    imageOutputPath: failedFilePath, verbose: true, perceptual: true, delta: 25, })
  4. 0QFSBUJPO Ϣʔβʔૢ࡞ͷந৅Խ &YFDVUJPO ࣮ࡍͷίʔυ 0QFSBUJPO Ϣʔβʔૢ࡞ͷந৅Խ &YFDVUJPO ࣮ࡍͷίʔυ 0QFSBUJPO Ϣʔβʔૢ࡞ͷந৅Խ

    &YFDVUJPO ࣮ࡍͷίʔυ operation( // ૢ࡞ͷ໊લ 'name', // ࣮ࡍͷॲཧ async () => { ... }, // ͜ͷॲཧͷ੍໿ Restriction.of( Restriction.Type.SUCCESSOR, // ࣄલʹߦ͏΂͖ॲཧͷ໊લ 'other-op-name' ), )