-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from dgrebb/release/2.5.0
Release/2.5.0
- Loading branch information
Showing
58 changed files
with
3,504 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Dispatch Build & Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- release/** | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Dispatch Frontend | ||
run: | | ||
curl -X POST https://api.github.com/repos/dgrebb/dgrebb.com/actions/workflows/${{ secrets.FRONTEND_WORKFLOW_ID }}/dispatches \ | ||
-H 'Accept: application/vnd.github+json' \ | ||
-H 'Authorization: Bearer ${{ secrets.DISPATCH_TOKEN }}' \ | ||
--data '{"ref": "${{ github.ref_name }}"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"id": "dgrebb.com", | ||
"viewports": [ | ||
{ | ||
"label": "xs", | ||
"width": 320, | ||
"height": 640 | ||
}, | ||
{ | ||
"label": "sm", | ||
"width": 640, | ||
"height": 768 | ||
}, | ||
{ | ||
"label": "md", | ||
"width": 810, | ||
"height": 1080 | ||
}, | ||
{ | ||
"label": "lg", | ||
"width": 1024, | ||
"height": 768 | ||
}, | ||
{ | ||
"label": "xl", | ||
"width": 1440, | ||
"height": 900 | ||
} | ||
], | ||
"onBeforeScript": "puppet/onBefore.js", | ||
"onReadyScript": "puppet/onReady.js", | ||
"scenarios": [ | ||
{ | ||
"label": "Local Home Default", | ||
"url": "http://local.dgrebb.com:8080", | ||
"referenceUrl": "", | ||
"readyEvent": "", | ||
"readySelector": "", | ||
"delay": 1000, | ||
"hideSelectors": [], | ||
"removeSelectors": [], | ||
"hoverSelector": "", | ||
"clickSelector": "", | ||
"postInteractionWait": 0, | ||
"selectors": [], | ||
"selectorExpansion": true, | ||
"expect": 0, | ||
"misMatchThreshold" : 0.1, | ||
"requireSameDimensions": true | ||
}, | ||
{ | ||
"label": "Local Home Theme Switch", | ||
"url": "http://local.dgrebb.com:8080", | ||
"referenceUrl": "", | ||
"readyEvent": "", | ||
"readySelector": "", | ||
"delay": 0, | ||
"hideSelectors": [], | ||
"removeSelectors": [], | ||
"hoverSelector": "", | ||
"clickSelector": ".theme-toggle", | ||
"postInteractionWait": 1000, | ||
"selectors": [], | ||
"selectorExpansion": true, | ||
"expect": 0, | ||
"misMatchThreshold" : 0.1, | ||
"requireSameDimensions": true | ||
}, | ||
{ | ||
"label": "Local Privacy Default", | ||
"url": "http://local.dgrebb.com:8080/privacy", | ||
"referenceUrl": "", | ||
"readyEvent": "", | ||
"readySelector": "", | ||
"delay": 1000, | ||
"hideSelectors": [], | ||
"removeSelectors": [], | ||
"hoverSelector": "", | ||
"clickSelector": "", | ||
"postInteractionWait": 0, | ||
"selectors": [], | ||
"selectorExpansion": true, | ||
"expect": 0, | ||
"misMatchThreshold" : 0.1, | ||
"requireSameDimensions": true | ||
}, | ||
{ | ||
"label": "Local Privacy Theme Switch", | ||
"url": "http://local.dgrebb.com:8080/privacy", | ||
"referenceUrl": "", | ||
"readyEvent": "", | ||
"readySelector": "", | ||
"delay": 0, | ||
"hideSelectors": [], | ||
"removeSelectors": [], | ||
"hoverSelector": "", | ||
"clickSelector": ".theme-toggle", | ||
"postInteractionWait": 1000, | ||
"selectors": [], | ||
"selectorExpansion": true, | ||
"expect": 0, | ||
"misMatchThreshold" : 0.1, | ||
"requireSameDimensions": true | ||
} | ||
], | ||
|
||
"paths": { | ||
"bitmaps_reference": "bd/bitmaps_reference", | ||
"bitmaps_test": "bd/bitmaps_test", | ||
"engine_scripts": "bd/engine_scripts", | ||
"html_report": "bd/html_report", | ||
"ci_report": "bd/ci_report" | ||
}, | ||
"report": ["browser"], | ||
"engine": "puppeteer", | ||
"engineOptions": { | ||
"args": ["--no-sandbox"], | ||
"headless": "new" | ||
}, | ||
"asyncCaptureLimit": 5, | ||
"asyncCompareLimit": 50, | ||
"debug": false, | ||
"debugWindow": false | ||
} |
Binary file added
BIN
+70.2 KB
_ci/backstop/bd/bitmaps_reference/dgrebbcom_Local_Home_Default_0_document_0_xs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87 KB
_ci/backstop/bd/bitmaps_reference/dgrebbcom_Local_Home_Default_0_document_1_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+98.8 KB
_ci/backstop/bd/bitmaps_reference/dgrebbcom_Local_Home_Default_0_document_2_md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+97.6 KB
_ci/backstop/bd/bitmaps_reference/dgrebbcom_Local_Home_Default_0_document_3_lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+105 KB
_ci/backstop/bd/bitmaps_reference/dgrebbcom_Local_Home_Default_0_document_4_xl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+73 KB
...stop/bd/bitmaps_reference/dgrebbcom_Local_Home_Theme_Switch_0_document_0_xs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88.9 KB
...stop/bd/bitmaps_reference/dgrebbcom_Local_Home_Theme_Switch_0_document_1_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+101 KB
...stop/bd/bitmaps_reference/dgrebbcom_Local_Home_Theme_Switch_0_document_2_md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+97.9 KB
...stop/bd/bitmaps_reference/dgrebbcom_Local_Home_Theme_Switch_0_document_3_lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+105 KB
...stop/bd/bitmaps_reference/dgrebbcom_Local_Home_Theme_Switch_0_document_4_xl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.5 KB
...ckstop/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Default_0_document_0_xs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+135 KB
...ckstop/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Default_0_document_1_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+244 KB
...ckstop/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Default_0_document_2_md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+168 KB
...ckstop/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Default_0_document_3_lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+222 KB
...ckstop/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Default_0_document_4_xl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.7 KB
...p/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Theme_Switch_0_document_0_xs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+140 KB
...p/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Theme_Switch_0_document_1_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+253 KB
...p/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Theme_Switch_0_document_2_md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+173 KB
...p/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Theme_Switch_0_document_3_lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+225 KB
...p/bd/bitmaps_reference/dgrebbcom_Local_Privacy_Theme_Switch_0_document_4_xl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
_ci/backstop/bd/engine_scripts/playwright/clickAndHoverHelper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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); | ||
} | ||
}; |
31 changes: 31 additions & 0 deletions
31
_ci/backstop/bd/engine_scripts/playwright/interceptImages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* 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 | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = async (page, scenario, viewport, isReference, browserContext) => { | ||
await require('./loadCookies')(browserContext, scenario); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = async (page, scenario, viewport, isReference, browserContext) => { | ||
console.log('SCENARIO > ' + scenario.label); | ||
await require('./clickAndHoverHelper')(page, scenario); | ||
|
||
// add more ready handlers here... | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* 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); | ||
}; |
39 changes: 39 additions & 0 deletions
39
_ci/backstop/bd/engine_scripts/puppet/clickAndHoverHelper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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 page.waitForTimeout(postInteractionWait); | ||
} | ||
|
||
if (scrollToSelector) { | ||
await page.waitForSelector(scrollToSelector); | ||
await page.evaluate(scrollToSelector => { | ||
document.querySelector(scrollToSelector).scrollIntoView(); | ||
}, scrollToSelector); | ||
} | ||
}; |
Oops, something went wrong.