-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Feature] Add support for better testing WebRTC applications with Webkit #2973
Comments
Any progress on this? Webkit WebRTC testing would be a huge boon for a major project I'm working on. |
I was looking into this too (made a discussion/q&a about it here: https://github.com/microsoft/playwright/discussions/6166). Just to repeat what I found: on a mac target, you can configure the system prefs ( Additionally, attempting to grant I know none of this info is a "solve" but just wanted to share what I'd learned in case it helps someone else. |
I think I found here what I have asked in the 2525 |
did you find anything? we have a large suit of test for our video application --- which is working perfect on chrome with --fake-camera flag. We love to run it on safari, but still struggling. |
@kirbysayshi i confirm that it adding permission: ['camera'], also throw on mac os 10.15.7 with playwright 1.10.0 |
The not-headless webkit version works setting |
I've prepared a patch for adding a "enable-mock-capture-devices" command line option to the wpe executable. The patch: diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp
index ff87f17bd3dc..cf6650a4fda1 100644
--- a/Tools/MiniBrowser/wpe/main.cpp
+++ b/Tools/MiniBrowser/wpe/main.cpp
@@ -42,9 +42,6 @@ static gboolean automationMode;
static gboolean ignoreTLSErrors;
static gboolean inspectorPipe;
static gboolean noStartupWindow;
-// Playwright begin
-static gboolean enableMockCaptureDevices;
-// Playwright end
static const char* userDataDir;
static const char* contentFilter;
static const char* cookiesFile;
@@ -72,9 +69,6 @@ static const GOptionEntry commandLineOptions[] =
{ "inspector-pipe", 'v', 0, G_OPTION_ARG_NONE, &inspectorPipe, "Expose remote debugging protocol over pipe", nullptr },
{ "user-data-dir", 0, 0, G_OPTION_ARG_STRING, &userDataDir, "Default profile persistence folder location", "FILE" },
{ "no-startup-window", 0, 0, G_OPTION_ARG_NONE, &noStartupWindow, "Do not open default page", nullptr },
-// Playwright begin
- { "enable-mock-capture-devices", 0, 0, G_OPTION_ARG_NONE, &enableMockCaptureDevices, "Enable mock capture devices", nullptr },
-// Playwright end
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" },
{ nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr }
};
@@ -395,9 +389,6 @@ int main(int argc, char *argv[])
return static_cast<WPEToolingBackends::HeadlessViewBackend*>(data)->snapshot();
});
}
- if (enableMockCaptureDevices) {
- webkit_settings_set_enable_mock_capture_devices(settings, TRUE);
- }
// Playwright end
auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
"backend", viewBackend,
|
I have recently tried this in webkit headless as well as headed mode . it always shows pop-up message for camera permission (ie. doesn't suppress permission) even with launch option argument provided. Not sure if I am using correct launch options. Here is the snippet of my config and test `import { PlaywrightTestConfig } from "@playwright/test"; const config: PlaywrightTestConfig = {
} test let cam_launcher = "//*[text()='Test my cam']"; test.describe('dummy camera test',async()=>{ note : I created this only to test fake camera. terminal command: npx playwright test dummy.test --headed --project=safari When can we expect this working ? |
Just add But I am not able to run it on Git Actions
I am getting error
|
Its been 2year since the feature request was opened and i can see no progress was made by the Playwright team. |
Upvoting this 👍🏻 would be great to have webrtc testing support in Firefox and Webkit. |
Upvoting this - my team uses Playwright to test our WebRTC application, and it would help to expand test coverage across multiple browsers. |
up! |
Up!! |
up! |
bump |
Up. |
up |
1 similar comment
up |
Up! |
up |
up! |
Having webcam and microphone permissions for webkit would allow us to test video calls on it. |
Getting error:
For webkit browser running in docker container - mcr.microsoft.com/playwright:latest For webkit on macos - works fine. |
are there any recommended workarounds for this? it's pretty mission-critical for our usage of playwright it works fine it chromium, just not webkit or firefox |
Did an experiment today, mocking getUserMedia and it works https://gist.github.com/KernelFolla/2647d7c644dce10913c592b1708f3a1e I guess it's possible to mock browser's API for testing anyway |
Any solution for webkit yet? |
Are there any updates on this, I am trying to implement video call tests for our product however I can not simulate webcams for both chrome and safari. |
+1. Support for audio would be appreciated for speech testing. |
Any updates? this issue is open since nearly 4 years now - would be great to get support! 💯 |
up |
up |
up |
2 similar comments
up |
up |
According to WebRTC testing guide, there is a list of parameters which are recommended to be passed to Chrome or Firefox for testing WebRTC applications. But there is nothing for Safari (Webkit).
Is there a way to make Playwright Webkit engine support flags like Chromium does? That would be nice for testing apps which use WebRTC.
IMHO - same Playwright API across all the browser engines would be great!
UPD: There's an article A Closer Look Into WebRTC. It states that AV capture devices in Webkit can be mocked and camera and microphone policy can be set to allowed state to avoid prompts from getUserMedia.
The text was updated successfully, but these errors were encountered: