Skip to content

Commit

Permalink
test: fix windows ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Nov 10, 2024
1 parent c2a7363 commit 55c23d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sample/Tests/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_3_zkevm_functions(self):
self.altdriver.find_object(By.NAME, "GetBalanceButton").tap()
time.sleep(2)
output = self.altdriver.find_object(By.NAME, "Output")
self.assertEqual("Balance:\nHex: 0x0\nDec: 0", output.get_text())
self.assertRegex(output.get_text(), r"Balance:\nHex: 0x[0-9a-fA-F]+\nDec: \d+")

# Go back to authenticated scene
self.altdriver.find_object(By.NAME, "CancelButton").tap()
Expand Down
4 changes: 2 additions & 2 deletions sample/Tests/test/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_2_device_code_connect_imx(self):

# Get address without having to click Connect to IMX button
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
self.assertEqual("0x9cb14f273de4a8c3d8e9b4c5decbb53519dfa7bd", output.get_text())
self.assertEqual("0x7dd423aeaccfbdd3a043bb8583085c7d97032de9", output.get_text())

def test_3_device_code_relogin(self):
# Relogin
Expand Down Expand Up @@ -73,4 +73,4 @@ def test_4_device_code_reconnect(self):

# Get address without having to click Connect to IMX button
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
self.assertEqual("0x9cb14f273de4a8c3d8e9b4c5decbb53519dfa7bd", output.get_text())
self.assertEqual("0x7dd423aeaccfbdd3a043bb8583085c7d97032de9", output.get_text())
11 changes: 11 additions & 0 deletions sample/Tests/test_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,18 @@ function Login {
)
# Start Chrome for remote debugging
Write-Output "Starting Chrome..."

$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"

# Run Python script for login
Expand Down

0 comments on commit 55c23d4

Please sign in to comment.