diff --git a/packages/element-web-playwright-common/src/fixtures/axe.ts b/packages/element-web-playwright-common/src/fixtures/axe.ts index eeeb523aed..2c0c97af45 100644 --- a/packages/element-web-playwright-common/src/fixtures/axe.ts +++ b/packages/element-web-playwright-common/src/fixtures/axe.ts @@ -6,9 +6,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import { test as base } from "@playwright/test"; import AxeBuilder from "@axe-core/playwright"; +import { test as base } from "./user"; + +// We want to avoid using `mergeTests` because it drops useful type information about the fixtures. Instead, we extend +// the definition of `test` from `user.ts`, so that there is a linear hierarchy. export const test = base.extend<{ /** * AxeBuilder instance for the current page diff --git a/packages/element-web-playwright-common/src/fixtures/index.ts b/packages/element-web-playwright-common/src/fixtures/index.ts index 04c8d120e3..58aebfa20e 100644 --- a/packages/element-web-playwright-common/src/fixtures/index.ts +++ b/packages/element-web-playwright-common/src/fixtures/index.ts @@ -5,11 +5,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import { mergeTests } from "@playwright/test"; - -import { test as axe } from "./axe.js"; -import { test as user } from "./user.js"; - export { type Services, type WorkerOptions } from "./services.js"; -export const test = mergeTests(axe, user); +// We avoid using `mergeTests` because it drops useful type information about the fixtures. +// `axe` is the top of our stack of extensions (it extends `user`, etc), so it's the one we want to use. +export { test } from "./axe";