Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX-3453] test: update email #351

Merged
merged 7 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ jobs:
include:
- targetPlatform: StandaloneOSX
runs-on: [self-hosted, macOS]
test_script: test_mac.sh
test_script: ./test_mac.sh
- targetPlatform: StandaloneWindows64
runs-on: [self-hosted, windows]
test_script: test_windows.ps1
test_script: ./test_windows.ps1
- targetPlatform: Android
runs-on: [ self-hosted, macOS ]
test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
Expand All @@ -86,8 +86,18 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: pip install -r "sample/Tests/requirements.txt"
- name: Install dependencies (Windows)
if: ${{ matrix.targetPlatform == 'StandaloneWindows64' }}
run: pip install -r "sample/Tests/requirements-desktop.txt"
- name: Install dependencies (Mac)
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"
fi
- name: Run UI tests
env:
UNITY_APP_PATH: SampleApp.app
Expand Down
9 changes: 9 additions & 0 deletions sample/Tests/requirements-desktop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
AltTester_Driver==2.1.1
google_api_python_client==2.136.0
google_auth_oauthlib==1.2.0
protobuf==5.27.2
selenium==4.22.0
pytest==8.2.2
requests==2.32.3
mailslurp-client==15.19.22
Appium-Python-Client
File renamed without changes.
4 changes: 2 additions & 2 deletions sample/Tests/src/fetch_otp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from mailslurp_client.api import InboxControllerApi, WaitForControllerApi
import re

INBOX_ID = "33f17f82-274b-4269-9ce6-c620e89fcd8d"
EMAIL = "user-33f17f82-274b-4269-9ce6-c620e89fcd8d@mailslurp.biz"
INBOX_ID = "7cff2120-f684-4f31-886f-b29ca2400247"
EMAIL = "7cff2120-f684-4f31-886f-b29ca2400247@mailslurp.net"

def get_mailslurp_client():
configuration = mailslurp_client.Configuration()
Expand Down
6 changes: 3 additions & 3 deletions sample/Tests/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from alttester import *

class TestConfig:
EMAIL = "user-33f17f82-274b-4269-9ce6-c620e89fcd8d@mailslurp.biz"
PASSPORT_ID="email|671ed01e2ab74483c4fb1f42"
WALLET_ADDRESS = "0x7dd423aeaccfbdd3a043bb8583085c7d97032de9"
EMAIL = "7cff2120-f684-4f31-886f-b29ca2400247@mailslurp.net"
PASSPORT_ID="email|67365ff8219c150ace187e28"
WALLET_ADDRESS = "0xdd571aa2f37f6b5166b14c6e43f1114bf444cdd8"

class UnityTest(unittest.TestCase):

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
Loading