refactor E2E tests to handle redirect event at entering credentials