Our back-end is written in Java, and ideally I'd like a solution that can be done entirely from within Java. What I'm looking for is a headless browser that can load a page, add a listener for the event our script emits, trigger a test of the event, verify the result against an expected value, and then report back to our application if everything's still behaving as expected.
Right now the closest I've come to this is running a PhantomJS file, writing the output to standard output, then calling that from Java and reading the standard output buffer. That's a doable fallback, but I'd prefer something that can be entirely run in Java.
I've looked at Selenium briefly, and am going back to take a closer look, but my first impression was that it would be overkill for what I'm trying to do. Are there any better options out there?