-
Notifications
You must be signed in to change notification settings - Fork 181
fix: The handset mode overlay is visible a split second for every call #3606
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0e04fd9
fix: The handset mode overlay is visible a split second for every call
BillCarsonFr 0ed7194
fix: earpiece overlay not showing + playwright test!
BillCarsonFr bcb2b36
keep livekit 1.9.4 as the latest is breaking the dev backend
BillCarsonFr c7491c3
move fixture to correct folder
BillCarsonFr 5d55f83
Merge branch 'livekit' into valere/fix_transiant_earpiece_overlay
BillCarsonFr 940c787
review: quick renaming
BillCarsonFr 7a2c1af
review: use simple transition instead of keyframe
BillCarsonFr 71bf55f
also test that video is muted when earpiece overlay is on
BillCarsonFr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| /* | ||
| Copyright 2025 New Vector Ltd. | ||
|
|
||
| SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial | ||
| Please see LICENSE in the repository root for full details. | ||
| */ | ||
|
|
||
| import { type Browser, type Page, test, expect } from "@playwright/test"; | ||
|
|
||
| export interface MobileCreateFixtures { | ||
| asMobile: { | ||
| creatorPage: Page; | ||
| inviteLink: string; | ||
| }; | ||
| } | ||
|
|
||
| export const mobileTest = test.extend<MobileCreateFixtures>({ | ||
| asMobile: async ({ browser }, pUse) => { | ||
| const fixtures = await createCallAndInvite(browser); | ||
| await pUse({ | ||
| creatorPage: fixtures.page, | ||
| inviteLink: fixtures.inviteLink, | ||
| }); | ||
| }, | ||
| }); | ||
|
|
||
| /** | ||
| * Create a call and generate an invite link | ||
| */ | ||
| async function createCallAndInvite( | ||
| browser: Browser, | ||
| ): Promise<{ page: Page; inviteLink: string }> { | ||
| const creatorContext = await browser.newContext({ reducedMotion: "reduce" }); | ||
| const creatorPage = await creatorContext.newPage(); | ||
|
|
||
| await creatorPage.goto("/"); | ||
|
|
||
| // ======== | ||
| // ARRANGE: The first user creates a call as guest, join it, then click the invite button to copy the invite link | ||
| // ======== | ||
| await creatorPage.getByTestId("home_callName").click(); | ||
| await creatorPage.getByTestId("home_callName").fill("Welcome"); | ||
| await creatorPage.getByTestId("home_displayName").click(); | ||
| await creatorPage.getByTestId("home_displayName").fill("Inviter"); | ||
| await creatorPage.getByTestId("home_go").click(); | ||
| await expect(creatorPage.locator("video")).toBeVisible(); | ||
|
|
||
| await creatorPage | ||
| .getByRole("button", { name: "Continue in browser" }) | ||
| .click(); | ||
| // join | ||
| await creatorPage.getByTestId("lobby_joinCall").click(); | ||
|
|
||
| // Get the invite link | ||
| await creatorPage.getByRole("button", { name: "Invite" }).click(); | ||
| await expect( | ||
| creatorPage.getByRole("heading", { name: "Invite to this call" }), | ||
| ).toBeVisible(); | ||
| await expect(creatorPage.getByRole("img", { name: "QR Code" })).toBeVisible(); | ||
| await expect(creatorPage.getByTestId("modal_inviteLink")).toBeVisible(); | ||
| await expect(creatorPage.getByTestId("modal_inviteLink")).toBeVisible(); | ||
| await creatorPage.getByTestId("modal_inviteLink").click(); | ||
|
|
||
| const inviteLink = (await creatorPage.evaluate( | ||
| "navigator.clipboard.readText()", | ||
| )) as string; | ||
| expect(inviteLink).toContain("room/#/"); | ||
|
|
||
| return { | ||
| page: creatorPage, | ||
| inviteLink, | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| /* | ||
| Copyright 2025 Element Creations Ltd. | ||
|
|
||
| SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial | ||
| Please see LICENSE in the repository root for full details. | ||
| */ | ||
|
|
||
| import { expect, test } from "@playwright/test"; | ||
|
|
||
| import { mobileTest } from "../fixtures/fixture-mobile-create.ts"; | ||
|
|
||
| test("@mobile Start a new call then leave and show the feedback screen", async ({ | ||
| page, | ||
| }) => { | ||
| await page.goto("/"); | ||
|
|
||
| await page.getByTestId("home_callName").click(); | ||
| await page.getByTestId("home_callName").fill("HelloCall"); | ||
| await page.getByTestId("home_displayName").click(); | ||
| await page.getByTestId("home_displayName").fill("John Doe"); | ||
| await page.getByTestId("home_go").click(); | ||
|
|
||
| // await page.pause(); | ||
| await expect(page.locator("video")).toBeVisible(); | ||
| await expect(page.getByTestId("lobby_joinCall")).toBeVisible(); | ||
|
|
||
| await page.getByRole("button", { name: "Continue in browser" }).click(); | ||
| // Join the call | ||
| await page.getByTestId("lobby_joinCall").click(); | ||
|
|
||
| // Ensure that the call is connected | ||
| await page | ||
| .locator("div") | ||
| .filter({ hasText: /^HelloCall$/ }) | ||
| .click(); | ||
| // Check the number of participants | ||
| await expect(page.locator("div").filter({ hasText: /^1$/ })).toBeVisible(); | ||
| // The tooltip with the name should be visible | ||
| await expect(page.getByTestId("name_tag")).toContainText("John Doe"); | ||
|
|
||
| // leave the call | ||
| await page.getByTestId("incall_leave").click(); | ||
| await expect(page.getByRole("heading")).toContainText( | ||
| "John Doe, your call has ended. How did it go?", | ||
| ); | ||
| await expect(page.getByRole("main")).toContainText( | ||
| "Why not finish by setting up a password to keep your account?", | ||
| ); | ||
|
|
||
| await expect( | ||
| page.getByRole("link", { name: "Not now, return to home screen" }), | ||
| ).toBeVisible(); | ||
| }); | ||
|
|
||
| mobileTest( | ||
| "Test earpiece overlay in controlledAudioDevices mode", | ||
| async ({ asMobile, browser }) => { | ||
| test.slow(); // Triples the timeout | ||
| const { creatorPage, inviteLink } = asMobile; | ||
|
|
||
| // ======== | ||
| // ACT: The other user use the invite link to join the call as a guest | ||
| // ======== | ||
| const guestInviteeContext = await browser.newContext({ | ||
| reducedMotion: "reduce", | ||
| }); | ||
| const guestPage = await guestInviteeContext.newPage(); | ||
| await guestPage.goto(inviteLink + "&controlledAudioDevices=true"); | ||
|
|
||
| await guestPage | ||
| .getByRole("button", { name: "Continue in browser" }) | ||
| .click(); | ||
|
|
||
| await guestPage.getByTestId("joincall_displayName").fill("Invitee"); | ||
| await expect(guestPage.getByTestId("joincall_joincall")).toBeVisible(); | ||
| await guestPage.getByTestId("joincall_joincall").click(); | ||
| await guestPage.getByTestId("lobby_joinCall").click(); | ||
|
|
||
| // ======== | ||
| // ASSERT: check that there are two members in the call | ||
| // ======== | ||
|
|
||
| // There should be two participants now | ||
| await expect( | ||
| guestPage.getByTestId("roomHeader_participants_count"), | ||
| ).toContainText("2"); | ||
| expect(await guestPage.getByTestId("videoTile").count()).toBe(2); | ||
|
|
||
| // Same in creator page | ||
| await expect( | ||
| creatorPage.getByTestId("roomHeader_participants_count"), | ||
| ).toContainText("2"); | ||
| expect(await creatorPage.getByTestId("videoTile").count()).toBe(2); | ||
|
|
||
| // TEST: control audio devices from the invitee page | ||
|
|
||
| await guestPage.evaluate(() => { | ||
| window.controls.setAvailableAudioDevices([ | ||
| { id: "speaker", name: "Speaker", isSpeaker: true }, | ||
| { id: "earpiece", name: "Handset", isEarpiece: true }, | ||
| { id: "headphones", name: "Headphones" }, | ||
| ]); | ||
| window.controls.setAudioDevice("earpiece"); | ||
| }); | ||
| await expect( | ||
| guestPage.getByRole("heading", { name: "Handset Mode" }), | ||
| ).toBeVisible(); | ||
| await expect( | ||
| guestPage.getByRole("button", { name: "Back to Speaker Mode" }), | ||
| ).toBeVisible(); | ||
|
|
||
| // Should auto-mute the video when earpiece is selected | ||
| await expect(guestPage.getByTestId("incall_videomute")).toBeDisabled(); | ||
| }, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its nice to see that simplifying the css improved it.