From 85321cf74423d23426cc335004bd8b19a8992c3c Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 5 Apr 2025 21:23:45 -0700 Subject: [PATCH] Delete backstop stuff Signed-off-by: Danila Fedorin --- backstop.js | 59 ---------------- backstop_data/engine_scripts/cookies.json | 14 ---- backstop_data/engine_scripts/imageStub.jpg | Bin 2900 -> 0 bytes .../playwright/clickAndHoverHelper.js | 43 ------------ .../playwright/interceptImages.js | 31 --------- .../engine_scripts/playwright/loadCookies.js | 16 ----- .../engine_scripts/playwright/onBefore.js | 3 - .../engine_scripts/playwright/onReady.js | 6 -- .../engine_scripts/playwright/overrideCSS.js | 27 -------- .../puppet/clickAndHoverHelper.js | 41 ----------- .../engine_scripts/puppet/ignoreCSP.js | 65 ------------------ .../engine_scripts/puppet/interceptImages.js | 37 ---------- .../engine_scripts/puppet/loadCookies.js | 33 --------- .../engine_scripts/puppet/onBefore.js | 3 - .../engine_scripts/puppet/onReady.js | 6 -- .../engine_scripts/puppet/overrideCSS.js | 15 ---- 16 files changed, 399 deletions(-) delete mode 100644 backstop.js delete mode 100644 backstop_data/engine_scripts/cookies.json delete mode 100644 backstop_data/engine_scripts/imageStub.jpg delete mode 100644 backstop_data/engine_scripts/playwright/clickAndHoverHelper.js delete mode 100644 backstop_data/engine_scripts/playwright/interceptImages.js delete mode 100644 backstop_data/engine_scripts/playwright/loadCookies.js delete mode 100644 backstop_data/engine_scripts/playwright/onBefore.js delete mode 100644 backstop_data/engine_scripts/playwright/onReady.js delete mode 100644 backstop_data/engine_scripts/playwright/overrideCSS.js delete mode 100644 backstop_data/engine_scripts/puppet/clickAndHoverHelper.js delete mode 100644 backstop_data/engine_scripts/puppet/ignoreCSP.js delete mode 100644 backstop_data/engine_scripts/puppet/interceptImages.js delete mode 100644 backstop_data/engine_scripts/puppet/loadCookies.js delete mode 100644 backstop_data/engine_scripts/puppet/onBefore.js delete mode 100644 backstop_data/engine_scripts/puppet/onReady.js delete mode 100644 backstop_data/engine_scripts/puppet/overrideCSS.js diff --git a/backstop.js b/backstop.js deleted file mode 100644 index f364a77..0000000 --- a/backstop.js +++ /dev/null @@ -1,59 +0,0 @@ -const fs = require('node:fs'); -const list = fs.readFileSync('./pages.json', 'utf8'); - -function scenarioForFile(file) { - return { - "label": file, - "cookiePath": "backstop_data/engine_scripts/cookies.json", - "url": file, - "referenceUrl": "", - "readyEvent": "", - "readySelector": "", - "delay": 0, - "hideSelectors": [], - "removeSelectors": [], - "hoverSelector": "", - "clickSelector": "", - "postInteractionWait": 0, - "selectors": [], - "selectorExpansion": true, - "expect": 0, - "misMatchThreshold" : 0.1, - "requireSameDimensions": true - }; -} - -module.exports = { - "id": "blog_regression", - "viewports": [ - { - "label": "phone", - "width": 320, - "height": 480 - }, - { - "label": "tablet", - "width": 1024, - "height": 768 - } - ], - "onBeforeScript": "puppet/onBefore.js", - "onReadyScript": "puppet/onReady.js", - "scenarios": list.map(scenarioForFile), - "paths": { - "bitmaps_reference": "backstop_data/bitmaps_reference", - "bitmaps_test": "backstop_data/bitmaps_test", - "engine_scripts": "backstop_data/engine_scripts", - "html_report": "backstop_data/html_report", - "ci_report": "backstop_data/ci_report" - }, - "report": ["browser"], - "engine": "puppeteer", - "engineOptions": { - "args": ["--no-sandbox"] - }, - "asyncCaptureLimit": 5, - "asyncCompareLimit": 50, - "debug": false, - "debugWindow": false -} diff --git a/backstop_data/engine_scripts/cookies.json b/backstop_data/engine_scripts/cookies.json deleted file mode 100644 index 4123a5d..0000000 --- a/backstop_data/engine_scripts/cookies.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "domain": ".www.yourdomain.com", - "path": "/", - "name": "yourCookieName", - "value": "yourCookieValue", - "expirationDate": 1798790400, - "hostOnly": false, - "httpOnly": false, - "secure": false, - "session": false, - "sameSite": "Lax" - } -] diff --git a/backstop_data/engine_scripts/imageStub.jpg b/backstop_data/engine_scripts/imageStub.jpg deleted file mode 100644 index 3e526b4bbbc74ef5125cb58f7c8849497ef4fa83..0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EPR43;n$?_bq3lg3tm@Bn&8Hc@PE)j91$AB){YK; zRqxL{wj~u6xOsXwYQm0Sb+R37IBL&~mW8ar39_9nh&W~k64Ms>+XC7QJ1w!E^>Y>Z zVkBg;*QAPX)-OBTBzTp1`MZjL^`{}TfhQ7*8bi`RThIO8_uEfRROQ<4yLNs8FczJX zd0*T?G&56RIx@}SB2Ve>mu01vtE*9dUSF&d9xD$(ld+#+ZZ%0Ib7l~vix!et@)`5~ z{->OH8L6tlvecO&Oy}x~e^Y(vV6mbY#VtSRF^K^isxY|CR`Va<*`^%WBj@DE^CD%H zF9J-wNL7gzvKr1}=i+_k$@mG;p1}?1)IR5}IU@s_%0hWW!Vlr)Bz-JIp7x8=G^)Wo z{h`N(N8w%F?Bw~ssc8orB+h78;{0UZV%y3EtdW!`d9O?NG3c(3#|SY*ecweNT)1KR zN9ctQ;lM%(*5g7(ty2+FV5TWF9tEAemCv4|q(?hW~Wkr#L`lhjCSNuCe&85{WjhJ1@P{5z{dH?#l% diff --git a/backstop_data/engine_scripts/playwright/clickAndHoverHelper.js b/backstop_data/engine_scripts/playwright/clickAndHoverHelper.js deleted file mode 100644 index 8a0e8f0..0000000 --- a/backstop_data/engine_scripts/playwright/clickAndHoverHelper.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = async (page, scenario) => { - const hoverSelector = scenario.hoverSelectors || scenario.hoverSelector; - const clickSelector = scenario.clickSelectors || scenario.clickSelector; - const keyPressSelector = scenario.keyPressSelectors || scenario.keyPressSelector; - const scrollToSelector = scenario.scrollToSelector; - const postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int] - - if (keyPressSelector) { - for (const keyPressSelectorItem of [].concat(keyPressSelector)) { - await page.waitForSelector(keyPressSelectorItem.selector); - await page.type(keyPressSelectorItem.selector, keyPressSelectorItem.keyPress); - } - } - - if (hoverSelector) { - for (const hoverSelectorIndex of [].concat(hoverSelector)) { - await page.waitForSelector(hoverSelectorIndex); - await page.hover(hoverSelectorIndex); - } - } - - if (clickSelector) { - for (const clickSelectorIndex of [].concat(clickSelector)) { - await page.waitForSelector(clickSelectorIndex); - await page.click(clickSelectorIndex); - } - } - - if (postInteractionWait) { - if (parseInt(postInteractionWait) > 0) { - await page.waitForTimeout(postInteractionWait); - } else { - await page.waitForSelector(postInteractionWait); - } - } - - if (scrollToSelector) { - await page.waitForSelector(scrollToSelector); - await page.evaluate(scrollToSelector => { - document.querySelector(scrollToSelector).scrollIntoView(); - }, scrollToSelector); - } -}; diff --git a/backstop_data/engine_scripts/playwright/interceptImages.js b/backstop_data/engine_scripts/playwright/interceptImages.js deleted file mode 100644 index 4077e76..0000000 --- a/backstop_data/engine_scripts/playwright/interceptImages.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * INTERCEPT IMAGES - * Listen to all requests. If a request matches IMAGE_URL_RE - * then stub the image with data from IMAGE_STUB_URL - * - * Use this in an onBefore script E.G. - ``` - module.exports = async function(page, scenario) { - require('./interceptImages')(page, scenario); - } - ``` - * - */ - -const fs = require('fs'); -const path = require('path'); - -const IMAGE_URL_RE = /\.gif|\.jpg|\.png/i; -const IMAGE_STUB_URL = path.resolve(__dirname, '../../imageStub.jpg'); -const IMAGE_DATA_BUFFER = fs.readFileSync(IMAGE_STUB_URL); -const HEADERS_STUB = {}; - -module.exports = async function (page, scenario) { - page.route(IMAGE_URL_RE, route => { - route.fulfill({ - body: IMAGE_DATA_BUFFER, - headers: HEADERS_STUB, - status: 200 - }); - }); -}; diff --git a/backstop_data/engine_scripts/playwright/loadCookies.js b/backstop_data/engine_scripts/playwright/loadCookies.js deleted file mode 100644 index 6a9044e..0000000 --- a/backstop_data/engine_scripts/playwright/loadCookies.js +++ /dev/null @@ -1,16 +0,0 @@ -const fs = require('fs'); - -module.exports = async (browserContext, scenario) => { - let cookies = []; - const cookiePath = scenario.cookiePath; - - // Read Cookies from File, if exists - if (fs.existsSync(cookiePath)) { - cookies = JSON.parse(fs.readFileSync(cookiePath)); - } - - // Add cookies to browser - browserContext.addCookies(cookies); - - console.log('Cookie state restored with:', JSON.stringify(cookies, null, 2)); -}; diff --git a/backstop_data/engine_scripts/playwright/onBefore.js b/backstop_data/engine_scripts/playwright/onBefore.js deleted file mode 100644 index f163c2d..0000000 --- a/backstop_data/engine_scripts/playwright/onBefore.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = async (page, scenario, viewport, isReference, browserContext) => { - await require('./loadCookies')(browserContext, scenario); -}; diff --git a/backstop_data/engine_scripts/playwright/onReady.js b/backstop_data/engine_scripts/playwright/onReady.js deleted file mode 100644 index a944d91..0000000 --- a/backstop_data/engine_scripts/playwright/onReady.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = async (page, scenario, viewport, isReference, browserContext) => { - console.log('SCENARIO > ' + scenario.label); - await require('./clickAndHoverHelper')(page, scenario); - - // add more ready handlers here... -}; diff --git a/backstop_data/engine_scripts/playwright/overrideCSS.js b/backstop_data/engine_scripts/playwright/overrideCSS.js deleted file mode 100644 index a61cbef..0000000 --- a/backstop_data/engine_scripts/playwright/overrideCSS.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * OVERRIDE CSS - * Apply this CSS to the loaded page, as a way to override styles. - * - * Use this in an onReady script E.G. - ``` - module.exports = async function(page, scenario) { - await require('./overrideCSS')(page, scenario); - } - ``` - * - */ - -const BACKSTOP_TEST_CSS_OVERRIDE = ` - html { - background-image: none; - } -`; - -module.exports = async (page, scenario) => { - // inject arbitrary css to override styles - await page.addStyleTag({ - content: BACKSTOP_TEST_CSS_OVERRIDE - }); - - console.log('BACKSTOP_TEST_CSS_OVERRIDE injected for: ' + scenario.label); -}; diff --git a/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js b/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js deleted file mode 100644 index 703d3b8..0000000 --- a/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = async (page, scenario) => { - const hoverSelector = scenario.hoverSelectors || scenario.hoverSelector; - const clickSelector = scenario.clickSelectors || scenario.clickSelector; - const keyPressSelector = scenario.keyPressSelectors || scenario.keyPressSelector; - const scrollToSelector = scenario.scrollToSelector; - const postInteractionWait = scenario.postInteractionWait; // selector [str] | ms [int] - - if (keyPressSelector) { - for (const keyPressSelectorItem of [].concat(keyPressSelector)) { - await page.waitForSelector(keyPressSelectorItem.selector); - await page.type(keyPressSelectorItem.selector, keyPressSelectorItem.keyPress); - } - } - - if (hoverSelector) { - for (const hoverSelectorIndex of [].concat(hoverSelector)) { - await page.waitForSelector(hoverSelectorIndex); - await page.hover(hoverSelectorIndex); - } - } - - if (clickSelector) { - for (const clickSelectorIndex of [].concat(clickSelector)) { - await page.waitForSelector(clickSelectorIndex); - await page.click(clickSelectorIndex); - } - } - - if (postInteractionWait) { - await new Promise(resolve => { - setTimeout(resolve, postInteractionWait); - }); - } - - if (scrollToSelector) { - await page.waitForSelector(scrollToSelector); - await page.evaluate(scrollToSelector => { - document.querySelector(scrollToSelector).scrollIntoView(); - }, scrollToSelector); - } -}; diff --git a/backstop_data/engine_scripts/puppet/ignoreCSP.js b/backstop_data/engine_scripts/puppet/ignoreCSP.js deleted file mode 100644 index 1dea285..0000000 --- a/backstop_data/engine_scripts/puppet/ignoreCSP.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * IGNORE CSP HEADERS - * Listen to all requests. If a request matches scenario.url - * then fetch the request again manually, strip out CSP headers - * and respond to the original request without CSP headers. - * Allows `ignoreHTTPSErrors: true` BUT... requires `debugWindow: true` - * - * see https://github.com/GoogleChrome/puppeteer/issues/1229#issuecomment-380133332 - * this is the workaround until Page.setBypassCSP lands... https://github.com/GoogleChrome/puppeteer/pull/2324 - * - * @param {REQUEST} request - * @return {VOID} - * - * Use this in an onBefore script E.G. - ``` - module.exports = async function(page, scenario) { - require('./removeCSP')(page, scenario); - } - ``` - * - */ - -const fetch = require('node-fetch'); -const https = require('https'); -const agent = new https.Agent({ - rejectUnauthorized: false -}); - -module.exports = async function (page, scenario) { - const intercept = async (request, targetUrl) => { - const requestUrl = request.url(); - - // FIND TARGET URL REQUEST - if (requestUrl === targetUrl) { - const cookiesList = await page.cookies(requestUrl); - const cookies = cookiesList.map(cookie => `${cookie.name}=${cookie.value}`).join('; '); - const headers = Object.assign(request.headers(), { cookie: cookies }); - const options = { - headers, - body: request.postData(), - method: request.method(), - follow: 20, - agent - }; - - const result = await fetch(requestUrl, options); - - const buffer = await result.buffer(); - const cleanedHeaders = result.headers._headers || {}; - cleanedHeaders['content-security-policy'] = ''; - await request.respond({ - body: buffer, - headers: cleanedHeaders, - status: result.status - }); - } else { - request.continue(); - } - }; - - await page.setRequestInterception(true); - page.on('request', req => { - intercept(req, scenario.url); - }); -}; diff --git a/backstop_data/engine_scripts/puppet/interceptImages.js b/backstop_data/engine_scripts/puppet/interceptImages.js deleted file mode 100644 index 2b02be9..0000000 --- a/backstop_data/engine_scripts/puppet/interceptImages.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * INTERCEPT IMAGES - * Listen to all requests. If a request matches IMAGE_URL_RE - * then stub the image with data from IMAGE_STUB_URL - * - * Use this in an onBefore script E.G. - ``` - module.exports = async function(page, scenario) { - require('./interceptImages')(page, scenario); - } - ``` - * - */ - -const fs = require('fs'); -const path = require('path'); - -const IMAGE_URL_RE = /\.gif|\.jpg|\.png/i; -const IMAGE_STUB_URL = path.resolve(__dirname, '../imageStub.jpg'); -const IMAGE_DATA_BUFFER = fs.readFileSync(IMAGE_STUB_URL); -const HEADERS_STUB = {}; - -module.exports = async function (page, scenario) { - const intercept = async (request, targetUrl) => { - if (IMAGE_URL_RE.test(request.url())) { - await request.respond({ - body: IMAGE_DATA_BUFFER, - headers: HEADERS_STUB, - status: 200 - }); - } else { - request.continue(); - } - }; - await page.setRequestInterception(true); - page.on('request', intercept); -}; diff --git a/backstop_data/engine_scripts/puppet/loadCookies.js b/backstop_data/engine_scripts/puppet/loadCookies.js deleted file mode 100644 index 85b90cd..0000000 --- a/backstop_data/engine_scripts/puppet/loadCookies.js +++ /dev/null @@ -1,33 +0,0 @@ -const fs = require('fs'); - -module.exports = async (page, scenario) => { - let cookies = []; - const cookiePath = scenario.cookiePath; - - // READ COOKIES FROM FILE IF EXISTS - if (fs.existsSync(cookiePath)) { - cookies = JSON.parse(fs.readFileSync(cookiePath)); - } - - // MUNGE COOKIE DOMAIN - cookies = cookies.map(cookie => { - if (cookie.domain.startsWith('http://') || cookie.domain.startsWith('https://')) { - cookie.url = cookie.domain; - } else { - cookie.url = 'https://' + cookie.domain; - } - delete cookie.domain; - return cookie; - }); - - // SET COOKIES - const setCookies = async () => { - return Promise.all( - cookies.map(async (cookie) => { - await page.setCookie(cookie); - }) - ); - }; - await setCookies(); - console.log('Cookie state restored with:', JSON.stringify(cookies, null, 2)); -}; diff --git a/backstop_data/engine_scripts/puppet/onBefore.js b/backstop_data/engine_scripts/puppet/onBefore.js deleted file mode 100644 index a1c374c..0000000 --- a/backstop_data/engine_scripts/puppet/onBefore.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = async (page, scenario, vp) => { - await require('./loadCookies')(page, scenario); -}; diff --git a/backstop_data/engine_scripts/puppet/onReady.js b/backstop_data/engine_scripts/puppet/onReady.js deleted file mode 100644 index 517c0e4..0000000 --- a/backstop_data/engine_scripts/puppet/onReady.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = async (page, scenario, vp) => { - console.log('SCENARIO > ' + scenario.label); - await require('./clickAndHoverHelper')(page, scenario); - - // add more ready handlers here... -}; diff --git a/backstop_data/engine_scripts/puppet/overrideCSS.js b/backstop_data/engine_scripts/puppet/overrideCSS.js deleted file mode 100644 index d568205..0000000 --- a/backstop_data/engine_scripts/puppet/overrideCSS.js +++ /dev/null @@ -1,15 +0,0 @@ -const BACKSTOP_TEST_CSS_OVERRIDE = 'html {background-image: none;}'; - -module.exports = async (page, scenario) => { - // inject arbitrary css to override styles - await page.evaluate(`window._styleData = '${BACKSTOP_TEST_CSS_OVERRIDE}'`); - await page.evaluate(() => { - const style = document.createElement('style'); - style.type = 'text/css'; - const styleNode = document.createTextNode(window._styleData); - style.appendChild(styleNode); - document.head.appendChild(style); - }); - - console.log('BACKSTOP_TEST_CSS_OVERRIDE injected for: ' + scenario.label); -};