Looping tests more verbose on failure

We test legends/htmlpopups in loops. When a test fails, it's not clearly visible which layer failed. With this PR, this is a little easier to see.