Skip to content

Commit c7f25fe

Browse files
committed
use better test condition for mute buttons
1 parent a20edca commit c7f25fe

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

playwright/widget/pip-call-button-interaction.test.ts

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,22 @@ widgetTest("Footer interaction in PiP", async ({ addUser, browserName }) => {
4747

4848
{
4949
// Check for a bug where the video had the wrong fit in PIP
50-
const hangupButton = iFrame.getByRole("button", { name: "End call" });
51-
const audioMuteButton = iFrame.getByTestId("incall_mute");
52-
const videoMuteButton = iFrame.getByTestId("incall_videomute");
53-
await expect(hangupButton).toBeVisible();
54-
await expect(audioMuteButton).toBeVisible();
55-
await expect(videoMuteButton).toBeVisible();
56-
await expect(audioMuteButton).toHaveCSS(
57-
"background-color",
58-
"rgb(255, 255, 255)",
59-
);
60-
await expect(videoMuteButton).toHaveCSS(
61-
"background-color",
62-
"rgb(255, 255, 255)",
63-
);
64-
await videoMuteButton.click();
65-
await audioMuteButton.click();
50+
const hangupBtn = iFrame.getByRole("button", { name: "End call" });
51+
const audioBtn = iFrame.getByTestId("incall_mute");
52+
const videoBtn = iFrame.getByTestId("incall_videomute");
53+
await expect(hangupBtn).toBeVisible();
54+
await expect(audioBtn).toBeVisible();
55+
await expect(videoBtn).toBeVisible();
56+
await expect(audioBtn).toHaveAttribute("aria-label", /^Mute microphone$/);
57+
await expect(videoBtn).toHaveAttribute("aria-label", /^Stop video$/);
58+
59+
await videoBtn.click();
60+
await audioBtn.click();
61+
6662
// stop hovering on any of the buttons
6763
await iFrame.getByTestId("videoTile").hover();
68-
await valere.page.pause();
69-
70-
await expect(audioMuteButton).toHaveCSS(
71-
"background-color",
72-
"rgb(27, 29, 34)",
73-
);
7464

75-
await expect(videoMuteButton).toHaveCSS(
76-
"background-color",
77-
"rgb(27, 29, 34)",
78-
);
65+
await expect(audioBtn).toHaveAttribute("aria-label", /^Unmute microphone$/);
66+
await expect(videoBtn).toHaveAttribute("aria-label", /^Start video$/);
7967
}
8068
});

0 commit comments

Comments
 (0)