beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.19k stars 655 forks source link

Add testbed support for Textual backend #2663

Open freakboy3742 opened 2 weeks ago

freakboy3742 commented 2 weeks ago

What is the problem or limitation you are having?

The textual backend is not currently tested by the testbed API. We should be performing automated GUI tests of the textual backend.

Describe the solution you'd like

It should be possible to run briefcase run --test in the testbed folder and get a test and coverage report.

This should then be integrated into CI.

This will likely require a second testbed app, as Briefcase deploys to "windows/linux/macOS", and we're already using those platforms to perform GUI tests. Briefcase supports having multiple apps in a single project, so this will likely only require adding a new app configuration for the desktop platforms, and adding a -a argument wherever we're currently running testbed.

Describe alternatives you've considered

There isn't really an alternative here - having a test suite is a hard requirement for the textual backend to become a serious Toga option.

Additional context

The biggest complication is that textual takes over the console, so we lose progress and console output while running the test suite.

Textual has a test mode that might be useful.