Refactor HTML tests