Skip to content

Commit 85e0a13

Browse files
committed
test: fix tests
1 parent e408850 commit 85e0a13

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

.github/workflows/ui-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
if: ${{ matrix.targetPlatform != 'StandaloneWindows64' }}
9494
run: |
9595
if [[ "${{ matrix.targetPlatform }}" == "StandaloneOSX" ]]; then
96+
pip uninstall -y browserstack-sdk || true
9697
pip install -r "sample/Tests/requirements-desktop.txt"
9798
else
9899
pip install -r "sample/Tests/requirements-mobile.txt"

sample/Tests/test/test_mac.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
from alttester import *
77

8+
from test import TestConfig
9+
810
class MacTest(unittest.TestCase):
911

1012
altdriver = None
@@ -52,7 +54,7 @@ def test_2_device_code_connect_imx(self):
5254

5355
# Get address without having to click Connect to IMX button
5456
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
55-
self.assertEqual("0x9cb14f273de4a8c3d8e9b4c5decbb53519dfa7bd", output.get_text())
57+
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
5658

5759
def test_3_device_code_relogin(self):
5860
# Select use device code auth
@@ -98,4 +100,13 @@ def test_4_device_code_reconnect(self):
98100

99101
# Get address without having to click Connect to IMX button
100102
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
101-
self.assertEqual("0x9cb14f273de4a8c3d8e9b4c5decbb53519dfa7bd", output.get_text())
103+
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
104+
105+
def test_5_logout(self):
106+
# Logout
107+
self.altdriver.find_object(By.NAME, "LogoutBtn").tap()
108+
109+
time.sleep(10)
110+
111+
# Wait for authenticated screen
112+
self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene")

sample/Tests/test/test_windows.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from alttester import *
66

7+
from test import TestConfig
8+
79
class WindowsTest(unittest.TestCase):
810

911
altdriver = None
@@ -39,7 +41,7 @@ def test_2_device_code_connect_imx(self):
3941

4042
# Get address without having to click Connect to IMX button
4143
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
42-
self.assertEqual("0x7dd423aeaccfbdd3a043bb8583085c7d97032de9", output.get_text())
44+
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())
4345

4446
def test_3_device_code_relogin(self):
4547
# Relogin
@@ -73,4 +75,4 @@ def test_4_device_code_reconnect(self):
7375

7476
# Get address without having to click Connect to IMX button
7577
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
76-
self.assertEqual("0x7dd423aeaccfbdd3a043bb8583085c7d97032de9", output.get_text())
78+
self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text())

sample/Tests/test_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ run_python_script "src/device_code_logout.py"
9696
sleep 5
9797
activate_sample_app "$app_name"
9898
echo "Running Mac device code logout test..."
99-
pytest test/test_mac_device_code_logout.py
99+
pytest test/test_device_code_logout.py
100100
wait
101101
close_chrome
102102

@@ -118,7 +118,7 @@ run_python_script "src/device_code_logout.py"
118118
sleep 5
119119
activate_sample_app "$app_name"
120120
echo "Running Mac device code logout test..."
121-
pytest test/test_mac_device_code_logout.py
121+
pytest test/test_device_code_logout.py
122122
wait
123123
close_chrome
124124

sample/Tests/test_windows.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function Logout {
105105
Bring-SampleAppToForeground
106106

107107
Write-Output "Running logout test..."
108-
$pytestProcess = Start-Process -FilePath "pytest" -ArgumentList "test/test_mac_device_code_logout.py" -NoNewWindow -PassThru
108+
$pytestProcess = Start-Process -FilePath "pytest" -ArgumentList "test/test_device_code_logout.py" -NoNewWindow -PassThru
109109

110110
$pythonProcess | Wait-Process
111111

0 commit comments

Comments
 (0)