Playwright test for pasting files (#33350)

* Add tests for pasting

* Add tests for pasting files.

* Remove redundant fn

* rm comment
This commit is contained in:
Will Hunt
2026-05-01 11:25:49 +00:00
committed by GitHub
parent 990efa20db
commit 38c3d4f8a3
4 changed files with 89 additions and 0 deletions
@@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details.
import { test, expect } from "../../element-web-test";
import { SettingLevel } from "../../../src/settings/SettingLevel";
import { getSampleFilePath } from "../../sample-files";
const CtrlOrMeta = process.platform === "darwin" ? "Meta" : "Control";
@@ -198,5 +199,16 @@ test.describe("Composer", () => {
// Take a screenshot of the autocomplete
await expect(autocomplete).toMatchScreenshot("emoji-autocomplete.png");
});
test("can paste a file", async ({ page, bot, app }) => {
// Set up a private room so we have another user to mention
await app.client.createRoom({
is_direct: true,
invite: [bot.credentials.userId],
});
await app.viewRoomByName("Bob");
await app.composerDragAndPasteFile("room", getSampleFilePath("riot.png"), "image/png");
await expect(page.locator(".mx_MImageBody")).toBeVisible();
});
});
});