Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automated testing of webrtc application?

I am developing a conferencing app, details:

  • target: chrome browser

  • server: node.js ( currently windows env)

simplest test scenario would be:

  1. open two browser tabs( open browser if need be)
  2. emulate button click on both.
  3. emulate accept getUserMedia request( hardest part)
  4. more emulation stuff and reading JavaScript variable values and verifying them.

Till now, I have been doing manual testing for all of this, but decided that it would be impractical for the long run. I have not done much automated testing( just a bit of unit testing). Initially, i thought mocha would do the job, but beginning to think it is not enough.

I need some pointers as to what are tools or alternate test frameworks needed to achieve browser starting, tab opening and giving media sharing permissions.

like image 945
mido Avatar asked Oct 30 '25 05:10

mido


2 Answers

Chrome has command line flags for skipping get getUserMedia permission as well as using fake devices:

  • --use-fake-ui-for-media-stream (skips GUM permission prompt)
  • --use-fake-device-for-media-stream (uses a fake device)

Check http://blog.andyet.com/2014/09/29/testing-webrtc-applications, http://googletesting.blogspot.se/2014/08/chrome-firefox-webrtc-interop-test-pt-1.html for background information

If you want to click buttons, the standard tool for this is selenium. If you prefer Javascript to Java, a binding such as webdriver.io might be what you're looking for.

like image 146
Philipp Hancke Avatar answered Nov 01 '25 19:11

Philipp Hancke


If you like Ruby, take a look at Capybara. You'll probably also want to use Xvfb so that you can run the tests on a machine that doesn't have a display.

Here is an example snippet that will let you open Chome with the switches that Philipp suggests. I've used this to create a headless video recording test.

Capybara.register_driver :chrome do |app|
  switches = %w(disable-popup-blocking disable-translate use-fake-ui-for-media-stream use-fake-device-for-media-stream test-type)
  Capybara::Selenium::Driver.new(app, browser: :chrome, switches: switches)
end
like image 40
Jay Prall Avatar answered Nov 01 '25 18:11

Jay Prall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!