def METHOD_NAME(live_server, env_browser):
    """E2E user registration and login test."""
    browser = env_browser
    # 1. Go to user registration page
    browser.get(flask.url_for('security.register', _external=True))
    e2e_assert_url(browser, 'security.register')
    # 2. Input user data
    signup_form = browser.find_element(By.NAME, 'register_user_form')
    input_email = signup_form.find_element(By.NAME, 'email')
    input_password = signup_form.find_element(By.NAME, 'password')
    # input w/ name "email"
    # input w/ name "password"
    user_email = 'user@hepdata.net'
    user_password = '12345_SIx'
    input_email.send_keys(user_email)
    input_password.send_keys(user_password)
    # 3. submit form
    signup_form.submit()
    # ...and get a message saying to expect an email
    success_element = browser.find_element(By.CSS_SELECTOR, '.alert-success')
    assert(success_element is not None)
    assert(success_element.text == 'Thank you. Confirmation instructions have been sent to {}.'.format(user_email))
    # 3.5: After registering we should not yet be logged in.
    e2e_assert(browser, not testutils.webdriver_authenticated(browser),
               'Should not be authenticated')
    # 4. go to login-form
    browser.get(flask.url_for('security.login', _external=True))
    e2e_assert_url(browser, 'security.login')
    login_form = browser.find_element(By.NAME, 'login_user_form')
    # 5. input registered info
    login_form.find_element(By.NAME, 'email').send_keys(user_email)
    login_form.find_element(By.NAME, 'password').send_keys(user_password)
    # 6. Submit!
    login_form.submit()
    # 7. We should not yet be able to log in as we haven't confirmed the email
    error_element = browser.find_element(By.CSS_SELECTOR, '.alert-danger')
    assert(error_element is not None)
    assert('Email requires confirmation.' in error_element.text)
    e2e_assert(browser,
               not testutils.webdriver_authenticated(browser),
               'Should not be authenticated')
    # 8. Check that the resend confirmation link works
    browser.get(flask.url_for('security.send_confirmation', _external=True))
    e2e_assert_url(browser, 'security.send_confirmation')
    email_confirm_form = browser.find_element(By.NAME, 'send_confirmation_form')
    # 8a. input registered info
    email_confirm_form.find_element(By.NAME, 'email').send_keys(user_email)
    # 8b. Submit!
    email_confirm_form.submit()
    info_element = browser.find_element(By.CSS_SELECTOR, '.alert-info')
    assert(info_element is not None)
    assert('Confirmation instructions have been sent to %s.' % user_email
           in info_element.text)
    # 9a Generate a confirmation token (this is how it's done in flask_security)
    data = ['2', utils.hash_data(user_email)]
    serializer = URLSafeTimedSerializer(
        secret_key="CHANGE_ME",
        salt="CHANGE_ME"
    )
    token = serializer.dumps(data)
    # 9b Go to the confirmation URL with our token
    browser.get(flask.url_for('security.confirm_email', token=token, _external=True))
    # 9c Check that we're on the dashboard and we've got a success message
    e2e_assert_url(browser, 'hep_dashboard.dashboard')
    success_element = browser.find_element(By.CSS_SELECTOR, '.alert-success')
    assert(success_element is not None)
    assert('Thank you. Your email has been confirmed.' in success_element.text)
    # 9d We should now be logged in
    e2e_assert(browser,
               testutils.webdriver_authenticated(browser),
               'Should be authenticated')
    # 10. logout.
    browser.get(flask.url_for('security.logout', _external=True))
    e2e_assert(browser, not testutils.webdriver_authenticated(browser),
               'Should not be authenticated')
    # 11. go back to login-form
    browser.get(flask.url_for('security.login', _external=True))
    e2e_assert_url(browser, 'security.login')
    login_form = browser.find_element(By.NAME, 'login_user_form')
    # 11a. input registered info
    login_form.find_element(By.NAME, 'email').send_keys(user_email)
    login_form.find_element(By.NAME, 'password').send_keys(user_password)
    # 11b. Submit!
    # check if authenticated at `flask.url_for('security.change_password')`
    login_form.submit()
    e2e_assert(browser, testutils.webdriver_authenticated(browser))
    # 12. check we can access the change password screen
    browser.get(flask.url_for('security.change_password', _external=True))
    e2e_assert_url(browser, 'security.change_password')
    # 13. logout.
    browser.get(flask.url_for('security.logout', _external=True))
    e2e_assert(browser, not testutils.webdriver_authenticated(browser),
               'Should not be authenticated')
    # Delete the newly created account
    user = User.query.filter_by(email=user_email).first()
    login_information = LoginInformation.query.filter_by(user_id=user.id).first()
    db.session.delete(user)
    db.session.delete(login_information)
    db.session.commit()