question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`--use-file-for-fake-audio-capture` doesn't work on Chrome

See original GitHub issue

Current behavior:

I use --use-file-for-fake-audio-capture for testing getUserMedia behaviour on Chrome. https://github.com/cypress-io/cypress/issues/4160

But cypress v3.5.0 and v3.6.0, --use-file-for-fake-audio-capture doesn’t work it.

Desired behavior:

--use-file-for-fake-audio-capture works on Chrome.

Steps to reproduce: (app code and test code)

// plugins/index.js
module.exports = (on, config) => {
    on('before:browser:launch', (browser = {}, args) => {
        if (browser.name === 'chrome') {
            args.push('--use-fake-device-for-media-stream')
            args.push('--use-fake-ui-for-media-stream')
            args.push('--use-file-for-fake-audio-capture=cypress/fixtures/sample.wav')
        }
        return args
    })
}

and args output

[ '--test-type',
  '--ignore-certificate-errors',
  '--start-maximized',
  '--silent-debugger-extension-api',
  '--no-default-browser-check',
  '--no-first-run',
  '--noerrdialogs',
  '--enable-fixed-layout',
  '--disable-popup-blocking',
  '--disable-password-generation',
  '--disable-save-password-bubble',
  '--disable-single-click-autofill',
  '--disable-prompt-on-repos',
  '--disable-background-timer-throttling',
  '--disable-renderer-backgrounding',
  '--disable-renderer-throttling',
  '--disable-restore-session-state',
  '--disable-translate',
  '--disable-new-profile-management',
  '--disable-new-avatar-menu',
  '--allow-insecure-localhost',
  '--reduce-security-for-testing',
  '--enable-automation',
  '--disable-device-discovery-notifications',
  '--disable-infobars',
  '--autoplay-policy=no-user-gesture-required',
  '--disable-site-isolation-trials',
  '--metrics-recording-only',
  '--disable-prompt-on-repost',
  '--disable-hang-monitor',
  '--disable-sync',
  '--disable-web-resources',
  '--safebrowsing-disable-auto-update',
  '--safebrowsing-disable-download-protection',
  '--disable-client-side-phishing-detection',
  '--disable-component-update',
  '--disable-default-apps',
  '--use-fake-ui-for-media-stream',
  '--use-fake-device-for-media-stream',
  '--disable-ipc-flooding-protection',
  '--disable-backgrounding-occluded-window',
  '--disable-breakpad',
  '--password-store=basic',
  '--use-mock-keychain',
  '--proxy-server=http://localhost:65342',
  '--proxy-bypass-list=<-loopback>',
  '--remote-debugging-port=65349',
  '--use-file-for-fake-audio-capture=cypress/fixtures/sample.wav' ]

I tried to absolute wav file path, but it doesn’t work too.

Versions

Cypress v3.5.0, 3.6.0 OS : macOS 10.15 Chrome 78.0.3904.87, 79.0.3945.16

following version worked fine Cypress v3.4.1 OS : macOS 10.15 Chrome 78.0.3904.87

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
loszercommented, Mar 2, 2021

according to https://bugs.chromium.org/p/chromium/issues/detail?id=1032604#c37 plugin/index.js add chrome args “–no-sandbox” demo code:

on('before:browser:launch', (browser = {}, launchOptions = { args: [] }) => {
    if (browser.name === 'chrome') {
      // https://bugs.chromium.org/p/chromium/issues/detail?id=1032604#c37
      launchOptions.args.push('--no-sandbox')
      launchOptions.args.push('--allow-file-access-from-files')
      launchOptions.args.push('--use-fake-ui-for-media-stream')
      launchOptions.args.push('--use-fake-device-for-media-stream')
      // mp3 not work
      launchOptions.args.push('--use-file-for-fake-audio-capture=tests/fixtures/hello.wav')
    }
    return launchOptions
  })
3reactions
IhorPryymacommented, Dec 16, 2019

I’m facing the same issue with MAC Chrome. Did you find a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

use-file-for-fake-audio-capture not working, MAC OS - Monorail
The flag --use-file-for-fake-audio-capture to play a fake audio stream is not working with the current chromium/chrome for macOS.
Read more >
selenium - --use-file-for-fake-audio-capture doesn't play on ...
I am trying to recreate this but in C# http://www.testautomationguru.com/selenium-webdriver-google-voice-search-automation-using-arquillian- ...
Read more >
Chrome Fake Audio Testing with WebRTC - Google Groups
I assume you mean it doesn't work. What are you trying to do? The easiest way to test if it works is to...
Read more >
chromium/src - Git at Google
getUserMedia, and the getUserMedia-based tests will play back a file. // through the fake device using using --use-file-for-fake-audio-capture.
Read more >
Fixing Chromium's use-file-for-fake-audio-capture on mac
Fixing Chromium's use-file-for-fake-audio-capture on mac The bug ... not working, MAC OS) was in the fake audio device typically used to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found