diff --git a/Makefile b/Makefile index ee244851d82a..3cd5b89649f0 100644 --- a/Makefile +++ b/Makefile @@ -291,6 +291,7 @@ contribs/dist: .build/build-dll.timestamp python3 -m http.server 3001 & touch $@ +# Add --generate as argument to buildtools/check-example to regenerate the reference images .build/%.check.timestamp: .build/examples-ngeo.timestamp \ .build/node_modules.timestamp \ .build/httpserver.timestamp @@ -309,6 +310,7 @@ contribs/dist: .build/build-dll.timestamp ! buildtools/check-example .build/examples-hosted/error.html.png examples/error-ref.png touch $@ +# Add --generate as argument to buildtools/check-example to regenerate the reference images .build/contribs/gmf/%.check.timestamp: .build/examples-gmf.timestamp \ .build/node_modules.timestamp \ .build/httpserver.timestamp @@ -318,6 +320,7 @@ contribs/dist: .build/build-dll.timestamp buildtools/check-example .build/examples-hosted/contribs/gmf/$*.html.png contribs/gmf/examples/$*-ref.png touch $@ +# Add --generate as argument to buildtools/check-example to regenerate the reference images .build/contribs/gmf/apps/%.check.timestamp: .build/gmf-apps.timestamp \ .build/httpserver.timestamp mkdir -p $(dir $@) diff --git a/buildtools/check-example b/buildtools/check-example index 81afe2d4fa63..3e34eb37be2d 100755 --- a/buildtools/check-example +++ b/buildtools/check-example @@ -21,6 +21,7 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +import argparse import os import shutil import subprocess @@ -42,8 +43,14 @@ def main(): Optional mask image (name from Reference image): examples/simple-mask.png Generate diff image (name from Generated image): .build/examples-hosted/simple-diff.png """ - current = sys.argv[1] - ref = sys.argv[2] + parser = argparse.ArgumentParser(description=main.__doc__) + parser.add_argument("--generate", action="store_true", help="Regenerate the ref image") + parser.add_argument("current", help="The current image") + parser.add_argument("ref", help="The reference image") + args = parser.parse_args() + + current = args.current + ref = args.ref mask = ref.replace("-ref", "-mask") diff = current.replace(".html.png", "-diff.png") old_ref = ref @@ -56,12 +63,10 @@ def main(): subprocess.run(["gm", "composite", "-compose", "Multiply", old_current, mask, current], check=True) subprocess.run(["gm", "composite", "-compose", "Multiply", old_ref, mask, ref], check=True) - # Set to True to regenerate ref images - if False: - if "/error-" not in ref: - shutil.copyfile(current, old_ref) - shutil.copyfile(current, ref) - sys.exit(0) + if args.generate and "/error-" not in ref: + shutil.copyfile(current, old_ref) + shutil.copyfile(current, ref) + sys.exit(0) result = subprocess.run( [ "gm", diff --git a/buildtools/check-example.js b/buildtools/check-example.js index 396d54eec03d..8567b94de117 100644 --- a/buildtools/check-example.js +++ b/buildtools/check-example.js @@ -189,14 +189,18 @@ function loaded(page, browser) { request.headers().origin = 'http://localhost:3001'; } console.log(`Request: ${url}`); - request.continue({ - url, - headers: { - // Don't be intranet - 'Forwarded': 'for=8.8.8.8;proto=https', - 'Cache-Control': 'no-cache', - }, - }); + if (url.startsWith('http://localhost:') && url.endsWith('/favicon.ico')) { + request.respond(OSMImage); + } else { + request.continue({ + url, + headers: { + // Don't be intranet + 'Forwarded': 'for=8.8.8.8;proto=https', + 'Cache-Control': 'no-cache', + }, + }); + } } } else if ( url.includes('tile.openstreetmap.org') || @@ -268,7 +272,11 @@ function loaded(page, browser) { console.log(`Console ${type}`); console.log(`On: ${location.url} ${location.lineNumber}:${location.columnNumber}.`); console.log(message.text()); - if (!message.text().includes('CORS')) { + if ( + !message.text().includes('CORS') && + !message.text().includes('Driver Message') && + !message.text().includes('Password field is not contained in a form') + ) { await browser.close(); process.exit(2); } diff --git a/contribs/gmf/apps/desktop-ref.png b/contribs/gmf/apps/desktop-ref.png index 32dfa3687900..e1fd35b6ab31 100644 Binary files a/contribs/gmf/apps/desktop-ref.png and b/contribs/gmf/apps/desktop-ref.png differ diff --git a/contribs/gmf/apps/desktop_alt-ref.png b/contribs/gmf/apps/desktop_alt-ref.png index 2bc28b165018..5098e8c67eab 100644 Binary files a/contribs/gmf/apps/desktop_alt-ref.png and b/contribs/gmf/apps/desktop_alt-ref.png differ diff --git a/contribs/gmf/apps/mobile-ref.png b/contribs/gmf/apps/mobile-ref.png index f64dd99275a0..a373876ae850 100644 Binary files a/contribs/gmf/apps/mobile-ref.png and b/contribs/gmf/apps/mobile-ref.png differ diff --git a/contribs/gmf/apps/mobile_alt-ref.png b/contribs/gmf/apps/mobile_alt-ref.png index c0fb466b0c32..a373876ae850 100644 Binary files a/contribs/gmf/apps/mobile_alt-ref.png and b/contribs/gmf/apps/mobile_alt-ref.png differ diff --git a/contribs/gmf/apps/oeedit-ref.png b/contribs/gmf/apps/oeedit-ref.png index e651abad1748..2dd60458a60b 100644 Binary files a/contribs/gmf/apps/oeedit-ref.png and b/contribs/gmf/apps/oeedit-ref.png differ diff --git a/contribs/gmf/examples/backgroundlayerselector-ref.png b/contribs/gmf/examples/backgroundlayerselector-ref.png index 00b5f87072cd..a13570e2e64a 100644 Binary files a/contribs/gmf/examples/backgroundlayerselector-ref.png and b/contribs/gmf/examples/backgroundlayerselector-ref.png differ diff --git a/contribs/gmf/examples/contextualdata-ref.png b/contribs/gmf/examples/contextualdata-ref.png index 5104bdf8e13f..fd6c0ee60f51 100644 Binary files a/contribs/gmf/examples/contextualdata-ref.png and b/contribs/gmf/examples/contextualdata-ref.png differ diff --git a/contribs/gmf/examples/datepicker-ref.png b/contribs/gmf/examples/datepicker-ref.png index 3549808a00f1..0293f6239261 100644 Binary files a/contribs/gmf/examples/datepicker-ref.png and b/contribs/gmf/examples/datepicker-ref.png differ diff --git a/contribs/gmf/examples/displayquerygrid-ref.png b/contribs/gmf/examples/displayquerygrid-ref.png index ef4b41649fed..5ce3bf226cf8 100644 Binary files a/contribs/gmf/examples/displayquerygrid-ref.png and b/contribs/gmf/examples/displayquerygrid-ref.png differ diff --git a/contribs/gmf/examples/displayquerywindow-ref.png b/contribs/gmf/examples/displayquerywindow-ref.png index 23a5e5567132..72fa9521a8a2 100644 Binary files a/contribs/gmf/examples/displayquerywindow-ref.png and b/contribs/gmf/examples/displayquerywindow-ref.png differ diff --git a/contribs/gmf/examples/drawfeature-ref.png b/contribs/gmf/examples/drawfeature-ref.png index 5c6420b26faf..4772a1c975ae 100644 Binary files a/contribs/gmf/examples/drawfeature-ref.png and b/contribs/gmf/examples/drawfeature-ref.png differ diff --git a/contribs/gmf/examples/elevation-ref.png b/contribs/gmf/examples/elevation-ref.png index ac4e7cd8eb63..09f3ff56d7ac 100644 Binary files a/contribs/gmf/examples/elevation-ref.png and b/contribs/gmf/examples/elevation-ref.png differ diff --git a/contribs/gmf/examples/featurestyle-ref.png b/contribs/gmf/examples/featurestyle-ref.png index 321b9f82de3d..f166755efb17 100644 Binary files a/contribs/gmf/examples/featurestyle-ref.png and b/contribs/gmf/examples/featurestyle-ref.png differ diff --git a/contribs/gmf/examples/importdatasource-ref.png b/contribs/gmf/examples/importdatasource-ref.png index 19048bf755d3..1aa5a48d92b5 100644 Binary files a/contribs/gmf/examples/importdatasource-ref.png and b/contribs/gmf/examples/importdatasource-ref.png differ diff --git a/contribs/gmf/examples/layertree-ref.png b/contribs/gmf/examples/layertree-ref.png index fa2acd2995bf..99969d77cb62 100644 Binary files a/contribs/gmf/examples/layertree-ref.png and b/contribs/gmf/examples/layertree-ref.png differ diff --git a/contribs/gmf/examples/layertreeadd-ref.png b/contribs/gmf/examples/layertreeadd-ref.png index fa2acd2995bf..99969d77cb62 100644 Binary files a/contribs/gmf/examples/layertreeadd-ref.png and b/contribs/gmf/examples/layertreeadd-ref.png differ diff --git a/contribs/gmf/examples/mobilemeasure-ref.png b/contribs/gmf/examples/mobilemeasure-ref.png index 0277de8f1ebb..df5554a25f5e 100644 Binary files a/contribs/gmf/examples/mobilemeasure-ref.png and b/contribs/gmf/examples/mobilemeasure-ref.png differ diff --git a/contribs/gmf/examples/mouseposition-ref.png b/contribs/gmf/examples/mouseposition-ref.png index 0d8fd9800a08..5bda925364bf 100644 Binary files a/contribs/gmf/examples/mouseposition-ref.png and b/contribs/gmf/examples/mouseposition-ref.png differ diff --git a/contribs/gmf/examples/objectediting-ref.png b/contribs/gmf/examples/objectediting-ref.png index 9ccbd9da5d31..9470231e128c 100644 Binary files a/contribs/gmf/examples/objectediting-ref.png and b/contribs/gmf/examples/objectediting-ref.png differ diff --git a/contribs/gmf/examples/objecteditinghub-ref.png b/contribs/gmf/examples/objecteditinghub-ref.png index 94befe7143f7..ca6867a4e512 100644 Binary files a/contribs/gmf/examples/objecteditinghub-ref.png and b/contribs/gmf/examples/objecteditinghub-ref.png differ diff --git a/contribs/gmf/examples/permalink-ref.png b/contribs/gmf/examples/permalink-ref.png index 6bf91f7e52cf..d59e7fdc9b27 100644 Binary files a/contribs/gmf/examples/permalink-ref.png and b/contribs/gmf/examples/permalink-ref.png differ diff --git a/contribs/gmf/examples/print-ref.png b/contribs/gmf/examples/print-ref.png index 26f8433aeae7..e2f710ebf72e 100644 Binary files a/contribs/gmf/examples/print-ref.png and b/contribs/gmf/examples/print-ref.png differ diff --git a/contribs/gmf/examples/profile-ref.png b/contribs/gmf/examples/profile-ref.png index 1be27146166b..43fddb58c885 100644 Binary files a/contribs/gmf/examples/profile-ref.png and b/contribs/gmf/examples/profile-ref.png differ diff --git a/contribs/gmf/examples/search-ref.png b/contribs/gmf/examples/search-ref.png index 9210b80a29d6..d5e5ff05fcf6 100644 Binary files a/contribs/gmf/examples/search-ref.png and b/contribs/gmf/examples/search-ref.png differ diff --git a/contribs/gmf/examples/share-ref.png b/contribs/gmf/examples/share-ref.png index 84ae8420df38..9a3f03eccc26 100644 Binary files a/contribs/gmf/examples/share-ref.png and b/contribs/gmf/examples/share-ref.png differ diff --git a/contribs/gmf/examples/simple-ref.png b/contribs/gmf/examples/simple-ref.png index 8c76c8984053..178d642e2561 100644 Binary files a/contribs/gmf/examples/simple-ref.png and b/contribs/gmf/examples/simple-ref.png differ diff --git a/contribs/gmf/examples/themeselector-ref.png b/contribs/gmf/examples/themeselector-ref.png index 688acb9effd6..b133b670ab60 100644 Binary files a/contribs/gmf/examples/themeselector-ref.png and b/contribs/gmf/examples/themeselector-ref.png differ diff --git a/contribs/gmf/examples/timeslider-ref.png b/contribs/gmf/examples/timeslider-ref.png index c958e3ecbd1d..0f07b6d2070a 100644 Binary files a/contribs/gmf/examples/timeslider-ref.png and b/contribs/gmf/examples/timeslider-ref.png differ diff --git a/contribs/gmf/examples/wfspermalink-ref.png b/contribs/gmf/examples/wfspermalink-ref.png index ed2fa90abc22..21417934340e 100644 Binary files a/contribs/gmf/examples/wfspermalink-ref.png and b/contribs/gmf/examples/wfspermalink-ref.png differ diff --git a/contribs/gmf/examples/xsdattributes-ref.png b/contribs/gmf/examples/xsdattributes-ref.png index 4757fad6ff61..a472d6e043c2 100644 Binary files a/contribs/gmf/examples/xsdattributes-ref.png and b/contribs/gmf/examples/xsdattributes-ref.png differ diff --git a/examples/animation-ref.png b/examples/animation-ref.png index 41934802a2c3..36a354f8038e 100644 Binary files a/examples/animation-ref.png and b/examples/animation-ref.png differ diff --git a/examples/asitvd-ref.png b/examples/asitvd-ref.png index 5c4774926cfe..0480f680ee45 100644 Binary files a/examples/asitvd-ref.png and b/examples/asitvd-ref.png differ diff --git a/examples/attributes-ref.png b/examples/attributes-ref.png index a94df5bab345..46b4d9ea1555 100644 Binary files a/examples/attributes-ref.png and b/examples/attributes-ref.png differ diff --git a/examples/backgroundlayer-ref.png b/examples/backgroundlayer-ref.png index 7a09b71ebed8..3a2c900a7dd6 100644 Binary files a/examples/backgroundlayer-ref.png and b/examples/backgroundlayer-ref.png differ diff --git a/examples/backgroundlayerdropdown-ref.png b/examples/backgroundlayerdropdown-ref.png index d566f6419c01..0f14e3f5a4d1 100644 Binary files a/examples/backgroundlayerdropdown-ref.png and b/examples/backgroundlayerdropdown-ref.png differ diff --git a/examples/colorpicker-ref.png b/examples/colorpicker-ref.png index 103f7d376a80..ebf992ee9eab 100644 Binary files a/examples/colorpicker-ref.png and b/examples/colorpicker-ref.png differ diff --git a/examples/control-ref.png b/examples/control-ref.png index b9e6ae1ea00b..b7dfeac6c4df 100644 Binary files a/examples/control-ref.png and b/examples/control-ref.png differ diff --git a/examples/createfeature-ref.png b/examples/createfeature-ref.png index c3a8dbf7f187..285d4e6007a1 100644 Binary files a/examples/createfeature-ref.png and b/examples/createfeature-ref.png differ diff --git a/examples/datepicker-ref.png b/examples/datepicker-ref.png index 0e36f549b253..0f05f35e3e33 100644 Binary files a/examples/datepicker-ref.png and b/examples/datepicker-ref.png differ diff --git a/examples/datetimepicker-ref.png b/examples/datetimepicker-ref.png index e6927867ca13..fd193ba822d4 100644 Binary files a/examples/datetimepicker-ref.png and b/examples/datetimepicker-ref.png differ diff --git a/examples/disclaimer-ref.png b/examples/disclaimer-ref.png index 55e2c08e7384..0e501b0342c2 100644 Binary files a/examples/disclaimer-ref.png and b/examples/disclaimer-ref.png differ diff --git a/examples/displaywindow-ref.png b/examples/displaywindow-ref.png index 26d2f1ae0997..580ef7d071f6 100644 Binary files a/examples/displaywindow-ref.png and b/examples/displaywindow-ref.png differ diff --git a/examples/drawfeature-ref.png b/examples/drawfeature-ref.png index 616932709047..21c7a33a98df 100644 Binary files a/examples/drawfeature-ref.png and b/examples/drawfeature-ref.png differ diff --git a/examples/elevationProfile-ref.png b/examples/elevationProfile-ref.png index cede9b69130e..b0b55ed3899b 100644 Binary files a/examples/elevationProfile-ref.png and b/examples/elevationProfile-ref.png differ diff --git a/examples/googlestreetview-ref.png b/examples/googlestreetview-ref.png index 478f374518db..bb1014ade40a 100644 Binary files a/examples/googlestreetview-ref.png and b/examples/googlestreetview-ref.png differ diff --git a/examples/grid-ref.png b/examples/grid-ref.png index 07f69bcf8596..889a2cefdfbf 100644 Binary files a/examples/grid-ref.png and b/examples/grid-ref.png differ diff --git a/examples/importfeatures-ref.png b/examples/importfeatures-ref.png index 7cc3803b5425..454f682fc04f 100644 Binary files a/examples/importfeatures-ref.png and b/examples/importfeatures-ref.png differ diff --git a/examples/interactionbtngroup-ref.png b/examples/interactionbtngroup-ref.png index 6daf6c8891af..c4ec51eb6958 100644 Binary files a/examples/interactionbtngroup-ref.png and b/examples/interactionbtngroup-ref.png differ diff --git a/examples/layerorder-ref.png b/examples/layerorder-ref.png index f0f70ba6c4eb..384bcee95e4e 100644 Binary files a/examples/layerorder-ref.png and b/examples/layerorder-ref.png differ diff --git a/examples/locationsearch-ref.png b/examples/locationsearch-ref.png index 55470881b3f5..c33878965bf6 100644 Binary files a/examples/locationsearch-ref.png and b/examples/locationsearch-ref.png differ diff --git a/examples/mapfishprint-ref.png b/examples/mapfishprint-ref.png index a7ad0ebdbf66..a3aab079a489 100644 Binary files a/examples/mapfishprint-ref.png and b/examples/mapfishprint-ref.png differ diff --git a/examples/mapillarystreetview-ref.png b/examples/mapillarystreetview-ref.png index 5f7b1a0f900f..588c4d45161b 100644 Binary files a/examples/mapillarystreetview-ref.png and b/examples/mapillarystreetview-ref.png differ diff --git a/examples/mapswipe-ref.png b/examples/mapswipe-ref.png index dd6520ec175e..b3dbc29f45a6 100644 Binary files a/examples/mapswipe-ref.png and b/examples/mapswipe-ref.png differ diff --git a/examples/mask-ref.png b/examples/mask-ref.png index aafce0492587..477d95a135dc 100644 Binary files a/examples/mask-ref.png and b/examples/mask-ref.png differ diff --git a/examples/measure-ref.png b/examples/measure-ref.png index 870ea48348d2..a226030217b8 100644 Binary files a/examples/measure-ref.png and b/examples/measure-ref.png differ diff --git a/examples/mobilegeolocation-ref.png b/examples/mobilegeolocation-ref.png index 67c9cae41a11..36727313df4d 100644 Binary files a/examples/mobilegeolocation-ref.png and b/examples/mobilegeolocation-ref.png differ diff --git a/examples/modal-ref.png b/examples/modal-ref.png index 529f49aa989a..45850ea82094 100644 Binary files a/examples/modal-ref.png and b/examples/modal-ref.png differ diff --git a/examples/modifycircle-ref.png b/examples/modifycircle-ref.png index 78587318c791..6673cfabfee1 100644 Binary files a/examples/modifycircle-ref.png and b/examples/modifycircle-ref.png differ diff --git a/examples/modifyrectangle-ref.png b/examples/modifyrectangle-ref.png index a6b5788a31c8..815badf04c15 100644 Binary files a/examples/modifyrectangle-ref.png and b/examples/modifyrectangle-ref.png differ diff --git a/examples/notification-ref.png b/examples/notification-ref.png index e03cdabed235..c7446fe87b7f 100644 Binary files a/examples/notification-ref.png and b/examples/notification-ref.png differ diff --git a/examples/permalink-ref.png b/examples/permalink-ref.png index cb55cb8689fe..833f888cc053 100644 Binary files a/examples/permalink-ref.png and b/examples/permalink-ref.png differ diff --git a/examples/popover-ref.png b/examples/popover-ref.png index 34856ffdab52..fabc51953e30 100644 Binary files a/examples/popover-ref.png and b/examples/popover-ref.png differ diff --git a/examples/popupservice-ref.png b/examples/popupservice-ref.png index 1d8bbc3e241c..c89161cab176 100644 Binary files a/examples/popupservice-ref.png and b/examples/popupservice-ref.png differ diff --git a/examples/query-ref.png b/examples/query-ref.png index e43b9766314c..b5df7f211b69 100644 Binary files a/examples/query-ref.png and b/examples/query-ref.png differ diff --git a/examples/recenter-ref.png b/examples/recenter-ref.png index 0eae60f286c6..c3766261644d 100644 Binary files a/examples/recenter-ref.png and b/examples/recenter-ref.png differ diff --git a/examples/rotate-ref.png b/examples/rotate-ref.png index d2b9caa4db6f..b77391c99765 100644 Binary files a/examples/rotate-ref.png and b/examples/rotate-ref.png differ diff --git a/examples/routing-ref.png b/examples/routing-ref.png index a096ff3bb11a..50f5b4a010fb 100644 Binary files a/examples/routing-ref.png and b/examples/routing-ref.png differ diff --git a/examples/scaleselector-ref.png b/examples/scaleselector-ref.png index 817795279f3a..40742cc5b7b2 100644 Binary files a/examples/scaleselector-ref.png and b/examples/scaleselector-ref.png differ diff --git a/examples/search-ref.png b/examples/search-ref.png index 73e9705786e0..d61bf89ad928 100644 Binary files a/examples/search-ref.png and b/examples/search-ref.png differ diff --git a/examples/simple-ref.png b/examples/simple-ref.png index ab4eebccdf4a..2b5dd68f0331 100644 Binary files a/examples/simple-ref.png and b/examples/simple-ref.png differ diff --git a/examples/svg-ref.png b/examples/svg-ref.png index ec0cb58ffbf0..0a84547bf051 100644 Binary files a/examples/svg-ref.png and b/examples/svg-ref.png differ diff --git a/examples/toolActivate-ref.png b/examples/toolActivate-ref.png index 285deadf68b8..3d94b7b3c058 100644 Binary files a/examples/toolActivate-ref.png and b/examples/toolActivate-ref.png differ diff --git a/package.json b/package.json index a6c661d5e515..e81858d767ac 100644 --- a/package.json +++ b/package.json @@ -184,7 +184,7 @@ "ol-mapbox-style": "12.3.5", "parse-absolute-css-unit": "1.0.2", "proj4": "2.11.0", - "puppeteer": "21.11.0", + "puppeteer": "22.15.0", "qruri": "0.0.4", "raw-loader": "4.0.2", "react": "18.3.1",