mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Try re-enable FF test with webRTC team options
This commit is contained in:
@@ -65,10 +65,27 @@ export default defineConfig({
|
|||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
launchOptions: {
|
launchOptions: {
|
||||||
firefoxUserPrefs: {
|
firefoxUserPrefs: {
|
||||||
|
// Use the same set of options used by WebRTC tests in Firefox
|
||||||
|
// see https://webrtc.org/getting-started/testing
|
||||||
|
"media.navigator.permission.disabled": true,
|
||||||
"permissions.default.microphone": 1,
|
"permissions.default.microphone": 1,
|
||||||
"permissions.default.camera": 1,
|
"permissions.default.camera": 1,
|
||||||
// "media.navigator.streams.fake": true,
|
"browser.cache.disk.enable": false,
|
||||||
// "media.navigator.permission.disabled": true,
|
"browser.cache.disk.capacity": 0,
|
||||||
|
"browser.cache.disk.smart_size.enabled": false,
|
||||||
|
"browser.cache.disk.smart_size.first_run": false,
|
||||||
|
"browser.sessionstore.resume_from_crash": false,
|
||||||
|
"browser.startup.page": 0,
|
||||||
|
"media.navigator.streams.fake": true,
|
||||||
|
"media.navigator.permission.disabled": true,
|
||||||
|
"device.storage.enabled": false,
|
||||||
|
"media.gstreamer.enabled": false,
|
||||||
|
"browser.startup.homepage": "about:blank",
|
||||||
|
"browser.startup.firstrunSkipsHomepage": false,
|
||||||
|
"extensions.update.enabled": false,
|
||||||
|
"app.update.enabled": false,
|
||||||
|
"network.http.use-cache": false,
|
||||||
|
"browser.shell.checkDefaultBrowser": false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,202 +11,182 @@ import { widgetTest } from "../fixtures/widget-user.ts";
|
|||||||
|
|
||||||
widgetTest.use({ callType: "dm" });
|
widgetTest.use({ callType: "dm" });
|
||||||
|
|
||||||
widgetTest(
|
widgetTest("Start a new voice call in DM as widget", async ({ asWidget }) => {
|
||||||
"Start a new voice call in DM as widget",
|
test.slow(); // Triples the timeout
|
||||||
async ({ asWidget, browserName }) => {
|
|
||||||
test.skip(
|
const { brooks, whistler } = asWidget;
|
||||||
browserName === "firefox",
|
|
||||||
"The is test is not working on firefox CI environment. No mic/audio device inputs so cam/mic are disabled",
|
await expect(
|
||||||
|
brooks.page.getByRole("button", { name: "Voice call" }),
|
||||||
|
).toBeVisible();
|
||||||
|
await brooks.page.getByRole("button", { name: "Voice call" }).click();
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
brooks.page.getByRole("menuitem", { name: "Element Call" }),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
await brooks.page.getByRole("menuitem", { name: "Element Call" }).click();
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
brooks.page.locator('iframe[title="Element Call"]'),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
const brooksFrame = brooks.page
|
||||||
|
.locator('iframe[title="Element Call"]')
|
||||||
|
.contentFrame();
|
||||||
|
|
||||||
|
// We should show a ringing overlay, let's check for that
|
||||||
|
await expect(
|
||||||
|
brooksFrame.getByText(`Waiting for ${whistler.displayName} to join…`),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
await expect(whistler.page.getByText("Incoming voice call")).toBeVisible();
|
||||||
|
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
whistler.page.locator('iframe[title="Element Call"]'),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
|
const whistlerFrame = whistler.page
|
||||||
|
.locator('iframe[title="Element Call"]')
|
||||||
|
.contentFrame();
|
||||||
|
|
||||||
|
// ASSERT the button states for whistler (the callee)
|
||||||
|
{
|
||||||
|
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
||||||
|
const videoButton = whistlerFrame.getByTestId("incall_videomute");
|
||||||
|
// video should be off by default in a voice call
|
||||||
|
await expect(videoButton).toHaveAttribute("aria-label", /^Start video$/);
|
||||||
|
|
||||||
|
const audioButton = whistlerFrame.getByTestId("incall_mute");
|
||||||
|
// audio should be on for the voice call
|
||||||
|
await expect(audioButton).toHaveAttribute(
|
||||||
|
"aria-label",
|
||||||
|
/^Mute microphone$/,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
test.slow(); // Triples the timeout
|
// ASSERT the button states for brools (the caller)
|
||||||
|
{
|
||||||
|
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
||||||
|
const videoButton = brooksFrame.getByTestId("incall_videomute");
|
||||||
|
// video should be off by default in a voice call
|
||||||
|
await expect(videoButton).toHaveAttribute("aria-label", /^Start video$/);
|
||||||
|
|
||||||
const { brooks, whistler } = asWidget;
|
const audioButton = brooksFrame.getByTestId("incall_mute");
|
||||||
|
// audio should be on for the voice call
|
||||||
await expect(
|
await expect(audioButton).toHaveAttribute(
|
||||||
brooks.page.getByRole("button", { name: "Voice call" }),
|
"aria-label",
|
||||||
).toBeVisible();
|
/^Mute microphone$/,
|
||||||
await brooks.page.getByRole("button", { name: "Voice call" }).click();
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
brooks.page.getByRole("menuitem", { name: "Element Call" }),
|
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
await brooks.page.getByRole("menuitem", { name: "Element Call" }).click();
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
brooks.page.locator('iframe[title="Element Call"]'),
|
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
const brooksFrame = brooks.page
|
|
||||||
.locator('iframe[title="Element Call"]')
|
|
||||||
.contentFrame();
|
|
||||||
|
|
||||||
// We should show a ringing overlay, let's check for that
|
|
||||||
await expect(
|
|
||||||
brooksFrame.getByText(`Waiting for ${whistler.displayName} to join…`),
|
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
await expect(whistler.page.getByText("Incoming voice call")).toBeVisible();
|
|
||||||
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
whistler.page.locator('iframe[title="Element Call"]'),
|
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
const whistlerFrame = whistler.page
|
|
||||||
.locator('iframe[title="Element Call"]')
|
|
||||||
.contentFrame();
|
|
||||||
|
|
||||||
// ASSERT the button states for whistler (the callee)
|
|
||||||
{
|
|
||||||
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
|
||||||
const videoButton = whistlerFrame.getByTestId("incall_videomute");
|
|
||||||
// video should be off by default in a voice call
|
|
||||||
await expect(videoButton).toHaveAttribute("aria-label", /^Start video$/);
|
|
||||||
|
|
||||||
const audioButton = whistlerFrame.getByTestId("incall_mute");
|
|
||||||
// audio should be on for the voice call
|
|
||||||
await expect(audioButton).toHaveAttribute(
|
|
||||||
"aria-label",
|
|
||||||
/^Mute microphone$/,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ASSERT the button states for brools (the caller)
|
|
||||||
{
|
|
||||||
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
|
||||||
const videoButton = brooksFrame.getByTestId("incall_videomute");
|
|
||||||
// video should be off by default in a voice call
|
|
||||||
await expect(videoButton).toHaveAttribute("aria-label", /^Start video$/);
|
|
||||||
|
|
||||||
const audioButton = brooksFrame.getByTestId("incall_mute");
|
|
||||||
// audio should be on for the voice call
|
|
||||||
await expect(audioButton).toHaveAttribute(
|
|
||||||
"aria-label",
|
|
||||||
/^Mute microphone$/,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// In order to confirm that the call is disconnected we will check that the message composer is shown again.
|
|
||||||
// So first we need to confirm that it is hidden when in the call.
|
|
||||||
await expect(
|
|
||||||
whistler.page.locator(".mx_BasicMessageComposer"),
|
|
||||||
).not.toBeVisible();
|
|
||||||
await expect(
|
|
||||||
brooks.page.locator(".mx_BasicMessageComposer"),
|
|
||||||
).not.toBeVisible();
|
|
||||||
|
|
||||||
// ASSERT hanging up on one side ends the call for both
|
|
||||||
{
|
|
||||||
const hangupButton = brooksFrame.getByTestId("incall_leave");
|
|
||||||
await hangupButton.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
// The widget should be closed on both sides and the timeline should be back on screen
|
|
||||||
await expect(
|
|
||||||
whistler.page.locator(".mx_BasicMessageComposer"),
|
|
||||||
).toBeVisible();
|
|
||||||
await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
widgetTest(
|
|
||||||
"Start a new video call in DM as widget",
|
|
||||||
async ({ asWidget, browserName }) => {
|
|
||||||
test.skip(
|
|
||||||
browserName === "firefox",
|
|
||||||
"The is test is not working on firefox CI environment. No mic/audio device inputs so cam/mic are disabled",
|
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
test.slow(); // Triples the timeout
|
// In order to confirm that the call is disconnected we will check that the message composer is shown again.
|
||||||
|
// So first we need to confirm that it is hidden when in the call.
|
||||||
|
await expect(
|
||||||
|
whistler.page.locator(".mx_BasicMessageComposer"),
|
||||||
|
).not.toBeVisible();
|
||||||
|
await expect(
|
||||||
|
brooks.page.locator(".mx_BasicMessageComposer"),
|
||||||
|
).not.toBeVisible();
|
||||||
|
|
||||||
const { brooks, whistler } = asWidget;
|
// ASSERT hanging up on one side ends the call for both
|
||||||
|
{
|
||||||
|
const hangupButton = brooksFrame.getByTestId("incall_leave");
|
||||||
|
await hangupButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
await expect(
|
// The widget should be closed on both sides and the timeline should be back on screen
|
||||||
brooks.page.getByRole("button", { name: "Video call" }),
|
await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
||||||
).toBeVisible();
|
await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
||||||
await brooks.page.getByRole("button", { name: "Video call" }).click();
|
});
|
||||||
|
|
||||||
await expect(
|
widgetTest("Start a new video call in DM as widget", async ({ asWidget }) => {
|
||||||
brooks.page.getByRole("menuitem", { name: "Element Call" }),
|
test.slow(); // Triples the timeout
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
await brooks.page.getByRole("menuitem", { name: "Element Call" }).click();
|
const { brooks, whistler } = asWidget;
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
brooks.page.locator('iframe[title="Element Call"]'),
|
brooks.page.getByRole("button", { name: "Video call" }),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
await brooks.page.getByRole("button", { name: "Video call" }).click();
|
||||||
|
|
||||||
const brooksFrame = brooks.page
|
await expect(
|
||||||
.locator('iframe[title="Element Call"]')
|
brooks.page.getByRole("menuitem", { name: "Element Call" }),
|
||||||
.contentFrame();
|
).toBeVisible();
|
||||||
|
|
||||||
// We should show a ringing overlay, let's check for that
|
await brooks.page.getByRole("menuitem", { name: "Element Call" }).click();
|
||||||
await expect(
|
|
||||||
brooksFrame.getByText(`Waiting for ${whistler.displayName} to join…`),
|
|
||||||
).toBeVisible();
|
|
||||||
|
|
||||||
await expect(whistler.page.getByText("Incoming video call")).toBeVisible();
|
await expect(
|
||||||
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
brooks.page.locator('iframe[title="Element Call"]'),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
await expect(
|
const brooksFrame = brooks.page
|
||||||
whistler.page.locator('iframe[title="Element Call"]'),
|
.locator('iframe[title="Element Call"]')
|
||||||
).toBeVisible();
|
.contentFrame();
|
||||||
|
|
||||||
const whistlerFrame = whistler.page
|
// We should show a ringing overlay, let's check for that
|
||||||
.locator('iframe[title="Element Call"]')
|
await expect(
|
||||||
.contentFrame();
|
brooksFrame.getByText(`Waiting for ${whistler.displayName} to join…`),
|
||||||
|
).toBeVisible();
|
||||||
|
|
||||||
// ASSERT the button states for whistler (the callee)
|
await expect(whistler.page.getByText("Incoming video call")).toBeVisible();
|
||||||
{
|
await whistler.page.getByRole("button", { name: "Accept" }).click();
|
||||||
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
|
||||||
const videoButton = whistlerFrame.getByTestId("incall_videomute");
|
|
||||||
// video should be on by default in a voice call
|
|
||||||
await expect(videoButton).toHaveAttribute("aria-label", /^Stop video$/);
|
|
||||||
|
|
||||||
const audioButton = whistlerFrame.getByTestId("incall_mute");
|
await expect(
|
||||||
// audio should be on for the voice call
|
whistler.page.locator('iframe[title="Element Call"]'),
|
||||||
await expect(audioButton).toHaveAttribute(
|
).toBeVisible();
|
||||||
"aria-label",
|
|
||||||
/^Mute microphone$/,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ASSERT the button states for brools (the caller)
|
const whistlerFrame = whistler.page
|
||||||
{
|
.locator('iframe[title="Element Call"]')
|
||||||
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
.contentFrame();
|
||||||
const videoButton = brooksFrame.getByTestId("incall_videomute");
|
|
||||||
// video should be on by default in a voice call
|
|
||||||
await expect(videoButton).toHaveAttribute("aria-label", /^Stop video$/);
|
|
||||||
|
|
||||||
const audioButton = brooksFrame.getByTestId("incall_mute");
|
// ASSERT the button states for whistler (the callee)
|
||||||
// audio should be on for the voice call
|
{
|
||||||
await expect(audioButton).toHaveAttribute(
|
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
||||||
"aria-label",
|
const videoButton = whistlerFrame.getByTestId("incall_videomute");
|
||||||
/^Mute microphone$/,
|
// video should be on by default in a voice call
|
||||||
);
|
await expect(videoButton).toHaveAttribute("aria-label", /^Stop video$/);
|
||||||
}
|
|
||||||
|
|
||||||
// In order to confirm that the call is disconnected we will check that the message composer is shown again.
|
const audioButton = whistlerFrame.getByTestId("incall_mute");
|
||||||
// So first we need to confirm that it is hidden when in the call.
|
// audio should be on for the voice call
|
||||||
await expect(
|
await expect(audioButton).toHaveAttribute(
|
||||||
whistler.page.locator(".mx_BasicMessageComposer"),
|
"aria-label",
|
||||||
).not.toBeVisible();
|
/^Mute microphone$/,
|
||||||
await expect(
|
);
|
||||||
brooks.page.locator(".mx_BasicMessageComposer"),
|
}
|
||||||
).not.toBeVisible();
|
|
||||||
|
|
||||||
// ASSERT hanging up on one side ends the call for both
|
// ASSERT the button states for brools (the caller)
|
||||||
{
|
{
|
||||||
const hangupButton = brooksFrame.getByTestId("incall_leave");
|
// The only way to know if it is muted or not is to look at the data-kind attribute..
|
||||||
await hangupButton.click();
|
const videoButton = brooksFrame.getByTestId("incall_videomute");
|
||||||
}
|
// video should be on by default in a voice call
|
||||||
|
await expect(videoButton).toHaveAttribute("aria-label", /^Stop video$/);
|
||||||
|
|
||||||
// The widget should be closed on both sides and the timeline should be back on screen
|
const audioButton = brooksFrame.getByTestId("incall_mute");
|
||||||
await expect(
|
// audio should be on for the voice call
|
||||||
whistler.page.locator(".mx_BasicMessageComposer"),
|
await expect(audioButton).toHaveAttribute(
|
||||||
).toBeVisible();
|
"aria-label",
|
||||||
await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
/^Mute microphone$/,
|
||||||
},
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
// In order to confirm that the call is disconnected we will check that the message composer is shown again.
|
||||||
|
// So first we need to confirm that it is hidden when in the call.
|
||||||
|
await expect(
|
||||||
|
whistler.page.locator(".mx_BasicMessageComposer"),
|
||||||
|
).not.toBeVisible();
|
||||||
|
await expect(
|
||||||
|
brooks.page.locator(".mx_BasicMessageComposer"),
|
||||||
|
).not.toBeVisible();
|
||||||
|
|
||||||
|
// ASSERT hanging up on one side ends the call for both
|
||||||
|
{
|
||||||
|
const hangupButton = brooksFrame.getByTestId("incall_leave");
|
||||||
|
await hangupButton.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
// The widget should be closed on both sides and the timeline should be back on screen
|
||||||
|
await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
||||||
|
await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user