Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33b0c3f1fb | |||
| 8f1a1110e2 |
+12
-4
@@ -6,6 +6,10 @@ extends Control
|
|||||||
## The Login and Register buttons on the AuthButtonsRow directly set the panel's
|
## The Login and Register buttons on the AuthButtonsRow directly set the panel's
|
||||||
## mode, so the user can switch between Login and Register at any time while
|
## mode, so the user can switch between Login and Register at any time while
|
||||||
## the panel is open.
|
## the panel is open.
|
||||||
|
##
|
||||||
|
## On successful auth the token is stored via ApiClient, AuthButtonsRow hides,
|
||||||
|
## the welcome label shows the username, and the Play button becomes enabled.
|
||||||
|
## The auth form fields are hidden, leaving only the welcome message visible.
|
||||||
|
|
||||||
# ─── UI references ────────────────────────────────────────────────────────────
|
# ─── UI references ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -162,12 +166,16 @@ func _on_auth_complete(result: Dictionary) -> void:
|
|||||||
_is_authenticating = false
|
_is_authenticating = false
|
||||||
|
|
||||||
if result.ok:
|
if result.ok:
|
||||||
# Success — show welcome, enable Play, hide the now-redundant
|
# Success — hide the auth form fields, show only the welcome label.
|
||||||
# Login/Register entry points (the auth panel itself stays open,
|
_username_edit.visible = false
|
||||||
# showing the welcome message in place of the form).
|
_password_edit.visible = false
|
||||||
|
_email_edit.visible = false
|
||||||
|
_dob_edit.visible = false
|
||||||
|
_auth_button.visible = false
|
||||||
|
_auth_mode_label.visible = false
|
||||||
|
_status_label.visible = false
|
||||||
_welcome_label.text = "Welcome, %s!" % _username_edit.text.strip_edges()
|
_welcome_label.text = "Welcome, %s!" % _username_edit.text.strip_edges()
|
||||||
_welcome_label.visible = true
|
_welcome_label.visible = true
|
||||||
_status_label.visible = false
|
|
||||||
_play_button.disabled = false
|
_play_button.disabled = false
|
||||||
_auth_buttons_row.visible = false
|
_auth_buttons_row.visible = false
|
||||||
print("Auth successful. Token stored.")
|
print("Auth successful. Token stored.")
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
extends SceneTree
|
extends SceneTree
|
||||||
## Full click-through simulation of the real user flow: press Register,
|
## Full click-through simulation of the real user flow: press Register,
|
||||||
## fill the form exactly as a human would, submit, confirm Play actually
|
## fill the form exactly as a human would, submit, confirm Play actually
|
||||||
## becomes clickable. This is the check that would have caught the
|
## becomes clickable. Also verifies that after successful auth the auth
|
||||||
## original bug (no way to even open the form) and would catch a repeat
|
## form fields are hidden, leaving only the welcome message visible.
|
||||||
## of it.
|
|
||||||
|
|
||||||
var passed := 0
|
var passed := 0
|
||||||
var failed := 0
|
var failed := 0
|
||||||
@@ -28,6 +27,7 @@ func _run() -> void:
|
|||||||
var email_edit: LineEdit = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/EmailEdit")
|
var email_edit: LineEdit = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/EmailEdit")
|
||||||
var dob_edit: LineEdit = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/DOBEdit")
|
var dob_edit: LineEdit = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/DOBEdit")
|
||||||
var auth_button: Button = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthButton")
|
var auth_button: Button = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthButton")
|
||||||
|
var auth_mode_label: Label = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthModeLabel")
|
||||||
var welcome_label: Label = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/WelcomeLabel")
|
var welcome_label: Label = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/WelcomeLabel")
|
||||||
var play_button: Button = instance.get_node("CenterContainer/VBoxContainer/PlayButton")
|
var play_button: Button = instance.get_node("CenterContainer/VBoxContainer/PlayButton")
|
||||||
|
|
||||||
@@ -63,6 +63,16 @@ func _run() -> void:
|
|||||||
_check("Welcome label visible", welcome_label.visible)
|
_check("Welcome label visible", welcome_label.visible)
|
||||||
_check("Auth buttons row hid itself after success", not auth_buttons_row.visible)
|
_check("Auth buttons row hid itself after success", not auth_buttons_row.visible)
|
||||||
|
|
||||||
|
# Verify the auth form fields are hidden after successful auth,
|
||||||
|
# leaving only the welcome message visible within the panel.
|
||||||
|
_check("Username edit hidden after auth", not username_edit.visible)
|
||||||
|
_check("Password edit hidden after auth", not password_edit.visible)
|
||||||
|
_check("Email edit hidden after auth", not email_edit.visible)
|
||||||
|
_check("DOB edit hidden after auth", not dob_edit.visible)
|
||||||
|
_check("Auth button hidden after auth", not auth_button.visible)
|
||||||
|
_check("Auth mode label hidden after auth", not auth_mode_label.visible)
|
||||||
|
_check("Welcome label contains username", welcome_label.text.begins_with("Welcome, mainmenu_e2e_"))
|
||||||
|
|
||||||
print("\n=== SMOKE RESULT: %d/%d passed ===" % [passed, passed + failed])
|
print("\n=== SMOKE RESULT: %d/%d passed ===" % [passed, passed + failed])
|
||||||
quit(0 if failed == 0 else 1)
|
quit(0 if failed == 0 else 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user