Quickstart - Web
- Follow native quickstart
- Install the cli:
cargo install sweet
- More details on the cli page
- Run
sweet --example my_example
- Optional - update your test to do some web stuff:
web_sys::window().unwrap() .document().unwrap() .body().unwrap() .set_inner_html("<h1>This is a heading</h1>"); expect(window()).get("h1")? .to_contain_text("This is a heading")?;
Here's an example of a runner with a few tests:
Note: the below noisy warning can be stopped by enabling
chrome://flags/#privacy-sandbox-ads-apis
Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'browsing-topics'.