Skip to content

Commit 184420d

Browse files
authored
Run browser tests in safari
1 parent 3d2e16f commit 184420d

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ jobs:
297297
python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="firefox" --kill_exit --timeout 60 --browser-args="--headless" test_xeus_cpp.html
298298
echo "Running test_xeus_cpp in Google Chrome"
299299
python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
300+
sudo safaridriver --enable
301+
python -m pip install selenium
302+
echo "Running test_xeus_cpp in Safari"
303+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html &
304+
python browser_tests_safari.py test_xeus_cpp.html
300305
else
301306
# Install Google Chrome
302307
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

scripts/browser_tests_safari.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
import time
3+
from selenium import webdriver
4+
5+
driver = webdriver.Safari()
6+
driver.get("http://localhost:6931/" + sys.argv[1])
7+
8+
time.sleep(60)
9+
driver.quit()

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ set(XEUS_CPP_TESTS
5151
add_executable(test_xeus_cpp ${XEUS_CPP_TESTS})
5252

5353
if(EMSCRIPTEN)
54+
file(COPY ${CMAKE_SOURCE_DIR}/scripts/browser_tests_safari.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
5455
target_link_libraries(test_xeus_cpp PRIVATE xeus-cpp-static doctest::doctest)
5556

5657
target_compile_options(test_xeus_cpp

0 commit comments

Comments
 (0)