4 ms·
If you really want to get fancy you could use Selenium to get screenshots and compare them to check that the remynified CSS produces the same layout as the orig
by sbierwagen 10y ago
If you really want to get fancy you could use Selenium to get screenshots and compare them to check that the remynified CSS produces the same layout as the original CSS.
http://www.seleniumhq.org/ http://www.seleniumhq.org/
- make3 10y agorunning one instance for each combination for each targeted browser and browser version, lol. this would take forever
- make3 10y agorunning one instance for each combination for each targeted browser and browser version, lol. this would take forever
- Khalos 10y agoThis would be great, but would probably significantly hurt performance. Especially if media queries come into play and we'd have to try different resolutions and ensure they're all the same.
- chiefofgxbxl 10y agoTo add to that point, if you manage to get screenshots you can do an image comparison using perceptual hashing [0]. The idea is to compute hashes of images and compare those, rather than scanning through each pixel. Note that perceptual hashes should not obey the avalanche effect, so a minor difference in the two images should yield a small change in the hashes (desirable in this case). Then accept results that are within some small % error margin. An example of a library that does this is jimp [1]. [0] https://en.wikipedia.org/wiki/Perceptual_hashing https://en.wikipedia.org/wiki/Perceptual_hashing [1] https://github.com/oliver-moran/jimp#comparing-images https://github.com/oliver-moran/jimp#comparing-images
- bowmessage 10y agoThis is a really cool concept. Thanks.