GUIs are designed to be driven by user; not a program.
The public interface of a GUI app is the GUI.
Test code often outruns the GUI it's supposed to be testing.