labelle-org / labelle

Label printing software
Apache License 2.0
27 stars 4 forks source link

GUI tests #37

Closed tomers closed 3 months ago

tomers commented 3 months ago

The GUI is rather useless when the app is being run in the test environment, as there are no printers connected (there is no USB backend at all). This simple test verifies the most basic existence of selected widget, and their content. We will need to figure out how to test the app with a state that resembles actual printer. We might need to introduce test mode, in which all supported printers are shown in the device selector, so we can test various features for each.

tomers commented 3 months ago

@maresb please note that this branch is based on the tshalev-add-tests branch. Actually, this PR contains only a single commit (at the moment, that might change later on).

maresb commented 3 months ago

@tomers, any ideas what's going wrong here? It appears that the Python process inside tox is crashing for some reason.

tomers commented 3 months ago

@tomers, any ideas what's going wrong here? It appears that the Python process inside tox is crashing for some reason.

I suspect this: https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#tox-invocationerror-without-further-information

pytest-qt needs a DISPLAY to run, otherwise Qt calls abort() and the process crashes immediately.

tomers commented 3 months ago

I will follow instructions in https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd

maresb commented 3 months ago

Nice. Also, we don't need to be using tox. It may be less trouble to switch to raw pytest and use a GitHub Actions matrix to check the various Python versions.

tomers commented 3 months ago

@maresb I think this PR is ready to be merged :-)

maresb commented 3 months ago

Woah, great work!!!

Go ahead and merge.

For future reference could you please add a comment here about the references you used for:

  1. the Ubuntu dependencies
  2. the start-stop-daemon command?

I don't know where they came from, and they may need to be adjusted in the future, so I'd just like to gather the info while it's still fresh in your head.

maresb commented 3 months ago

I'm really impressed, this looked like a hard one, so I wasn't expecting it to get done today. Very nice!!!

tomers commented 3 months ago

For future reference could you please add a comment here about the references you used for:

The comment in the second commit gives the proper reference. I've committed some changes in other commit by mistake, and now I've arranged it properly, so all dependency handling is done in a single commit, with proper documentation.

Thanks for your kind words!