mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-21 23:57:30 +00:00
Update dependencies and fix screenshot tests
This commit is contained in:
parent
3b18a7028e
commit
0edc966fda
2055
package-lock.json
generated
2055
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -9,15 +9,15 @@
|
|||||||
"assistant": "cd src/site && node assistant.js",
|
"assistant": "cd src/site && node assistant.js",
|
||||||
"build-lang": "cd src/lang/utils && node build_base.js",
|
"build-lang": "cd src/lang/utils && node build_base.js",
|
||||||
"test": "tap",
|
"test": "tap",
|
||||||
"upload-test-files": "rsync -a src/lib/utils/saved_requests/files/ debib:meta/saved_requests; rsync -a test/screenshots/final/ debib:meta/screenshots",
|
"upload-test-files": "rsync -a src/lib/utils/saved_requests/files/ ipib:meta/saved_requests; rsync -a test/screenshots/final/ ipib:meta/screenshots",
|
||||||
"download-test-files": "bash -c 'mkdir -p test/screenshots/{diff,final,staging} && rm test/screenshots/final/* && wget -q -r -nd -np -P test/screenshots/final -R html -R tmp https://meta.bibliogram.art/screenshots/'"
|
"download-test-files": "bash -c 'mkdir -p test/screenshots/{diff,final,staging} && rm test/screenshots/final/* && wget -q -r -nd -np -P test/screenshots/final -R html -R tmp https://meta.bibliogram.art/screenshots/'"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^7.4.4",
|
"better-sqlite3": "^7.5.1",
|
||||||
"cookie": "^0.4.1",
|
"cookie": "^0.5.0",
|
||||||
"fast-html-parser": "^1.0.1",
|
"fast-html-parser": "^1.0.1",
|
||||||
"feed": "git+https://git.sr.ht/~cadence/nodejs-feed#3dde82f8296d7a6f5659323e497e0c684f03ab71",
|
"feed": "git+https://git.sr.ht/~cadence/nodejs-feed#3dde82f8296d7a6f5659323e497e0c684f03ab71",
|
||||||
"get-stream": "^6.0.1",
|
"get-stream": "^6.0.1",
|
||||||
@ -25,10 +25,10 @@
|
|||||||
"is-in-subnet": "^4.0.1",
|
"is-in-subnet": "^4.0.1",
|
||||||
"mixin-deep": "^2.0.1",
|
"mixin-deep": "^2.0.1",
|
||||||
"node-dir": "^0.1.17",
|
"node-dir": "^0.1.17",
|
||||||
"node-fetch": "^2.6.5",
|
"node-fetch": "^2.6.7",
|
||||||
"pinski": "git+https://git.sr.ht/~cadence/nodejs-pinski#2a5a025a974bd5cbb81bae32ec4d5c247cec0d42",
|
"pinski": "git+https://git.sr.ht/~cadence/nodejs-pinski#2a5a025a974bd5cbb81bae32ec4d5c247cec0d42",
|
||||||
"pug": "^3.0.2",
|
"pug": "^3.0.2",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.7",
|
||||||
"socks-proxy-agent": "git+https://git.sr.ht/~cadence/nodejs-socks-proxy-agent#5eef50a01667bd5c6b5626fb8e206232152dfbee"
|
"socks-proxy-agent": "git+https://git.sr.ht/~cadence/nodejs-socks-proxy-agent#5eef50a01667bd5c6b5626fb8e206232152dfbee"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
@ -37,8 +37,8 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jimp": "^0.16.1",
|
"jimp": "^0.16.1",
|
||||||
"selenium-webdriver": "^4.0.0",
|
"selenium-webdriver": "^4.1.1",
|
||||||
"tap": "^15.0.10",
|
"tap": "^16.0.1",
|
||||||
"why-is-node-running": "^2.2.0"
|
"why-is-node-running": "^2.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ constants.website_origin = origin
|
|||||||
const dimensions = new Map([
|
const dimensions = new Map([
|
||||||
["firefox", {
|
["firefox", {
|
||||||
scrollbar: 12,
|
scrollbar: 12,
|
||||||
heightDifference: 74,
|
heightDifference: 74+12,
|
||||||
widthDifference: 0
|
widthDifference: 0 // 12
|
||||||
}],
|
}],
|
||||||
["chrome", {
|
["chrome", {
|
||||||
scrollbar: 15,
|
scrollbar: 15,
|
||||||
@ -82,6 +82,7 @@ function exec(command) {
|
|||||||
|
|
||||||
if (scrollNumber > 1) {
|
if (scrollNumber > 1) {
|
||||||
await driver.executeScript(`window.scrollByPages(1)`)
|
await driver.executeScript(`window.scrollByPages(1)`)
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 400)) // magic :( I didn't always need this
|
||||||
}
|
}
|
||||||
|
|
||||||
const finalExists = await fs.access(screenPath("final")).then(() => true).catch(() => false)
|
const finalExists = await fs.access(screenPath("final")).then(() => true).catch(() => false)
|
||||||
@ -91,6 +92,7 @@ function exec(command) {
|
|||||||
const message = `equal screens: ${filenameWithScroll}`
|
const message = `equal screens: ${filenameWithScroll}`
|
||||||
tap.test(message, async childTest => {
|
tap.test(message, async childTest => {
|
||||||
const image = await Jimp.read(screenshot)
|
const image = await Jimp.read(screenshot)
|
||||||
|
console.log("screenshot size", {width: image.bitmap.width, height: image.bitmap.height}, "crop size", command.size)
|
||||||
image.crop(0, 0, command.size.width, command.size.height) // crop out page scrollbar
|
image.crop(0, 0, command.size.width, command.size.height) // crop out page scrollbar
|
||||||
|
|
||||||
if (finalExists) {
|
if (finalExists) {
|
||||||
|
Loading…
Reference in New Issue
Block a user