vertigo-testing
Harness for end-to-end browser tests of vertigo apps - a reactive Real-DOM library with SSR for Rust.
- Builds the apps with the vertigo-cli library and serves them with SSR, as
vertigo servedoes, or runs a backend of your own. - Starts the environment once per suite and gives every test its own Chrome session (thirtyfour), downloading a matching chromedriver.
- Helpers that know how a vertigo app behaves - waiting for the app to take over the server-rendered page, for a text, a path or a value, the hydration report.
- Fails a test on browser console errors and, on any failure, saves a screenshot, the page source
and the console log to
target/e2e/<suite>/artifacts. - A libtest-compatible runner: filters,
--list,--test-threads,--ignored.
Usage
Keep the tests in a crate of their own, directly in the root of the workspace (e.g. e2e/).
Each test binary is one suite:
[]
= "0.13"
[[]]
= "app"
= "tests/app.rs"
= false
use Deref;
use ;
type Ctx = Ctx;
async
Settings
| Variable | Effect |
|---|---|
E2E_RELEASE=1 |
Build the apps in release mode |
E2E_WASM_OPT=1 |
Run wasm-opt on the apps, as a shipped build has it |
E2E_SKIP_BUILD=1 |
Use the last build |
E2E_HEADLESS=0 |
Show the browser window |
E2E_CHROMEDRIVER=<path> |
Use this chromedriver instead of downloading one |
E2E_WEBDRIVER=<url> |
Use a running WebDriver (e.g. http://localhost:9515) |
See the vertigo repository for more information.