Seems like GUT allows you to write tests in GDScript
Unit tests will allow you to test individual components of your game, once put together they should work if the tests pass, including gameplay.
If you make your own demo system you could test games by playing back inputs, but if any bit of gameplay code changes you’ll have to update your demo/test too, it’s usually not worth the work and upkeep.
Both GUT and gdUnit4 support running tests from the CLI, which is the normal way for build automation to run them. gdUnit4 comes with its own Github action. Testing gameplay is very possible. Even cucumber-style BDD testing is possible as shown here: @bitbra.in on Bluesky (although I’m not sure that would work headless in CI)
Do you mean a specific kind of game play, like 3D?
Key presses can be tested just like regular function calls. An example can be found in this Youtube tutorial (and at that timestamp).
As for automation, I don’t know how to run GDUnit from the command line, but would also be interested in figuring that out. I’m usually annoyed that when running it from the extension’s editor tab it pops open a Godot window which steals the focus. Would be nice to avoid that.