Search code examples
rspeccapybararspec-rails

Accept a screen share pop up


I'm building a screen sharing app.

How do I accept the browser pop up from navigator.mediaDevices.getDisplayMedia with rspec and capybara?

enter image description here

I've attempted page.driver.browser.switch_to.alert.accept and page.driver.browser.accept_js_confirms


Solution

  • You can’t. It’s not a pop up that’s defined in the webdriver spec so there’s no way currently to interact with it. Instead you may be able to use Chromes WebRTC testing command line arguments to automatically skip the prompt and provide a fake media stream - https://webrtc.org/getting-started/testing