diff --git a/packages/element-web-playwright-common/src/fixtures/axe.ts b/packages/element-web-playwright-common/src/fixtures/axe.ts index b7c03763cc..f438b56d1f 100644 --- a/packages/element-web-playwright-common/src/fixtures/axe.ts +++ b/packages/element-web-playwright-common/src/fixtures/axe.ts @@ -6,12 +6,11 @@ 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.js"; - -// 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. +// This fixture is useful for simple component library tests that won't want any extra services like a homeserver, so we +// explicitly avoid pulling anything more than playwright's base fixtures in. 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 de7bce2f29..04dfb50189 100644 --- a/packages/element-web-playwright-common/src/fixtures/index.ts +++ b/packages/element-web-playwright-common/src/fixtures/index.ts @@ -8,5 +8,5 @@ Please see LICENSE files in the repository root for full details. export { type Services, type WorkerOptions } from "./services.js"; // 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.js"; +// `user` is the top of our stack of extensions (it extends services, axe, etc), so it includes everything. +export { test } from "./user.js"; diff --git a/packages/element-web-playwright-common/src/fixtures/services.ts b/packages/element-web-playwright-common/src/fixtures/services.ts index 2c91bae1a0..d4256c6213 100644 --- a/packages/element-web-playwright-common/src/fixtures/services.ts +++ b/packages/element-web-playwright-common/src/fixtures/services.ts @@ -5,7 +5,6 @@ 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 { type MailpitClient } from "mailpit-api"; import { Network, type StartedNetwork } from "testcontainers"; import { PostgreSqlContainer, type StartedPostgreSqlContainer } from "@testcontainers/postgresql"; @@ -20,6 +19,9 @@ import { type StartedMailpitContainer, } from "../testcontainers/index.js"; import { Logger } from "../utils/logger.js"; +// We want to avoid using `mergeTests` in index.ts because it drops useful type information about the fixtures. Instead, +// we add `axe` into our fixture suite by using its `test` as a base, so that there is a linear hierarchy. +import { test as base } from "./axe.js"; /** * Test-scoped fixtures available in the test