2

I'm running a website signup spec with

Capybara.javascript_driver = :webkit

I noticed that when the test completes the signup, the "successful signup" sound (the one that can be heard when signing up from a "normal" browser) starts.

I think this is the normal behaviour, but my questions are:

  • Is there a way to disable sounds in capybara-webkit?
  • Is there a way to mute the browser instance?

Like when we want to not load images and we use config.skip_image_loading

fabdurso
  • 2,366
  • 5
  • 29
  • 55
  • 1
    If you know how the sound is created (e.g. an ` – max pleaner May 25 '17 at 05:33

1 Answers1

1

It seems that capybara-webkit doesn't expose this setting, as Qt (capybara-webkit depends on a WebKit implementation from Qt) doesn't expose it either.

Ref: https://github.com/thoughtbot/capybara-webkit/issues/555

But you probably can achieve it with other approaches like:

  • Execute javascript to remove the audio tags or mute the player:

page.execute_script("your_js_here")

  • Block the audio urls:

config.block_url("example.com/path_to_audio_files/*")

markets
  • 6,709
  • 1
  • 38
  • 48