doco 0.0.0

A framework and runner for end-to-end tests for web applications
Documentation

🦕 Doco

Doco is a test runner and library for writing end-to-tests of web applications. It is designed to be framework-agnostic and easy to use, both locally and in CI/CD pipelines.

Under the hood, Doco uses containers to create ephemeral, isolated environments for each test. This prevents state to leak between tests and ensures that each test is run with a known and predictable environment.

Doco has a very simple, yet powerful API to make it easy to write tests. In a main function, the environment for tests is defined and configured. Most importantly, Doco is told about the server and its dependencies. Then, tests are written just like with any other Rust test. The tests are passed a Client that can be used to interact with a website, making it easy to simulate user interactions and write assertions against the web application.

Example

use doco::{Client, Doco, Result, Server, Service, WaitFor};

#[doco::test]
async fn visit_root_path(client: Client) -> Result<()> {
client.goto("/").await?;

let body = client.source().await?;

assert!(body.contains("Hello World"));

Ok(())
}

#[doco::main]
async fn main() -> Doco {
let server = Server::builder()
.image("crccheck/hello-world")
.tag("v1.0.0")
.port(8000)
.build();

Doco::builder().server(server).build()
}