2021-03-23 20:15:32 +00:00
|
|
|
The tests present here are used to test the generated HTML from rustdoc. The
|
|
|
|
goal is to prevent unsound/unexpected GUI changes.
|
|
|
|
|
|
|
|
This is using the [browser-ui-test] framework to do so. It works as follows:
|
|
|
|
|
|
|
|
It wraps [puppeteer] to send commands to a web browser in order to navigate and
|
|
|
|
test what's being currently displayed in the web page.
|
|
|
|
|
|
|
|
You can find more information and its documentation in its [repository][browser-ui-test].
|
|
|
|
|
2021-06-14 15:55:25 +00:00
|
|
|
If you need to have more information on the tests run, you can use `--test-args`:
|
|
|
|
|
|
|
|
```bash
|
2023-01-05 08:45:44 +00:00
|
|
|
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --debug
|
2021-06-14 15:55:25 +00:00
|
|
|
```
|
|
|
|
|
2022-06-07 09:49:35 +00:00
|
|
|
If you don't want to run in headless mode (helpful to debug sometimes), you can use
|
|
|
|
`--no-headless`:
|
2021-06-14 15:55:25 +00:00
|
|
|
|
2022-06-07 09:49:35 +00:00
|
|
|
```bash
|
2023-01-05 08:45:44 +00:00
|
|
|
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless
|
2022-06-07 09:49:35 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
To see the supported options, use `--help`.
|
|
|
|
|
|
|
|
Important to be noted: if the chromium instance crashes when you run it, you might need to
|
|
|
|
use `--no-sandbox` to make it work:
|
|
|
|
|
|
|
|
```bash
|
2023-01-05 08:45:44 +00:00
|
|
|
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-sandbox
|
2022-06-07 09:49:35 +00:00
|
|
|
```
|
2021-06-14 15:55:25 +00:00
|
|
|
|
2021-03-23 20:15:32 +00:00
|
|
|
[browser-ui-test]: https://github.com/GuillaumeGomez/browser-UI-test/
|
|
|
|
[puppeteer]: https://pptr.dev/
|