Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Nov 15, 2024
1 parent e408850 commit 85e0a13
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 13 additions & 2 deletions sample/Tests/test/test_mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from alttester import *

from test import TestConfig

class MacTest(unittest.TestCase):

altdriver = None
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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())
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")
6 changes: 4 additions & 2 deletions sample/Tests/test/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from alttester import *

from test import TestConfig

class WindowsTest(unittest.TestCase):

altdriver = None
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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())
4 changes: 2 additions & 2 deletions sample/Tests/test_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sample/Tests/test_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 85e0a13

Please sign in to comment.