Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_devel_recaptcha_sign_up #912

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions testsuite/tests/ui/devel/auth/test_login_recaptcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from testsuite import settings, rawobj, TESTED_VERSION # noqa # pylint: disable=unused-import
from testsuite.ui.views.admin.audience.developer_portal import BotProtection
from testsuite.ui.views.devel.login import BasicSignUpView, LoginView, SuccessfulAccountCreationView, ForgotPasswordView
from testsuite.ui.views.devel.login import BasicSignUpView, LoginView, ForgotPasswordView
from testsuite.utils import blame, warn_and_skip

# requires special setup, internet access
Expand All @@ -30,7 +30,8 @@ def ui_devel_account(request, testconfig, threescale):

if not testconfig["skip_cleanup"]:
usr = threescale.accounts.read_by_name(user_name)
request.addfinalizer(usr.delete)
if usr:
request.addfinalizer(usr.delete)


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -66,6 +67,8 @@ def test_devel_recaptcha_sing_up(provider_account, ui_devel_account, navigator):
- Navigates and fills up the Sign Up page on developer portal
- Assert that invisible recaptcha badge is present
- Submits the form and checks that the success website appears

note: Since reCAPTCHA v3 does not support developer mode, this test does not attempt to submit the form.
"""
signup_view = navigator.open(
BasicSignUpView, url=settings["threescale"]["devel"]["url"], access_code=provider_account["site_access_code"]
Expand All @@ -78,11 +81,6 @@ def test_devel_recaptcha_sing_up(provider_account, ui_devel_account, navigator):
assert signup_view.signup_button.is_enabled
assert signup_view.recaptcha.is_displayed, "Recaptcha was not found on the developer sign up page"

signup_view.signup_button.click()

login_success = SuccessfulAccountCreationView(navigator.browser)
assert login_success.is_displayed


def test_devel_forgot_password_recaptcha(custom_account, navigator, params):
"""
Expand Down
Loading