A library for parsing and running selenium

side files used in a thirtyfour - default

Siderunner

.side files used in a Selenium IDE.

Get started

To run a file you should initially parse it and then you can run a test by its index.

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

let wiki = std::fs::File::open("examples/wiki.side").expect("Can't open a side file");
let file = parse(wiki).expect("parsing can't be done...");

let client = WebDriver::new("http://localhost:4444", DesiredCapabilities::firefox())
    .await
    .expect("can't connect to webdriver");

let mut runner = Runner::new(&client);
runner.run(&file).await.expect("Error occured while running a side file");

assert_eq!(
    runner.get_value("slogan"),
    Some(&json!("The Free Encyclopedia")),
);

runner.close().await.unwrap();

A .side file for the example can be found in example directory.

Backends

siderunner supports 2 backends:

  • thirtyfour - default
  • fantoccini

You can tweak fantoccini backend by providing a feature fantoccini_backend and turn off default features, default-features = false

Supported commands

Selenium IDE supports the following commands.

  • add selection
  • answer on next prompt
  • assert
  • assert alert
  • assert checked
  • assert confirmation
  • assert editable
  • assert element present
  • assert element not present
  • assert not checked
  • assert not editable
  • assert not selected value
  • assert not text
  • assert prompt
  • assert selected value
  • assert selected label
  • assert text
  • assert title
  • assert value
  • check
  • choose cancel on next confirmation
  • choose cancel on next prompt
  • choose ok on next confirmation
  • click
  • click at
  • close
  • debugger
  • do
  • double click
  • double click at
  • drag and drop to object
  • echo
  • edit content
  • else
  • else if
  • end
  • execute script
  • execute async script
  • for each
  • if
  • mouse down
  • mouse down at
  • mouse move at
  • mouse out
  • mouse over
  • mouse up
  • mouse up at
  • open
  • pause
  • remove selection
  • repeat if
  • run
  • run script
  • select
  • select frame
  • select window
  • send keys
  • set speed
  • set window size
  • store
  • store attribute
  • store json
  • store text
  • store title
  • store value
  • store window handle
  • store xpath count
  • submit
  • times
  • type
  • uncheck
  • verify
  • verify checked
  • verify editable
  • verify element present
  • verify element not present
  • verify not checked
  • verify not editable
  • verify not selected value
  • verify not text
  • verify selected label
  • verify selected value
  • verify text
  • verify title
  • verify value
  • wait for element editable
  • wait for element not editable
  • wait for element not present
  • wait for element not visible
  • wait for element present
  • wait for element visible
  • webdriver answer on visible prompt
  • webdriver choose cancel on visible confirmation
  • webdriver choose cancel on visible prompt
  • webdriver choose ok on visible confirmation
  • while

Development

Unit tests

cargo test --lib

Integrational tests

To run a integration test suit you must set an environment. You can use test.bash file to run tests and manage the environment. Just run it.

./test.bash

Requirements

  • docker-compose

Contributing

All contributions are welcomed.

I would recomend to start by tackling some of not implemented commands. And there's one more good place to start is fantoccini backend, as it got a bit outdated as there's a bunch of not implemented commands there compared to default backend.

There might be something to do in the backend repos so you can help them out as well.

Information - Updated Oct 20, 2021

Stars: 3
Forks: 0
Issues: 1

netsim - A Rust library for network simulation and testing (currently linux-only)

netsim is a crate for simulating networks for the sake of testing network-oriented Rust

netsim - A Rust library for network simulation and testing (currently linux-only)

utest standard testing for Rust

Make sure your not using this for testing no_std code as it relies on the unstable branch

utest standard testing for Rust

K9 - Rust Testing Library

Snapshot testing + better assertions

K9 - Rust Testing Library

Spec "it" for Rust testing

The test output is like the following

Spec "it" for Rust testing

Shuttle is a library for testing concurrent Rust code

It is an implementation of a number of

Shuttle is a library for testing concurrent Rust code

A contract testing tool built in Rust using the filmReel format

0 or greater for making gRPC requests

A contract testing tool built in Rust using the filmReel format

Let's make a web service and client in Rust

So I'm working on this project Rust regression testing

Let's make a web service and client in Rust

Simple golden file testing for Rust

Add the following to your Cargo manifest

Simple golden file testing for Rust

cargo-mutants is a mutation testing tool for Rust

Decartes mutation-testing tool for Java

cargo-mutants is a mutation testing tool for Rust
Http

329

HTTP mocking to test Rust applications

wiremock provides HTTP mocking to perform black-box testing of Rust applications that

HTTP mocking to test Rust applications

just testing rust

cli + advanced cli features

just testing rust
Facebook Instagram Twitter GitHub Dribbble
Privacy