skip firefox
This commit is contained in:
@@ -67,8 +67,8 @@ export default defineConfig({
|
|||||||
firefoxUserPrefs: {
|
firefoxUserPrefs: {
|
||||||
"permissions.default.microphone": 1,
|
"permissions.default.microphone": 1,
|
||||||
"permissions.default.camera": 1,
|
"permissions.default.camera": 1,
|
||||||
"media.navigator.streams.fake": true,
|
// "media.navigator.streams.fake": true,
|
||||||
"media.navigator.permission.disabled": true,
|
// "media.navigator.permission.disabled": true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,99 +11,114 @@ import { widgetTest } from "../fixtures/widget-user.ts";
|
|||||||
|
|
||||||
widgetTest.use({ callType: "dm" });
|
widgetTest.use({ callType: "dm" });
|
||||||
|
|
||||||
widgetTest("Start a new voice call in DM as widget", async ({ asWidget }) => {
|
widgetTest(
|
||||||
test.slow(); // Triples the timeout
|
"Start a new voice call in DM as widget",
|
||||||
|
async ({ asWidget, browserName }) => {
|
||||||
const { brooks, whistler } = asWidget;
|
test.skip(
|
||||||
|
browserName === "firefox",
|
||||||
await expect(
|
"The is test is not working on firefox CI environment. No mic/audio device inputs so cam/mic are disabled",
|
||||||
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$/,
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
// ASSERT the button states for brools (the caller)
|
test.slow(); // Triples the timeout
|
||||||
{
|
|
||||||
// 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");
|
const { brooks, whistler } = asWidget;
|
||||||
// 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.
|
await expect(
|
||||||
// So first we need to confirm that it is hidden when in the call.
|
brooks.page.getByRole("button", { name: "Voice call" }),
|
||||||
await expect(
|
).toBeVisible();
|
||||||
whistler.page.locator(".mx_BasicMessageComposer"),
|
await brooks.page.getByRole("button", { name: "Voice call" }).click();
|
||||||
).not.toBeVisible();
|
|
||||||
await expect(
|
|
||||||
brooks.page.locator(".mx_BasicMessageComposer"),
|
|
||||||
).not.toBeVisible();
|
|
||||||
|
|
||||||
// ASSERT hanging up on one side ends the call for both
|
await expect(
|
||||||
{
|
brooks.page.getByRole("menuitem", { name: "Element Call" }),
|
||||||
const hangupButton = brooksFrame.getByTestId("incall_leave");
|
).toBeVisible();
|
||||||
await hangupButton.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
// The widget should be closed on both sides and the timeline should be back on screen
|
await brooks.page.getByRole("menuitem", { name: "Element Call" }).click();
|
||||||
await expect(whistler.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
|
||||||
await expect(brooks.page.locator(".mx_BasicMessageComposer")).toBeVisible();
|
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(
|
widgetTest(
|
||||||
"Start a new video call in DM as widget",
|
"Start a new video call in DM as widget",
|
||||||
async ({ asWidget, browserName }) => {
|
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
|
test.slow(); // Triples the timeout
|
||||||
|
|
||||||
const { brooks, whistler } = asWidget;
|
const { brooks, whistler } = asWidget;
|
||||||
|
|||||||
Reference in New Issue
Block a user