Crate siderunner

Crate siderunner 

Source
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(&file).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§

Command
File
File represent a Side file information
RunnerError
RunnerError represents a Error which may occure while running running Command.
Test
The structure represent a selenium test

Enums§

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

Functions§

parse
Parse .side format into rust representation

Type Aliases§

Runner
Runner responsible for running a Test and collecting data.