Update the test case for login to be more robust.