-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README for browser testing (#9296)
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
This folder contains files for automated testing of Mapbox GL in real browsers using [Selenium WebDriver](https://www.npmjs.com/package/selenium-webdriver). | ||
|
||
## Prerequisites | ||
|
||
To run Webdriver, you'll have to install the driver for every browser you want to test in. | ||
|
||
- **Google Chrome**: `npm install -g chromedriver` | ||
- **Mozilla Firefox**: `npm install -g geckodriver` | ||
- **Apple Safari**: (`safaridriver` ships with macOS) | ||
- **Microsoft Edge**: See https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ | ||
|
||
## Running | ||
|
||
- Run browser tests with `yarn run test-browser`. | ||
- 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`. | ||
- 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. | ||
- 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. | ||
- 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`. |