Skip to content

Commit 5efac06

Browse files
authored
Add docs on how to run browser tests in Safari
1 parent 316aed4 commit 5efac06

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cd test
101101
node test_xeus_cpp.js
102102
```
103103

104-
It is possible to run the Emscripten tests in a headless browser. We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this on MacOS execute the following
104+
It is possible to run the Emscripten tests in a headless browser. We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this for Chrome and Firefox on MacOS execute the following
105105

106106
```bash
107107
wget "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" -O Firefox-latest.dmg
@@ -124,6 +124,16 @@ echo "Running test_xeus_cpp in Google Chrome"
124124
python $BUILD_PREFIX/bin/emrun.py --browser="Google Chrome" --kill_exit --browser-args="--headless --no-sandbox" test_xeus_cpp.html
125125
```
126126

127+
To run tests in Safari you can make use of safaridriver. How to enable this will depend on
128+
your MacOS operating system, and is best to consult [safaridriver](https://developer.apple.com/documentation/webkit/testing-with-webdriver-in-safari). You will also need to install the Selenium
129+
python package. This only needs to be enable once, and then you can execute the following to run the tests in Safari
130+
131+
```bash
132+
echo "Running test_xeus_cpp in Safari"
133+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html &
134+
python browser_tests_safari.py test_xeus_cpp.html
135+
```
136+
127137
To do this on Ubuntu x86 execute the following
128138

129139
```bash

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ cd test
113113
node test_xeus_cpp.js
114114
```
115115

116-
It is possible to run the Emscripten tests in a headless browser. We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this on MacOS execute the following
116+
It is possible to run the Emscripten tests in a headless browser. We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this for Chrome and Firefox on MacOS execute the following
117117

118118
```bash
119119
wget "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" -O Firefox-latest.dmg
@@ -136,6 +136,16 @@ echo "Running test_xeus_cpp in Google Chrome"
136136
python python $BUILD_PREFIX/bin/emrun.py --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
137137
```
138138

139+
To run tests in Safari you can make use of safaridriver. How to enable this will depend on
140+
your MacOS operating system, and is best to consult [safaridriver](https://developer.apple.com/documentation/webkit/testing-with-webdriver-in-safari). You will also need to install the Selenium
141+
python package. This only needs to be enable once, and then you can execute the following to run the tests in Safari
142+
143+
```bash
144+
echo "Running test_xeus_cpp in Safari"
145+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html &
146+
python browser_tests_safari.py test_xeus_cpp.html
147+
```
148+
139149
To do this on Ubuntu x86 execute the following
140150

141151
```bash

docs/source/InstallationAndUsage.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ To test the lite build you can execute the following to run the C++ tests built
8282
cd test
8383
node test_xeus_cpp.js
8484
85-
It is possible to run the Emscripten tests in a headless browser. We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this on MacOS execute the following
85+
It is possible to run the Emscripten tests in a headless browser. We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this for Chrome and Firefox on MacOS execute the following
8686

8787
.. code-block:: bash
8888
@@ -105,6 +105,16 @@ It is possible to run the Emscripten tests in a headless browser. We will run ou
105105
echo "Running test_xeus_cpp in Google Chrome"
106106
python $BUILD_PREFIX/bin/emrun.py --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
107107
108+
To run tests in Safari you can make use of safaridriver. How to enable this will depend on
109+
your MacOS operating system, and is best to consult `safaridriver <https://developer.apple.com/documentation/webkit/testing-with-webdriver-in-safari>`_. You will also need to install the Selenium
110+
python package. This only needs to be enable once, and then you can execute the following to run the tests in Safari
111+
112+
.. code-block:: bash
113+
114+
echo "Running test_xeus_cpp in Safari"
115+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html &
116+
python browser_tests_safari.py test_xeus_cpp.html
117+
108118
To do this on Ubuntu x86 execute the following
109119

110120
.. code-block:: bash

0 commit comments

Comments
 (0)