Fix 'browser is undefined' error when testing