The angularFire $add method returns a promise, which when resolved will contain a Firebase reference to your newly pushed value. With that value, you can get the UID.
$scope.tests.$add({
...your object....
})
.then(function(ref) {
$location.path("/test/"+ref.name());
});