EasyScience / EasyDiffractionBeta

Upcoming versions of EasyDiffraction
https://easydiffraction.org
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Fix structure viewer rendering on macOS and add basic GUI tests based on screenshot comparison #29

Closed AndrewSazonov closed 4 months ago

AndrewSazonov commented 5 months ago

This PR fixes an issue with QtQuick3D failing to render on macOS. We used os.environ['QSG_RHI_BACKEND'] = 'opengl' to force OpenGL to be the RHI backend on all platforms to be able to use the useOpenGL property for QtCharts XYSeries. This leads to errors like:

RHI is now automatically selected depending on the platform. OpenGL acceleration has been temporarily disabled.

Another addition to this PR is the GUI basic tests, which are based on comparing screenshots for each page of the application to the desired ones. Although we do not use platform-specific GUI elements, screenshots vary slightly from platform to platform. Therefore, comparisons are always made with images created for the same platform. These tests are called twice during the CI process - before creating the application installer and after installing the application on a fresh machine.