From 08491932d20cdbd57d8aa0cf62b7f75b92d17145 Mon Sep 17 00:00:00 2001 From: Natalie Bunduwongse Date: Mon, 18 Nov 2024 13:57:44 +1300 Subject: [PATCH] test: add missing scene to build script, fix windows chrome path --- sample/Assets/Editor/MacBuilder.cs | 3 ++- sample/Assets/Editor/MobileBuilder.cs | 3 ++- sample/Assets/Editor/WindowsBuilder.cs | 3 ++- sample/Tests/test/test.py | 4 ++++ sample/Tests/test_windows.ps1 | 12 +++++++++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/sample/Assets/Editor/MacBuilder.cs b/sample/Assets/Editor/MacBuilder.cs index a38af074..32553406 100644 --- a/sample/Assets/Editor/MacBuilder.cs +++ b/sample/Assets/Editor/MacBuilder.cs @@ -72,7 +72,8 @@ private static BuildPlayerOptions CreateBuildPlayerOptions(string buildPath, Bui "Assets/Scenes/ZkEvmGetTransactionReceipt.unity", "Assets/Scenes/ZkEvmSendTransaction.unity", "Assets/Scenes/ImxNftTransfer.unity", - "Assets/Scenes/ZkEVMSignTypedData.unity" + "Assets/Scenes/ZkEVMSignTypedData.unity", + "Assets/Scenes/SetCallTimeout.unity" }, locationPathName = buildPath, target = BuildTarget.StandaloneOSX, diff --git a/sample/Assets/Editor/MobileBuilder.cs b/sample/Assets/Editor/MobileBuilder.cs index 75b48380..116108f0 100644 --- a/sample/Assets/Editor/MobileBuilder.cs +++ b/sample/Assets/Editor/MobileBuilder.cs @@ -105,7 +105,8 @@ private static BuildPlayerOptions CreateBuildPlayerOptions(string buildPath, Bui "Assets/Scenes/ZkEvmGetTransactionReceipt.unity", "Assets/Scenes/ZkEvmSendTransaction.unity", "Assets/Scenes/ImxNftTransfer.unity", - "Assets/Scenes/ZkEVMSignTypedData.unity" + "Assets/Scenes/ZkEVMSignTypedData.unity", + "Assets/Scenes/SetCallTimeout.unity" }, locationPathName = buildPath, target = platform, diff --git a/sample/Assets/Editor/WindowsBuilder.cs b/sample/Assets/Editor/WindowsBuilder.cs index 35d752fb..b8b659f3 100644 --- a/sample/Assets/Editor/WindowsBuilder.cs +++ b/sample/Assets/Editor/WindowsBuilder.cs @@ -72,7 +72,8 @@ private static BuildPlayerOptions CreateBuildPlayerOptions(string buildPath, Bui "Assets/Scenes/ZkEvmGetTransactionReceipt.unity", "Assets/Scenes/ZkEvmSendTransaction.unity", "Assets/Scenes/ImxNftTransfer.unity", - "Assets/Scenes/ZkEVMSignTypedData.unity" + "Assets/Scenes/ZkEVMSignTypedData.unity", + "Assets/Scenes/SetCallTimeout.unity" }, locationPathName = buildPath, target = BuildTarget.StandaloneWindows64, diff --git a/sample/Tests/test/test.py b/sample/Tests/test/test.py index 6b8420b9..cda45fd3 100644 --- a/sample/Tests/test/test.py +++ b/sample/Tests/test/test.py @@ -33,6 +33,10 @@ def test_0_other_functions(self): output = self.altdriver.find_object(By.NAME, "Output") self.assertEqual("Set call timeout to: 600000ms", output.get_text()) + # Go back to authenticated scene + self.altdriver.find_object(By.NAME, "CancelButton").tap() + self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene") + def test_1_passport_functions(self): output = self.altdriver.find_object(By.NAME, "Output") diff --git a/sample/Tests/test_windows.ps1 b/sample/Tests/test_windows.ps1 index f1650a28..ec40916d 100644 --- a/sample/Tests/test_windows.ps1 +++ b/sample/Tests/test_windows.ps1 @@ -95,7 +95,17 @@ function Login { function Logout { # Start Chrome for remote debugging Write-Output "Starting Chrome..." - $chromePath = (Get-Command chrome.exe).Source + $chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe" + + if (-not (Test-Path $chromePath)) { + $chromePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" + } + + if (-not (Test-Path $chromePath)) { + Write-Output "Chrome executable not found." + exit + } + Start-Process -FilePath $chromePath -ArgumentList "--remote-debugging-port=9222" Write-Output "Running python script to logout..."