Skip to content

Commit 303ed89

Browse files
committed
test: open url
1 parent 9c4969f commit 303ed89

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

.github/workflows/ui-tests.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ jobs:
9191
'{"LSHandlerURLScheme" = "http"; "LSHandlerRoleAll" = "com.google.chrome";}'
9292
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
9393
'{"LSHandlerURLScheme" = "https"; "LSHandlerRoleAll" = "com.google.chrome";}'
94-
- name: Install duti (default app tool)
95-
run: |
96-
brew install duti
97-
98-
- name: Check default browser using duti
99-
run: |
100-
duti -x http
10194
- name: Install dependencies
10295
run: pip install selenium
10396
- name: Install dependencies (Mac)
@@ -109,10 +102,29 @@ jobs:
109102
else
110103
pip install -r "sample/Tests/requirements-mobile.txt"
111104
fi
112-
- name: Run UI tests
113-
env:
114-
UNITY_APP_PATH: SampleApp.app
115-
UNITY_APP_NAME: SampleApp
116-
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
117-
working-directory: sample/Tests
118-
run: ${{ matrix.test_script }}
105+
- name: Open URL
106+
run: |
107+
open "https://www.google.com"
108+
- name: Check if Chrome is running
109+
run: |
110+
if pgrep -x "Google Chrome" > /dev/null
111+
then
112+
echo "Chrome is running"
113+
else
114+
echo "Chrome is not running"
115+
fi
116+
- name: Check if Safari is running
117+
run: |
118+
if pgrep -x "Safari" > /dev/null
119+
then
120+
echo "Safari is running"
121+
else
122+
echo "Safari is not running"
123+
fi
124+
# - name: Run UI tests
125+
# env:
126+
# UNITY_APP_PATH: SampleApp.app
127+
# UNITY_APP_NAME: SampleApp
128+
# MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
129+
# working-directory: sample/Tests
130+
# run: ${{ matrix.test_script }}

sample/Tests/test/test_mac_2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import time
33
import unittest
44
from pathlib import Path
5+
import subprocess
56

67
from selenium import webdriver
78
from selenium.webdriver.chrome.service import Service
@@ -88,6 +89,9 @@ def test_case(self):
8889
print("Waiting for new window...")
8990
print("Current URL:", seleniumdriver.current_url)
9091
time.sleep(10)
92+
93+
subprocess.run(["open", "https://www.google.com"])
94+
9195
print("New URL:", seleniumdriver.current_url)
9296
print("Number of windows:", len(seleniumdriver.window_handles))
9397
# WebDriverWait(seleniumdriver, 30).until(EC.number_of_windows_to_be(2))

0 commit comments

Comments
 (0)