Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Automated tests on Ruby (RSpec or Cucumber)

Quick start guide to integrate Automated tests in BrowserStack Accessibility Testing with Ruby (RSpec or Cucumber).

Prerequisites

  • You have an account with BrowserStack (even a free trial works) and can get the username and access key from Account & Profile.
  • You have a pre-existing RSpec or Cucumber (Ruby) test suite integrated with BrowserStack Automate.
  • Ruby v2.5+ and Bundler are installed on your machine.

Integrate with Automated tests

Follow these steps to get started with adding Automated tests to your test suite:

Use the latest version of browserstack-ruby-sdk to get Automated tests support for your Ruby (RSpec or Cucumber) test suites.

Install the BrowserStack Ruby SDK

Add the BrowserStack Ruby SDK to your Gemfile and install the dependencies.

Open your Gemfile and add the BrowserStack Ruby SDK dependency.

Gemfile
Copy icon Copy

From your project root, run the following command so Ruby picks up the new dependency.

Terminal
Copy icon Copy

Next, hook the BrowserStack Ruby SDK into your RSpec and Cucumber (Ruby) test lifecycles so it can capture and report test execution.

For RSpec, ensure your spec_helper.rb or rails_helper.rb requires the SDK.

spec_helper.rb or rails_helper.rb
Copy icon Copy

For Cucumber (Ruby), require the SDK in features/support/env.rb so it can track scenarios and steps.

features/support/env.rb
Copy icon Copy

Modify your browserstack.yml config file

Automated tests mandatorily need the following configurations in the browserstack.yml file. Especially, ensure to set the accessibility flag as true at the end of the browserstack.yml file.

browserstack.yml
Copy icon Copy
  • Accessibility testing runs on Desktops (Mac & Windows) with Chrome 100 & later on Automate.

Run your test suite with Automated tests

Run your tests with the following commands. The BrowserStack SDK intercepts Selenium WebDriver sessions and routes them to BrowserStack.

To run your RSpec suite with Automated tests enabled, run RSpec as you normally do.

Terminal
Copy icon Copy

To run your Cucumber (Ruby) scenarios, use the BrowserStack SDK wrapper so it can intercept sessions and send results to BrowserStack.

Terminal
Copy icon Copy


You can check the Accessibility report for your build through the Automated tests page.

Visit Automated tests page

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle