Headless browser testing infrastructure (#371)

* tests: Add newlines between impl methods for Project

* WIP headless browser testing with geckodriver and selenium

* Get some more of headless testing working

* Extract `console.log` invocations and print them from the console
* Ship the error message from an exception from the browser back to the command
  line
* Cleanup some "if headless" and `else` branches
* Fix killing `webpack-dev-server` in the background with `--watch-stdin`

* Fix path appending logic for Windows

* Always log logs/errors in headless mode

* Install Firefox on Travis

* Don't duplicate full test suite with `yarn`

No need to run that many tests, we should be able to get by with a smoke test
that it just works.

* headless tests: Move `run-headless.js` to its own file and `include_str!` it

* Run `rustfmt` on `tests/all/main.rs`

* guide: Add note about headless browser tests and configuration

* test: Log WASM_BINDGEN_FIREFOX_BIN_PATH in run-headless.js

* TEMP only run add_headless test in CI

* Add more logging to headless testing

* Allow headless tests to run for 60 seconds before timeout

* TEMP add logging to add_headless test

* Fix headless browser tests

* Another attempt to fix Travis

* More attempts at debugging

* Fix more merge conflicts

* Touch up an error message

* Fixup travis again

* Enable all travis tests again

* Test everything on AppVeyor
This commit is contained in:
Nick Fitzgerald
2018-07-05 07:22:01 -07:00
committed by Alex Crichton
parent 9431037265
commit 59b3b4dc8d
9 changed files with 404 additions and 8335 deletions

View File

@ -42,3 +42,16 @@ Finally, you can run the tests with `cargo`:
```shell
cargo test
```
### Headless Browser Tests
Some tests are configured to run in a headless Firefox instance. To run these
tests, you must have Firefox installed. If you have Firefox installed in a
non-default, custom location you can set the `WASM_BINDGEN_FIREFOX_BIN_PATH`
environment variable to the path to your `firefox-bin`.
For example:
```shell
WASM_BINDGEN_FIREFOX_BIN_PATH=/home/fitzgen/firefox/firefox-bin cargo test
```