diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 3dfa0359..e1986d39 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -93,6 +93,7 @@ jobs: if: ${{ matrix.targetPlatform != 'StandaloneWindows64' }} run: | if [[ "${{ matrix.targetPlatform }}" == "StandaloneOSX" ]]; then + pip uninstall -y browserstack-sdk || true pip install -r "sample/Tests/requirements-desktop.txt" else pip install -r "sample/Tests/requirements-mobile.txt" diff --git a/sample/Tests/test/test_mac_device_code_logout.py b/sample/Tests/test/test_device_code_logout.py similarity index 100% rename from sample/Tests/test/test_mac_device_code_logout.py rename to sample/Tests/test/test_device_code_logout.py diff --git a/sample/Tests/test/test_mac.py b/sample/Tests/test/test_mac.py index 507df3c1..bd18c6d5 100644 --- a/sample/Tests/test/test_mac.py +++ b/sample/Tests/test/test_mac.py @@ -5,6 +5,8 @@ from alttester import * +from test import TestConfig + class MacTest(unittest.TestCase): altdriver = None @@ -52,7 +54,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(TestConfig.WALLET_ADDRESS, output.get_text()) def test_3_device_code_relogin(self): # Select use device code auth @@ -98,4 +100,13 @@ 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()) \ No newline at end of file + self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) + + def test_5_logout(self): + # Logout + self.altdriver.find_object(By.NAME, "LogoutBtn").tap() + + time.sleep(10) + + # Wait for authenticated screen + self.altdriver.wait_for_current_scene_to_be("UnauthenticatedScene") \ No newline at end of file diff --git a/sample/Tests/test/test_windows.py b/sample/Tests/test/test_windows.py index 9aad24be..e5124d67 100644 --- a/sample/Tests/test/test_windows.py +++ b/sample/Tests/test/test_windows.py @@ -4,6 +4,8 @@ from alttester import * +from test import TestConfig + class WindowsTest(unittest.TestCase): altdriver = None @@ -39,7 +41,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("0x7dd423aeaccfbdd3a043bb8583085c7d97032de9", output.get_text()) + self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) def test_3_device_code_relogin(self): # Relogin @@ -73,4 +75,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("0x7dd423aeaccfbdd3a043bb8583085c7d97032de9", output.get_text()) + self.assertEqual(TestConfig.WALLET_ADDRESS, output.get_text()) diff --git a/sample/Tests/test_mac.sh b/sample/Tests/test_mac.sh index 89e03bbf..aa00c476 100755 --- a/sample/Tests/test_mac.sh +++ b/sample/Tests/test_mac.sh @@ -96,7 +96,7 @@ run_python_script "src/device_code_logout.py" sleep 5 activate_sample_app "$app_name" echo "Running Mac device code logout test..." -pytest test/test_mac_device_code_logout.py +pytest test/test_device_code_logout.py wait close_chrome @@ -118,7 +118,7 @@ run_python_script "src/device_code_logout.py" sleep 5 activate_sample_app "$app_name" echo "Running Mac device code logout test..." -pytest test/test_mac_device_code_logout.py +pytest test/test_device_code_logout.py wait close_chrome diff --git a/sample/Tests/test_windows.ps1 b/sample/Tests/test_windows.ps1 index 9eb0552a..f1650a28 100644 --- a/sample/Tests/test_windows.ps1 +++ b/sample/Tests/test_windows.ps1 @@ -105,7 +105,7 @@ function Logout { Bring-SampleAppToForeground Write-Output "Running logout test..." - $pytestProcess = Start-Process -FilePath "pytest" -ArgumentList "test/test_mac_device_code_logout.py" -NoNewWindow -PassThru + $pytestProcess = Start-Process -FilePath "pytest" -ArgumentList "test/test_device_code_logout.py" -NoNewWindow -PassThru $pythonProcess | Wait-Process