Fix detection of failures in the front-end tests

We have been having the issue that failures in front-end tests are not always reported. This has lead to an instance of failure being committed on trunk.

The issue is that we are doing a page load for the frontend tests, but there is wait for completion, hence tests that fail late, can miss being detected as failing.

This PR adds a completion indication onto the page (via the mocha test finished callback), that selenium can then watch for, and hence check the results at the right time.