Ruby Raider

HI AGAIN!

Check out the project and get started on testing!
If you have any questions, feature requests or bugs to report go to our GitHub.

Download Raider Desktop for Your OS

Requires rbenv with Ruby 3.2+ and the ruby_raider gem 4.0.0 or later (gem install ruby_raider).

macOS (Apple Silicon)

Get the .dmg installer for Macs with M1/M2/M3/M4 chips.

Download .dmg (ARM64)

Windows Beta

Download the .exe installer for Windows. Build generated via CI, not yet fully tested.

Download .exe

Linux Beta

Download the .AppImage package for your Linux distro. Build generated via CI, not yet fully tested.

Download for Linux

Documentation

Everything you need to get started with Ruby Raider CLI and Raider Desktop.

Installation

gem install ruby_raider

Create a New Project

Run the interactive project creator:

raider new [PROJECT_NAME]

Or skip the menu with parameters:

raider new my_project -p framework:rspec automation:selenium

Options

raider new my_project -p framework:rspec automation:selenium --accessibility   # Add axe accessibility tests
raider new my_project -p framework:rspec automation:selenium ci:azure          # Azure Pipelines instead of GitHub Actions
raider new my_project -p framework:rspec automation:selenium examples:false    # Empty skeleton, no example tests

Web Testing

Selenium and RSpec, with locators people see on the page, waiting built in, retrying matchers, failure video and trace, network mocking, screenshot comparison and login reuse.

Mobile Testing

Appium and RSpec on iOS, Android or both, with waiting built in, retrying matchers, gestures and failure video.

Add-ons

  • Accessibility testing with axe (web)
  • CI: GitHub Actions, or Azure Pipelines for web projects
  • Reporting with raider_reporter

Every project loads the Raider runtime, which adds these to Selenium itself.

driver.find_element(label: 'Email')
driver.find_element(label: ['Email', { exact: true }])
driver.find_element(by_role('button', name: 'Save'))
expect { account_page.welcome_message }.to have_text('Welcome back')

Locators

label:, placeholder:, alt:, title:, text:, test_id: and by_role(role, name:, exact:), next to Selenium's own keys. find_element is strict: it fails with Raider::AmbiguousMatch when a locator matches more than one element.

Waiting

find_element waits for a match, and click, send_keys, clear and submit wait until the element is ready. force: true skips the checks for one call. No implicit wait, no sleep.

Assertions

Matchers retry until the page matches: have_text, have_value, have_attribute, be_visible, be_hidden, be_enabled, be_disabled, be_checked, have_count, have_title, have_url, have_element, have_css and have_xpath.

Settings

timeout, strict and actionability in config/config.yml. More in Writing tests.

Use raider generate (or raider g) to scaffold test files:

CommandDescription
raider g page [NAME]Create a page object
raider g spec [NAME]Create an RSpec test
raider g helper [NAME]Create a helper class
raider g component [NAME]Create a component class
raider g scaffold [NAME(S)]Create page + spec

Add --path [PATH] to create the file somewhere else.

Use raider utility (or raider u) to configure your project:

CommandDescription
raider u path [PATH]Set default paths for scaffolding
raider u url [URL]Set default project URL
raider u browser [BROWSER]Set default browser
raider u browser_options [OPTS]Set browser arguments (e.g. no-sandbox, headless)
raider u headless [on/off]Toggle headless mode
raider u strict [on/off]Toggle strict find_element (fail on multiple matches)
raider u actionability [on/off]Toggle the actionability wait before element actions
raider u raidRun all tests (-p for parallel)
raider u timeout [SECONDS]Set how long finds, actions and assertions wait
raider u viewport [DIMENSIONS]Set viewport size (e.g. 1920x1080)
raider u platform [PLATFORM]Set platform for cross-platform tests
raider u start_appiumStart Appium server
raider u desktopDownload Raider Desktop
raider u video [ACTION]Failure videos: install (ffmpeg), status, on, off
raider u trace [on/off]Failure traces: turn on or off (Selenium)
CommandDescription
raider versionShow current version
raider help [COMMAND]Describe available commands or one specific command

The full reference is the Ruby Raider README.