mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Fix end-to-end tests
This commit is contained in:
@@ -125,21 +125,10 @@ async function expectVideoTilesCount(page: Page, count: number): Promise<void> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// There should be `count` video elements, visible and autoplaying
|
// There should be `count` video elements, visible and autoplaying
|
||||||
await expect(page.locator("video")).toHaveCount(count);
|
await expect(page.locator("video").filter({ visible: true })).toHaveCount(
|
||||||
|
count,
|
||||||
await expect(async () => {
|
{ timeout: 10000 },
|
||||||
const videoBlockCount = await page
|
);
|
||||||
.locator("video")
|
|
||||||
.evaluateAll(
|
|
||||||
(videos: Element[]) =>
|
|
||||||
videos.filter(
|
|
||||||
(v: Element) => window.getComputedStyle(v).display === "block",
|
|
||||||
).length,
|
|
||||||
);
|
|
||||||
expect(videoBlockCount).toBe(count);
|
|
||||||
}).toPass({
|
|
||||||
timeout: 10000,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SpaHelpers = {
|
export const SpaHelpers = {
|
||||||
|
|||||||
@@ -385,11 +385,9 @@ export class TestHelpers {
|
|||||||
frame: FrameLocator,
|
frame: FrameLocator,
|
||||||
count: number,
|
count: number,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await expect(
|
await expect(frame.locator("video").filter({ visible: true })).toHaveCount(
|
||||||
frame
|
count,
|
||||||
.getByRole("img")
|
{ timeout: 10000 },
|
||||||
.and(frame.locator("video"))
|
);
|
||||||
.filter({ visible: true }),
|
|
||||||
).toHaveCount(count, { timeout: 10000 });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user