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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 }) => {
const roomId = await app.client.createRoom({});
await page.goto(`/#/room/${roomId}`);
test(
"sends and displays pin drop location message successfully",
{ tag: "@screenshot" },
async ({ page, user, app }) => {
const roomId = await app.client.createRoom({});
await page.goto(`/#/room/${roomId}`);
const composerOptions = await app.openMessageComposerOptions();
await composerOptions.getByRole("menuitem", { name: "Location", exact: true }).click();
const composerOptions = await app.openMessageComposerOptions();
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({
position: {
x: 225,
y: 150,
},
});
await page.locator(".mx_RoomView_body .mx_EventTile .mx_MLocationBody").click({
position: {
x: 225,
y: 150,
},
});
// clicking location tile opens maximised map
await expect(page.getByRole("dialog")).toBeVisible();
// Wait for map to load
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(
"is prompted for and can consent to live location sharing",

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB