diff --git a/sample/Tests/test/test_android.py b/sample/Tests/test/test_android.py index 14e2d5f1..489f88b5 100644 --- a/sample/Tests/test/test_android.py +++ b/sample/Tests/test/test_android.py @@ -106,9 +106,6 @@ def test_2_other_functions(self): def test_3_passport_functions(self): self.test_1_passport_functions() - def test_4_imx_functions(self): - self.test_2_imx_functions() - def test_5_zkevm_functions(self): self.test_3_zkevm_functions() @@ -140,11 +137,6 @@ def test_6_pkce_relogin(self): output = self.altdriver.find_object(By.NAME, "Output") self.assertTrue(len(output.get_text()) > 50) - # Click Connect to IMX button - self.altdriver.find_object(By.NAME, "ConnectBtn").tap() - time.sleep(5) - self.assertEqual("Connected to IMX", output.get_text()) - self.altdriver.stop() def test_7_pkce_reconnect(self): @@ -187,46 +179,4 @@ def test_7_pkce_reconnect(self): time.sleep(5) print("Logged out") - self.altdriver.stop() - - def test_8_pkce_connect_imx(self): - self.close_and_open_app() - - # Restart AltTester - self.altdriver.stop() - self.altdriver = AltDriver() - time.sleep(5) - - # Select use PKCE auth - self.altdriver.find_object(By.NAME, "PKCE").tap() - # Wait for unauthenticated screen - self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene") - - # Connect IMX - print("Logging in and connecting to IMX...") - self.altdriver.wait_for_object(By.NAME, "ConnectBtn").tap() - - self.login() - - # Wait for authenticated screen - self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene") - print("Logged in and connected to IMX") - - # Get access token - self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap() - output = self.altdriver.find_object(By.NAME, "Output") - self.assertTrue(len(output.get_text()) > 50) - - # Get address without having to click Connect to IMX button - self.altdriver.find_object(By.NAME, "GetAddressBtn").tap() - self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) - - # Logout - print("Logging out...") - self.altdriver.find_object(By.NAME, "LogoutBtn").tap() - time.sleep(5) - - # Wait for authenticated screen - self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene") - time.sleep(5) - print("Logged out") \ No newline at end of file + self.altdriver.stop() \ No newline at end of file diff --git a/sample/Tests/test/test_mac.py b/sample/Tests/test/test_mac.py index ce4203d4..297a2db7 100644 --- a/sample/Tests/test/test_mac.py +++ b/sample/Tests/test/test_mac.py @@ -1,5 +1,6 @@ import sys import time +import unittest import os import subprocess from pathlib import Path @@ -173,6 +174,7 @@ def logout(cls): bring_sample_app_to_foreground() cls.altdriver.find_object(By.NAME, "LogoutBtn").tap() time.sleep(5) + bring_sample_app_to_foreground() # Bring app back to foreground after browser processes logout cls.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene") time.sleep(2) cls.stop_browser() @@ -229,9 +231,6 @@ def test_2_other_functions(self): def test_3_passport_functions(self): self.test_1_passport_functions() - def test_4_imx_functions(self): - self.test_2_imx_functions() - def test_5_zkevm_functions(self): self.test_3_zkevm_functions() @@ -261,11 +260,6 @@ def test_6_relogin(self): output = self.altdriver.find_object(By.NAME, "Output") self.assertTrue(len(output.get_text()) > 50) - # Click Connect to IMX button - self.altdriver.find_object(By.NAME, "ConnectBtn").tap() - time.sleep(5) - self.assertEqual("Connected to IMX", output.get_text()) - self.altdriver.stop() def test_7_reconnect_connect_imx(self): @@ -300,28 +294,3 @@ def test_7_reconnect_connect_imx(self): # Logout self.logout() - - # Connect IMX - time.sleep(5) - print("Logging in and connecting to IMX...") - self.launch_browser() - bring_sample_app_to_foreground() - self.altdriver.wait_for_object(By.NAME, "ConnectBtn").tap() - self.login() - - self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene") - - self.stop_browser() - print("Logged in and connected to IMX") - - # Get access token - self.altdriver.find_object(By.NAME, "GetAccessTokenBtn").tap() - output = self.altdriver.find_object(By.NAME, "Output") - self.assertTrue(len(output.get_text()) > 50) - - # Get address without having to click Connect to IMX button - self.altdriver.find_object(By.NAME, "GetAddressBtn").tap() - self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) - - # Logout - self.logout() \ No newline at end of file diff --git a/sample/Tests/test/test_windows.py b/sample/Tests/test/test_windows.py index b956d6d5..2ea29eec 100644 --- a/sample/Tests/test/test_windows.py +++ b/sample/Tests/test/test_windows.py @@ -8,6 +8,7 @@ """ import time +import unittest from alttester import * @@ -197,14 +198,6 @@ def test_3_passport_functions(self): 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") @@ -231,11 +224,6 @@ def test_6_relogin(self): self.get_altdriver().find_object(By.NAME, "GetAccessTokenBtn").tap() output = self.get_altdriver().find_object(By.NAME, "Output") self.assertTrue(len(output.get_text()) > 50) - - # Click Connect to IMX button - 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) @@ -256,11 +244,14 @@ def test_7_reconnect_connect_imx(self): # Get access token self.get_altdriver().find_object(By.NAME, "GetAccessTokenBtn").tap() + time.sleep(2) # Give Unity time to fetch and display the access token output = self.get_altdriver().find_object(By.NAME, "Output") self.assertTrue(len(output.get_text()) > 50) # Get address without having to click Connect to IMX button self.get_altdriver().find_object(By.NAME, "GetAddressBtn").tap() + time.sleep(2) # Give Unity time to fetch and display the address + output = self.get_altdriver().find_object(By.NAME, "Output") # Re-fetch output after address is loaded self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) # Logout @@ -272,63 +263,17 @@ def test_7_reconnect_connect_imx(self): # Use controlled browser logout instead of waiting for scene change logout_with_controlled_browser() + # Bring Unity app to foreground immediately so it can receive the logout callback + bring_sample_app_to_foreground() + # Give Unity time to process the logout callback time.sleep(5) - bring_sample_app_to_foreground() - # Wait for authenticated screen + # Wait for unauthenticated 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() - bring_sample_app_to_foreground() - self.get_altdriver().wait_for_object(By.NAME, "ConnectBtn").tap() - login() - bring_sample_app_to_foreground() - - # Wait for authenticated screen - self.get_altdriver().wait_for_current_scene_to_be("AuthenticatedScene") - print("Logged in and connected to IMX") - stop_browser() - - # Get access token - self.get_altdriver().find_object(By.NAME, "GetAccessTokenBtn").tap() - output = self.get_altdriver().find_object(By.NAME, "Output") - self.assertTrue(len(output.get_text()) > 50) - - # Get address without having to click Connect to IMX button - self.get_altdriver().find_object(By.NAME, "GetAddressBtn").tap() - self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) - - # Logout - launch_browser() - 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) + print("=" * 60) \ No newline at end of file diff --git a/src/Packages/Passport/Runtime/Resources/index.html b/src/Packages/Passport/Runtime/Resources/index.html index a542457e..32aa2785 100644 --- a/src/Packages/Passport/Runtime/Resources/index.html +++ b/src/Packages/Passport/Runtime/Resources/index.html @@ -1,4 +1,9 @@ -
+ Please try again below.
+ If the problem continues, adjust your
+ browser settings.
+
+ Secure pop-up not showing?
We'll help you re-launch
+