python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.94k stars 2.23k forks source link

Fix Selenium heatmap test by using fixed figure size #2010

Closed Conengmo closed 1 month ago

Conengmo commented 1 month ago

Closes https://github.com/python-visualization/folium/issues/2009. Taken out of https://github.com/python-visualization/folium/pull/2008.

It seems like Chrome added some UI element to the headless browser that changed the window size. It's now also inconsistent between my local machine and the CI/CD server. To fix it, I applied a fixed figure size, then crop the screenshot to the figure. That way if the window is a few tens of pixels heigher of shorter, it doesn't matter.

Pre-commit failure is unrelated, see https://github.com/python-visualization/folium/pull/2011