Refactored navbar page test code.