Posted almost 5 years ago. Visible to the public.

Capybara: Disable sound during Selenium tests

If the application under test makes sound, you probably want to disable this during integration testing.

You can use the args option to pass parameters to the browser. For Chrome:

Copy
Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome, args: ["--mute-audio"]) end

I haven't found a corresponding command line option for Firefox Archive .

Hat tip to kratob Archive .

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Henning Koch
Last edit:
almost 5 years ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more