Skip to content

Commit 2e1ff89

Browse files
committed
test(e2e): fix audio player test
1 parent 7b2c8d6 commit 2e1ff89

19 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/web/playwright/e2e/audio-player/audio-player.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,27 +120,27 @@ test.describe("Audio player", { tag: ["@no-firefox", "@no-webkit"] }, () => {
120120
};
121121

122122
// Take a snapshot of mx_EventTile_last on IRC layout
123-
screenshotOptions.clip = await page.locator(".mx_EventTile_last").boundingBox();
124-
await scrollToBottomOfTimeline(page);
125-
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-irc-layout.png`, screenshotOptions);
123+
let lastTile = page.locator(".mx_EventTile_last");
124+
screenshotOptions.clip = await lastTile.boundingBox();
125+
await expect(lastTile).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-irc-layout.png`, screenshotOptions);
126126

127127
// Take a snapshot on modern/group layout
128128
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Group);
129129
const groupTile = page.locator(".mx_EventTile_last[data-layout='group']");
130130
await groupTile.locator(".mx_MessageTimestamp").click();
131131
await checkPlayerVisibility(groupTile);
132-
screenshotOptions.clip = await page.locator(".mx_EventTile_last").boundingBox();
133-
await scrollToBottomOfTimeline(page);
134-
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-group-layout.png`, screenshotOptions);
132+
lastTile = page.locator(".mx_EventTile_last");
133+
screenshotOptions.clip = await lastTile.boundingBox();
134+
await expect(lastTile).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-group-layout.png`, screenshotOptions);
135135

136136
// Take a snapshot on bubble layout
137137
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Bubble);
138138
const bubbleTile = page.locator(".mx_EventTile_last[data-layout='bubble']");
139139
await bubbleTile.locator(".mx_MessageTimestamp").click();
140140
await checkPlayerVisibility(bubbleTile);
141-
screenshotOptions.clip = await page.locator(".mx_EventTile_last").boundingBox();
142-
await scrollToBottomOfTimeline(page);
143-
await expect(page).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-bubble-layout.png`, screenshotOptions);
141+
lastTile = page.locator(".mx_EventTile_last");
142+
screenshotOptions.clip = await lastTile.boundingBox();
143+
await expect(lastTile).toMatchScreenshot(`${detail.replaceAll(" ", "-")}-bubble-layout.png`, screenshotOptions);
144144
};
145145

146146
test.beforeEach(async ({ page, app, user }) => {
Loading
Loading
26 Bytes
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)