Testing | browsershot-rust | Spatie       

 SPATIE  

browsershot-rust
================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Browsershot-rust](https://spatie.be/docs/browsershot-rust/v1)  Testing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/browsershot-rust/v1) 

  Testing    
- [ Introduction ](https://spatie.be/docs/browsershot-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/browsershot-rust/v1/support-us)
- [ Requirements ](https://spatie.be/docs/browsershot-rust/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/browsershot-rust/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/browsershot-rust/v1/questions-issues)
- [ Testing ](https://spatie.be/docs/browsershot-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/browsershot-rust/v1/changelog)
- [ About us ](https://spatie.be/docs/browsershot-rust/v1/about-us)

Usage
-----

- [ Introduction ](https://spatie.be/docs/browsershot-rust/v1/usage/introduction)
- [ Creating images ](https://spatie.be/docs/browsershot-rust/v1/usage/creating-images)
- [ Creating PDFs ](https://spatie.be/docs/browsershot-rust/v1/usage/creating-pdfs)
- [ Creating HTML ](https://spatie.be/docs/browsershot-rust/v1/usage/creating-html)

Miscellaneous options
---------------------

- [ Adding extra headers to every request ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/adding-extra-headers-to-every-request)
- [ Adding extra headers to the navigational request ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/adding-extra-headers-to-the-navigational-request)
- [ Changing the language of the browser ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/changing-the-language-of-the-browser)
- [ Changing the value of a dropdown ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/changing-the-value-of-a-dropdown)
- [ Clicking on the page ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/clicking-on-the-page)
- [ Connection to a remote chromium/chrome instance ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/connection-to-a-remote-chrome-instance)
- [ Disable sandboxing ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/disable-sandboxing)
- [ Fixing cors issues ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/fixing-cors-options)
- [ Getting console output ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/getting-console-ouput)
- [ Getting failed requests ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/getting-failed-requests)
- [ Ignore HTTPS errors ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/ignore-https-errors)
- [ Passing environment variables to the browser ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/passing-environment-variables-to-the-browser)
- [ Performance ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/performance)
- [ Prevent unsuccessful responses ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/prevent-unsuccessful-responses)
- [ Sending POST requests ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/sending-post-requests)
- [ Setting an arbitrary option ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/setting-an-arbirary-option)
- [ Setting the CSS media type of the page ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/setting-the-css-media-type-of-the-page)
- [ Setting the timeout ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/setting-the-timeout)
- [ Setting the user agent ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/setting-the-user-agent)
- [ Specifying-a-proxy-server ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/specifying-a-proxy-server)
- [ Typing on the page ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/typing-on-the-page)
- [ Using a pipe instead of a WebSocket ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/using-a-pipe-instead-of-a-websocket)
- [ Using cookies ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/using-cookies)
- [ Using HTTP Authentication ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/using-http-authentication)
- [ Using url for html content ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/using-url-for-html-content)
- [ Writing options to a file ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/writing-options-to-a-file)
- [ Disabling redirects ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/disabling-redirects)
- [ Read redirect history ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/read-redirect-history)
- [ Evaluating a script before page load ](https://spatie.be/docs/browsershot-rust/v1/miscellaneous-options/evaluating-a-script-before-page-load)

 Testing
=======

Run these checks from the package directory:

Install Chrome or Chromium first. Set `CHROME_PATH` if the executable is not on your `PATH`. Integration tests launch a real browser and use local HTTP fixtures; there is no dependency on external websites. Set `RUST_TEST_THREADS=2` to limit concurrent browser processes on smaller machines.

```
cargo fmt --all -- --check
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo test --locked --all-targets --all-features
cargo test --locked --doc --all-features
cargo doc --locked --no-deps --all-features
cargo package --locked
```

Set `RUSTDOCFLAGS` to `-D warnings` when running the documentation commands. In POSIX shells, prefix each command with `RUSTDOCFLAGS='-D warnings'`. In PowerShell, first run `$env:RUSTDOCFLAGS = '-D warnings'`.

README.md and all Markdown pages in docs/ participate in rustdoc tests. Setup lines prefixed with `# ` are hidden in rendered rustdoc. Browser examples are compiled with `no_run` so the examples keep their original URLs and output paths without making network requests or writing files during doctests. Integration tests execute browser behavior and assert the output bytes, pixels, page content and diagnostics.

Check the minimum supported Rust version:

```
rustup toolchain install 1.89.0 --profile minimal
cargo +1.89.0 test --locked --all-targets --all-features
cargo +1.89.0 test --locked --doc --all-features
```

Check security advisories:

```
cargo install cargo-audit --locked
cargo audit
```

CI runs stable checks on Linux, macOS and Windows, and the MSRV and audit checks on Linux. An audit requires access to the RustSec advisory database.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
