We have rest endpoints (as well as a java admin client library) for everything that can be done through the admin console. One issue at the moment is that the default username/password for the admin has to be changed through the admin console. That's something we're going to improve in the future, but for now you'd have to reset the password manually or use for example Sellenium to do it before running your tests. You can take a look at our Arquillian based testsuite that does exactly this:
https://github.com/keycloak/keycloak/tree/master/testsuite/integration-arquillian