Crate siderunner[][src]

Expand description

The library provides interface for parsing and running .side files which are produced in comparable way as Selenium IDE does.

Example

use siderunner::{parse, Runner};
use thirtyfour::{DesiredCapabilities, WebDriver};

#[tokio::main]
async fn main() {
    let wiki = std::fs::File::open("examples/wiki.side").expect("Can't open a side file");
    let file = parse(wiki).expect("Failed parsing a file");

    let client = WebDriver::new("http://localhost:4444", DesiredCapabilities::chrome())
        .await
        .expect("can't connect to webdriver");
    let mut runner = Runner::new(&client);
    runner.run_test(&file, 0).await.expect("Fail in running first test");

    assert_eq!(
        runner.get_data().get("slogan"),
        Some(&serde_json::json!("The Free Encyclopedia")),
    );

    runner.close().await.expect("Error occured while closing webdriver");
}

Structs

File represent a Side file information

RunnerError represents a Error which may occure while running running Command.

The structure represent a selenium test

Enums

ParseError represents errors which may occure while parsing a Side file.

Functions

Parse .side format into rust representation

Type Definitions

Runner responsible for running a Test and collecting data.