Skip to content

Commit

Permalink
test: refactor mac and windows ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Nov 19, 2024
1 parent c4e4918 commit 61ee429
Show file tree
Hide file tree
Showing 10 changed files with 395 additions and 397 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
test_script: ./test_mac.sh
- targetPlatform: StandaloneWindows64
runs-on: [self-hosted, windows]
test_script: ./test_windows.ps1
test_script: pytest -xs test/test_windows.py::WindowsTest
- targetPlatform: Android
runs-on: [ self-hosted, macOS ]
test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
Expand Down
66 changes: 0 additions & 66 deletions sample/Tests/src/device_code_login_windows.py

This file was deleted.

33 changes: 0 additions & 33 deletions sample/Tests/src/device_code_logout_windows.py

This file was deleted.

35 changes: 20 additions & 15 deletions sample/Tests/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import unittest
import requests
import re
import pytest

from alttester import *

class TestConfig:
EMAIL = "a1369a61-9149-4499-a75e-610523e2baa7@mailslurp.net"
PASSPORT_ID="email|673a7cc7219c150ace38cf60"
WALLET_ADDRESS = "0xf629c9f0fee71cce1b21a6e5b0db8df2e8cd7354"
EMAIL = "26b067b8-ef3a-4655-955a-19f157b35b6e@mailslurp.net"
PASSPORT_ID="email|673d0795219c150acebff862"
WALLET_ADDRESS = "0x9af9826a83581ddfa0bdd7754de8a741ce64ebe8"

class UnityTest(unittest.TestCase):

Expand All @@ -22,6 +23,7 @@ def setUpClass(cls):
def tearDownClass(cls):
cls.altdriver.stop()

@pytest.mark.skip(reason="Base test should not be executed directly")
def test_0_other_functions(self):
# Show set call timeout scene
self.altdriver.find_object(By.NAME, "CallTimeout").tap()
Expand All @@ -37,6 +39,7 @@ def test_0_other_functions(self):
self.altdriver.find_object(By.NAME, "CancelButton").tap()
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")

@pytest.mark.skip(reason="Base test should not be executed directly")
def test_1_passport_functions(self):
output = self.altdriver.find_object(By.NAME, "Output")

Expand All @@ -61,6 +64,7 @@ def test_1_passport_functions(self):
time.sleep(1)
self.assertEqual("No linked addresses", output.get_text())

@pytest.mark.skip(reason="Base test should not be executed directly")
def test_2_imx_functions(self):
output = self.altdriver.find_object(By.NAME, "Output")

Expand All @@ -75,20 +79,20 @@ def test_2_imx_functions(self):

# Register off-chain
# Wait up to 3 times for "Passport account already registered" to appear
#attempts = 0
#while attempts < 6:
# self.altdriver.find_object(By.NAME, "RegisterOffchainBtn").tap()
# self.assertEqual("Registering off-chain...", output.get_text())
# time.sleep(20)
# if "Passport account already registered" in output.get_text():
# break
# attempts += 1
attempts = 0
while attempts < 3:
self.altdriver.find_object(By.NAME, "RegisterOffchainBtn").tap()
self.assertEqual("Registering off-chain...", output.get_text())
time.sleep(20)
if "Passport account already registered" in output.get_text():
break
attempts += 1

# Assert that the desired text is found after waiting
#self.assertTrue(
# "Passport account already registered" in output.get_text(),
# f"Expected 'Passport account already registered' not found. Actual output: '{output.get_text()}'"
#)
self.assertTrue(
"Passport account already registered" in output.get_text(),
f"Expected 'Passport account already registered' not found. Actual output: '{output.get_text()}'"
)

# Get address
self.altdriver.find_object(By.NAME, "GetAddressBtn").tap()
Expand Down Expand Up @@ -158,6 +162,7 @@ def test_2_imx_functions(self):
self.altdriver.find_object(By.NAME, "CancelButton").tap()
self.altdriver.wait_for_current_scene_to_be("AuthenticatedScene")

@pytest.mark.skip(reason="Base test should not be executed directly")
def test_3_zkevm_functions(self):
output = self.altdriver.find_object(By.NAME, "Output")

Expand Down
25 changes: 0 additions & 25 deletions sample/Tests/test/test_device_code_logout.py

This file was deleted.

Loading

0 comments on commit 61ee429

Please sign in to comment.