Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock user media (camera / microphone) #3532

Closed
nicgirault opened this issue Mar 5, 2019 · 3 comments
Closed

mock user media (camera / microphone) #3532

nicgirault opened this issue Mar 5, 2019 · 3 comments
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot.

Comments

@nicgirault
Copy link

Hello and thanks for this awesome project.

I would like to know what is the status of the reported bug here: https://testcafe-discuss.devexpress.com/t/allow-microphone-access/455

Passing the webrtc testing options on chrome (https://webrtc.org/testing/): testcafe "chrome --use-fake-ui-for-media-stream --use-fake-device-for-media-stream" does not seem to work. Chrome rejects the call to navigator.mediaDevices.getUserMedia({ audio: { sampleSize: 16, channelCount: 1, sampleRate: 16000, }, }) with a NotSupportedError comming from the file hammerhead.js.

Any help would be welcome!

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 5, 2019
@nicgirault
Copy link
Author

Continuing investigating, it seems that the chrome flags are working only on chromium. I still face issue testing a microphone recording but will share here any progress.

@AndreyBelym AndreyBelym self-assigned this Mar 6, 2019
@AndreyBelym
Copy link
Contributor

AndreyBelym commented Mar 6, 2019

Chrome doesn't allow calling the getUserMedia API from insecure origins. Since Chrome considers any HTTP-based websites served from any host except 127.0.0.1 or localhost as insecure, you can:

  1. Specify localhost as the hostname when starting TestCafe:
testcafe --hostname localhost ...
  1. Obtain a valid SSL certificate or register a self-signed certificate as a valid in your operating system and enable HTTPS mode in TestCafe:
testcafe --ssl pfx=/path/to/cert.pfx ...

I've tried the following example and it worked for me with --hostname localhost:

fixture `WebRTC`
    .page`https://webrtc.github.io/samples/src/content/getusermedia/canvas/`;

test(`test`, async t => t.wait(30000));

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 6, 2019
@lock
Copy link

lock bot commented Mar 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot.
Projects
None yet
Development

No branches or pull requests

2 participants