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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

get fake camera feed working w arguments: --use-fake-device-for-media-stream and --use-fake-ui-for-media-stream for testing video throughput in Cypress #710

Open
jywarren opened this issue Aug 22, 2021 · 8 comments

Comments

@jywarren
Copy link
Member

Hi @jywarren, I'm not able to get the fake camera feed work 馃槙 by passing in the arguments: --use-fake-device-for-media-stream and --use-fake-ui-for-media-stream in the Selenium Chrome driver. Other than that I've created tests for /upload, /capture and /capture/v2 routes which capture the spectrum and delete it after logging in with a random username using the faker gem.

More on this at -

Originally posted by @waridrox in #702 (comment)

@jywarren
Copy link
Member Author

Just moving here so we can keep working on this issue!

@waridrox
Copy link
Member

waridrox commented Aug 22, 2021

Here's the fake-media-stream that should show up for reference -

687474703a2f2f672e7265636f726469742e636f2f6d4336336a794c6d6a6f2e676966

This is with cypress though...

@jywarren
Copy link
Member Author

For reference linking to publiclab/spectral-workbench.js#245

And, i think the format for using a local test video is:

webrtc/samples#616 (comment)

--use-fake-device-for-media-stream --use-file-for-fake-video-capture="D:\Test\Video\y4m.y4m"

?

@jywarren
Copy link
Member Author

https://docs.cypress.io/api/plugins/browser-launch-api#Use-fake-video-for-webcam-testing

Should this help?

Thanks for this - it's exciting!!!

@waridrox
Copy link
Member

Yes this would do, it's just that currently I don't have that much experience with cypress testing, so I'll circle back here to write some more tests later...

@jywarren
Copy link
Member Author

OK, great. If you could try creating a PR with the cypress test, and even if it doesn't work, just open and point me at where it's going wrong, I can help debug!

Great!!!

@jywarren
Copy link
Member Author

So just btw, is this solved in https://github.com/publiclab/spectral-workbench.js/ (or esp. in publiclab/spectral-workbench.js#245)? and will solving it there solve it here too, or is there a distinct issue with this argument in Rails system tests?

@jywarren
Copy link
Member Author

I believe we were able to resolve #245 without actually faking the camera input - we just checked for a large enough file size in the downloaded image. Later if we add a video or still image of a spectrum, we could refine our tests to look for more, and pursue this!

@jywarren jywarren changed the title not able to get the fake camera feed working w arguments: --use-fake-device-for-media-stream and --use-fake-ui-for-media-stream in the Selenium Chrome driver get fake camera feed working w arguments: --use-fake-device-for-media-stream and --use-fake-ui-for-media-stream for testing video throughput in Cypress Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants