Would you be open to sharing what you built for running the automation tests? I could really use this right now.
One useful trick is to cua-driver 'launch_app' instead of the default 'open' or other osascript, since it can start the app without raising/focusing it, and the tests don't disturb your active desktop while they run