fix(e2e): look at the location map before clicking (#31180)

This commit is contained in:
Florian Duros
2025-11-05 17:49:41 +01:00
committed by GitHub
parent 24aa759544
commit abb93545fe
2 changed files with 28 additions and 19 deletions

View File

@@ -30,33 +30,42 @@ test.describe("Location sharing", { tag: "@no-firefox" }, () => {
}); });
}); });
test("sends and displays pin drop location message successfully", async ({ page, user, app }) => { test(
const roomId = await app.client.createRoom({}); "sends and displays pin drop location message successfully",
await page.goto(`/#/room/${roomId}`); { tag: "@screenshot" },
async ({ page, user, app }) => {
const roomId = await app.client.createRoom({});
await page.goto(`/#/room/${roomId}`);
const composerOptions = await app.openMessageComposerOptions(); const composerOptions = await app.openMessageComposerOptions();
await composerOptions.getByRole("menuitem", { name: "Location", exact: true }).click(); await composerOptions.getByRole("menuitem", { name: "Location", exact: true }).click();
await selectLocationShareTypeOption(page, "Pin").click(); await selectLocationShareTypeOption(page, "Pin").click();
await page.locator("#mx_LocationPicker_map").click(); await page.locator("#mx_LocationPicker_map").click();
await submitShareLocation(page); await submitShareLocation(page);
await page.locator(".mx_RoomView_body .mx_EventTile .mx_MLocationBody").click({ await page.locator(".mx_RoomView_body .mx_EventTile .mx_MLocationBody").click({
position: { position: {
x: 225, x: 225,
y: 150, y: 150,
}, },
}); });
// clicking location tile opens maximised map // Wait for map to load
await expect(page.getByRole("dialog")).toBeVisible(); await expect(page.getByRole("region", { name: "Map" })).toMatchScreenshot(
"location-pin-drop-message-map.png",
);
await app.closeDialog(); // clicking location tile opens maximised map
await expect(page.getByRole("dialog")).toBeVisible();
await expect(page.locator(".mx_Marker")).toBeVisible(); await app.closeDialog();
});
await expect(page.locator(".mx_Marker")).toBeVisible();
},
);
test( test(
"is prompted for and can consent to live location sharing", "is prompted for and can consent to live location sharing",

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB