Skip to content

Commit 548718e

Browse files
baxenTheSentinel454codex
authored
test(desktop): scope video menu e2e probes to emitted messages (#7953)
## Summary Fixes the `Desktop Smoke E2E (4)` failure on `main`. The test at `desktop/tests/e2e/video-attachment.spec.ts` ("right-click menus expose distinct selectors for links, relay video, and off-relay video") fails 3/3 attempts on main and on every PR branch since ~Sept 25. Because "Desktop" is a required check, that blocks merges. **Cause:** the relay-video and off-relay-video probes picked their player with `getByTestId("video-player").last()`. When mock messages share a second, timeline ordering can put a different video last. The locator then resolves to the wrong player, and the "Download video" menu detaches before the click, so the test times out. **Fix:** scope each probe to the `data-message-id` of the message `emitVideoMessage` just returned. Test-only change, 16 lines. ## Attribution This is a cherry-pick of `dfd5db4e0` by @Tornquist, originally part of #7827 (the deletion-drain cron, which is stacked on another feature branch). It's pulled out on its own so main can go green without waiting on that stack. Authorship is preserved. ## Testing - `pnpm build:e2e && playwright test tests/e2e/video-attachment.spec.ts --project=smoke`: 13/13 passed locally, including the target test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: tornquist <[email protected]> Signed-off-by: murderbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz> Co-authored-by: tornquist <[email protected]> Co-authored-by: Codex <[email protected]>
1 parent 15d44dc commit 548718e

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

‎desktop/tests/e2e/video-attachment.spec.ts‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,12 +1513,14 @@ test("right-click menus expose distinct selectors for links, relay video, and of
15131513

15141514
// ── Relay video menu: Download video + Copy link, appearing only once the
15151515
// relay origin resolves (the reactivity fix) ─────────────────────────────
1516-
await emitVideoMessage(page, {
1516+
const relayMessage = (await emitVideoMessage(page, {
15171517
url: MENU_RELAY_VIDEO_URL,
15181518
sha: MENU_RELAY_VIDEO_SHA,
15191519
filename: "relay-clip.mp4",
1520-
});
1521-
const relayPlayer = page.getByTestId("video-player").last();
1520+
})) as { id: string };
1521+
const relayPlayer = page
1522+
.locator(`[data-message-id="${relayMessage.id}"]`)
1523+
.getByTestId("video-player");
15221524
await expect(relayPlayer).toBeVisible();
15231525
// Right-click the player surface. `force` skips the actionability guard: the
15241526
// Play-button overlay sits above the video, but the contextmenu event still
@@ -1559,12 +1561,14 @@ test("right-click menus expose distinct selectors for links, relay video, and of
15591561
await expect(page.locator("[data-video-context-menu]")).toHaveCount(0);
15601562

15611563
// ── Off-relay video control: renders and offers Copy link, never Download ─
1562-
await emitVideoMessage(page, {
1564+
const offRelayMessage = (await emitVideoMessage(page, {
15631565
url: MENU_OFF_RELAY_VIDEO_URL,
15641566
sha: MENU_OFF_RELAY_VIDEO_SHA,
15651567
filename: "external-clip.mp4",
1566-
});
1567-
const offRelayPlayer = page.getByTestId("video-player").last();
1568+
})) as { id: string };
1569+
const offRelayPlayer = page
1570+
.locator(`[data-message-id="${offRelayMessage.id}"]`)
1571+
.getByTestId("video-player");
15681572
await expect(offRelayPlayer).toBeVisible();
15691573
await offRelayPlayer.click({ button: "right", force: true });
15701574

0 commit comments

Comments
 (0)