Reference files in Playwright more reliably (#32935)

Without assuming the cwd
This commit is contained in:
Michael Telatynski
2026-03-26 11:30:54 +00:00
committed by GitHub
parent 5a074e637a
commit cd429874db
14 changed files with 93 additions and 57 deletions
@@ -7,6 +7,7 @@ Please see LICENSE files in the repository root for full details.
*/
import { test, expect } from "../../element-web-test";
import { getSampleFilePath } from "../../sample-files";
const USER_NAME = "Bob";
const USER_NAME_NEW = "Alice";
@@ -85,7 +86,7 @@ test.describe("Account user settings tab", () => {
test("should support adding and removing a profile picture", async ({ uut, page }) => {
const profileSettings = uut.locator(".mx_UserProfileSettings");
// Upload a picture
await profileSettings.getByAltText("Upload").setInputFiles("playwright/sample-files/riot.png");
await profileSettings.getByAltText("Upload").setInputFiles(getSampleFilePath("riot.png"));
// Image should be visible
await expect(profileSettings.locator(".mx_AvatarSetting_avatar img")).toBeVisible();