I am developing a conferencing app, details:
simplest test scenario would be:
- open two browser tabs( open browser if need be)
- emulate button click on both.
- emulate accept getUserMedia request( hardest part)
- 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.
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.
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
If you are looking for webrtc testing, you may like to see loadmultiplier.., it was answered here previously.