Testing and debugging
Test suites
Rust unit and integration
cargo nextest run --release --features render --no-fail-fastcargo nextest run --release --features render -p obscura-cdp
cargo nextest run --release --features render -p obscura-browsercargo nextest run --release --features render runtime_click_submit_prevent_defaultCDP parity tests
#[tokio::test(flavor = "current_thread")]
async fn my_test() {
std::env::set_var("OBSCURA_ALLOW_PRIVATE_NETWORK", "1");
let url = serve_once().await;
let mut ctx = CdpContext::new();
let page_id = ctx.create_page();
let session_id = "session-1";
ctx.sessions.insert(session_id.to_string(), page_id.clone());
cdp(&mut ctx, 1, "Page.navigate", json!({"url": url}), session_id).await;
// assertions
}Logging
Driving the CDP server manually
Common failure modes
Target.createTarget timed out
page.goto() returns null from Puppeteer
Cannot find context with specified id
V8_Fatal: heap->isolate() == Isolate::TryGetCurrent()
Test hangs
Reproducing user bug reports
Rendering regressions
Profiling
Last updated
Was this helpful?

