RAIRLab/Peirce-My-Heart

Make Playwright Tests have Cross-Browser Compatibility

Closed this issue · 3 comments

Ryan's Playwright tests that finally worked and revealed that our text metrics do not match across browsers. While slight, the differences in their widths/heights may cause very bad issues when downloading on one browser and uploading to another. (If an atom is too close to a cut it may end up overlapping, for instance.) They also are not consistent when comparing uitestHeadless running in a local terminal and the Playwright test workflow.

We need some fix, real hopefully, temporary if necessary, ASAP.

One temporary solution, save the browser name the proof was constructed in the proof file and warn the user if they open it in a different browser.

https://stackoverflow.com/questions/46653569/canvas-measuretext-differences-on-browsers-are-huge
Looks like you may be able to get around this by explictly setting the canvas font size in terms of px rather than pt

#343 removes playwright, we will reopen if it is still an issue when we re-add it after 2.0