That lets me launch one session, but as an added complication I actually need to start up parallel clients (it is a multi-player game). That is, I need to simulate doing the PIE with clients set to, say, 6 with a dedicated server.
I tried running the above code n times, but it seems to replace each instance each time a new one starts. I suppose I need to use a different Viewport for each one but I can’t see a way to get hold of a different one.
I’ve found the automation documentation to not be complete, since it doesn’t cover non-trivial tests such as this, starting tests from command line and how to pass/fail tests for example.