Skip to content

Commit 077f957

Browse files
authored
Add README for browser testing (#9296)
1 parent 0f87ef1 commit 077f957

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/browser/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This folder contains files for automated testing of Mapbox GL in real browsers using [Selenium WebDriver](https://www.npmjs.com/package/selenium-webdriver).
2+
3+
## Prerequisites
4+
5+
To run Webdriver, you'll have to install the driver for every browser you want to test in.
6+
7+
- **Google Chrome**: `npm install -g chromedriver`
8+
- **Mozilla Firefox**: `npm install -g geckodriver`
9+
- **Apple Safari**: (`safaridriver` ships with macOS)
10+
- **Microsoft Edge**: See https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
11+
12+
## Running
13+
14+
- Run browser tests with `yarn run test-browser`.
15+
- The tests default to Chrome, but it's possible to use a different browser by setting the `SELENIUM_BROWSER` environment variable, e.g. like this: `SELENIUM_BROWSER=firefox yarn run test-browser`.
16+
- To run on iOS Safari, use `SELENIUM_BROWSER=safari::ios yarn run test-browser`. Make sure that the iOS device is in the same local Wifi network as your computer.
17+
- To run on Android Chrome, use `SELENIUM_BROWSER=chrome::android yarn run test-browser`. Make sure that the Android device is in the same local Wifi network as your computer.
18+
- To run individual tests instead of the entire test suite, you can execute a test file with the TAP runner, e.g. by typing `build/run-tap test/browser/zoom.test.js`.

0 commit comments

Comments
 (0)