Skip to content

[ID-3859] feat: Passport prefab #539

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

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e556262
feat(passport): add passport manager prefab
CodeSchwert Aug 5, 2025
8b3fc3b
feat(passport): add prefab to package samples
CodeSchwert Aug 5, 2025
20df644
feat(passport): add ui controller example
CodeSchwert Aug 5, 2025
b43ecd7
docs(passport): add passport manager samples readme
CodeSchwert Aug 5, 2025
d8d02be
docs(passport): lint fix prefab samples readme
CodeSchwert Aug 5, 2025
a817e63
fix(passport): fix deeplinking log path
CodeSchwert Aug 5, 2025
a49ace5
feat: add prefab with ui elements baked in
CodeSchwert Aug 8, 2025
111be79
update README
CodeSchwert Aug 11, 2025
65cf736
Merge branch 'main' into feat/passport-prefab
CodeSchwert Aug 11, 2025
5ff7369
feat: add marketing consent support to sdk and prefab
CodeSchwert Aug 12, 2025
8e44b05
chore: lint trailing white space
CodeSchwert Aug 12, 2025
2d241c8
chore: remove comment
CodeSchwert Aug 12, 2025
84ae7a6
docs: update tooltips and quick start
CodeSchwert Aug 12, 2025
fa31da3
docs: default login method setting
CodeSchwert Aug 12, 2025
2900b39
chore: lint fix
CodeSchwert Aug 12, 2025
98a00b3
ci: keep browser alive for Unity deep link redirect in tests
CodeSchwert Aug 12, 2025
150cf8c
ci: increase sample game tester timeout
CodeSchwert Aug 13, 2025
e37e23f
ci: add cmd script popup click
CodeSchwert Aug 13, 2025
72b0e02
fix(tests): solve browser isolation issue for CI authentication
CodeSchwert Aug 13, 2025
917e233
feat(tests): add CI-friendly protocol dialog automation
CodeSchwert Aug 13, 2025
c5284ba
fix(tests): improve OTP input field detection with multiple selectors
CodeSchwert Aug 13, 2025
8773a84
feat(tests): implement hybrid authentication approach for bulletproof CI
CodeSchwert Aug 13, 2025
09f2cdf
fix(tests): increase MailSlurp timeout from 30s to 60s
CodeSchwert Aug 14, 2025
7959475
fix(tests): correct MailSlurp API URL to fix email OTP retrieval
CodeSchwert Aug 14, 2025
3e7f996
fix(tests): add dialog automation to cached authentication scenario
CodeSchwert Aug 14, 2025
0f10c44
fix(tests): handle cached session redirect to new tab
CodeSchwert Aug 14, 2025
aa3b4ed
fix(tests): improve submit button detection with multiple selectors
CodeSchwert Aug 14, 2025
2821052
fix(tests): increase logout timeout for browser automation
CodeSchwert Aug 14, 2025
2984fe0
fix(tests): handle app crashes during logout gracefully
CodeSchwert Aug 14, 2025
dc3b6ec
fix(tests): verify authentication via Unity logs not scene changes
CodeSchwert Aug 14, 2025
61f4866
fix(tests): add additional debug output, separate tests
CodeSchwert Aug 15, 2025
fdd90a5
ftx(tests): handle process isolated logout
CodeSchwert Aug 15, 2025
d30a1e4
feat(tests): add comprehensive authentication automation with browser…
CodeSchwert Aug 15, 2025
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
3 changes: 2 additions & 1 deletion sample/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/Payload.ipa
**/logFile.log
**/local.log
**/local.log
venv/
5 changes: 4 additions & 1 deletion sample/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
"source": "local",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "3.2.0",
"com.cysharp.unitask": "2.3.3"
"com.cysharp.unitask": "2.3.1",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.androidjni": "1.0.0"
}
},
"com.unity.ai.navigation": {
Expand Down
4 changes: 3 additions & 1 deletion sample/Tests/src/fetch_otp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
def get_mailslurp_client():
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = os.getenv('MAILSLURP_API_KEY')
# Use the correct API base URL as per official docs
configuration.host = "https://api.mailslurp.com"
api_client = mailslurp_client.ApiClient(configuration)
waitfor_controller = WaitForControllerApi(api_client)
return waitfor_controller
Expand All @@ -23,7 +25,7 @@ def extract_otp_from_email(email_body):

def fetch_code():
waitfor_controller = get_mailslurp_client()
email = waitfor_controller.wait_for_latest_email(inbox_id=INBOX_ID, timeout=30000, unread_only=True)
email = waitfor_controller.wait_for_latest_email(inbox_id=INBOX_ID, timeout=60000, unread_only=True)
if email:
otp = extract_otp_from_email(email.body)
return otp
Expand Down
64 changes: 61 additions & 3 deletions sample/Tests/test/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
from alttester import *

from test import TestConfig, UnityTest
from test_windows_helpers import login, open_sample_app, launch_browser, bring_sample_app_to_foreground, stop_browser, stop_sample_app
from test_windows_helpers import login, open_sample_app, launch_browser, bring_sample_app_to_foreground, stop_browser, stop_sample_app, logout_with_controlled_browser

class WindowsTest(UnityTest):

@classmethod
def setUpClass(cls):
open_sample_app()
time.sleep(5) # Give time for the app to open
super().setUpClass()
# Initialize AltDriver with longer timeout for flaky CI environment
cls.altdriver = AltDriver(timeout=120) # 120 seconds instead of default 20

@classmethod
def tearDownClass(cls):
Expand All @@ -23,7 +24,8 @@ def restart_app_and_altdriver(self):
stop_sample_app()
open_sample_app()
time.sleep(5) # Give time for the app to open
self.start_altdriver()
# Use same timeout as setUpClass
self.__class__.altdriver = AltDriver(timeout=120)

def login(self):
# Wait for unauthenticated screen
Expand Down Expand Up @@ -83,21 +85,49 @@ def login(self):
raise SystemExit(f"Failed to reset app {err}")

def test_1_login(self):
print("=" * 60)
print("STARTING TEST: test_1_login")
print("=" * 60)
self.login()
print("COMPLETED TEST: test_1_login")
print("=" * 60)

def test_2_other_functions(self):
print("=" * 60)
print("STARTING TEST: test_2_other_functions")
print("=" * 60)
self.test_0_other_functions()
print("COMPLETED TEST: test_2_other_functions")
print("=" * 60)

def test_3_passport_functions(self):
print("=" * 60)
print("STARTING TEST: test_3_passport_functions")
print("=" * 60)
self.test_1_passport_functions()
print("COMPLETED TEST: test_3_passport_functions")
print("=" * 60)

def test_4_imx_functions(self):
print("=" * 60)
print("STARTING TEST: test_4_imx_functions")
print("=" * 60)
self.test_2_imx_functions()
print("COMPLETED TEST: test_4_imx_functions")
print("=" * 60)

def test_5_zkevm_functions(self):
print("=" * 60)
print("STARTING TEST: test_5_zkevm_functions")
print("=" * 60)
self.test_3_zkevm_functions()
print("COMPLETED TEST: test_5_zkevm_functions")
print("=" * 60)

def test_6_relogin(self):
print("=" * 60)
print("STARTING TEST: test_6_relogin")
print("=" * 60)
self.restart_app_and_altdriver()

# Relogin
Expand All @@ -117,8 +147,14 @@ def test_6_relogin(self):
self.get_altdriver().find_object(By.NAME, "ConnectBtn").tap()
time.sleep(5)
self.assertEqual("Connected to IMX", output.get_text())

print("COMPLETED TEST: test_6_relogin")
print("=" * 60)

def test_7_reconnect_connect_imx(self):
print("=" * 60)
print("STARTING TEST: test_7_reconnect_connect_imx")
print("=" * 60)
self.restart_app_and_altdriver()

# Reconnect
Expand All @@ -143,14 +179,33 @@ def test_7_reconnect_connect_imx(self):
launch_browser()
bring_sample_app_to_foreground()
self.get_altdriver().find_object(By.NAME, "LogoutBtn").tap()

# Use controlled browser logout instead of waiting for scene change
logout_with_controlled_browser()

# Give Unity time to process the logout callback
time.sleep(5)
bring_sample_app_to_foreground()

# Wait for authenticated screen
self.get_altdriver().wait_for_current_scene_to_be("UnauthenticatedScene")

stop_browser()
print("Logged out")

print("COMPLETED TEST: test_7_reconnect_connect_imx")
print("=" * 60)

def test_8_connect_imx(self):
print("=" * 60)
print("STARTING TEST: test_8_connect_imx")
print("=" * 60)
# Ensure clean state regardless of previous tests
self.restart_app_and_altdriver()

# Wait for initial scene
self.get_altdriver().wait_for_current_scene_to_be("UnauthenticatedScene")

# Connect IMX
print("Logging in and connecting to IMX...")
launch_browser()
Expand Down Expand Up @@ -178,10 +233,13 @@ def test_7_reconnect_connect_imx(self):
bring_sample_app_to_foreground()
print("Logging out...")
self.get_altdriver().find_object(By.NAME, "LogoutBtn").tap()
logout_with_controlled_browser()
time.sleep(5)
bring_sample_app_to_foreground()

# Wait for authenticated screen
self.get_altdriver().wait_for_current_scene_to_be("UnauthenticatedScene")
stop_browser()
print("Logged out")
print("COMPLETED TEST: test_8_connect_imx")
print("=" * 60)
Loading
Loading