Skip to content

Commit 5bd0229

Browse files
wangle201210claude
andauthored
test(e2e): relocate built-in plugin tests and add @host-tests alias (#7)
## Summary - Moves the framework's built-in source-plugin E2E tests (`content-notice`, `monitor-{loginlog,online,operlog,server}`, `org-center`) into each plugin's own `hack/tests/{e2e,pages,support}` directory, completing the source-plugin E2E ownership standard introduced in #5. - Introduces `@host-tests/*` and `xlsx` path aliases in `hack/tests/tsconfig.json` and wires Playwright via the new top-level `tsconfig` option so plugin-owned tests reference host fixtures/pages/support through stable aliases instead of 6–7 level relative paths. - Updates `hack/tests/config/execution-manifest.json` module scopes, legacy directory map, and `serialIsolation` for the new plugin-owned locations; tightens the `e2e/content` reason text to match what remains under the host tree. - Updates host i18n regressions `TC0108` / `TC0110` to import `NoticePage` / `DeptPage` / `PostPage` from the new plugin locations. - Ticks `FB-3` in `openspec/changes/multi-tenant/tasks.md`. ## Verification - `pnpm exec tsc --noEmit` (from `hack/tests`) - `node hack/tests/scripts/validate-e2e.mjs` — 165 files / 30 scopes - `openspec validate multi-tenant --strict` - `pnpm test` full suite — **471 pass / 12 skipped / 1 pre-existing TC-67k 60s timeout**; all 108 plugin-owned tests resolved the `@host-tests/*` aliases at runtime. ## Test plan - [x] Type check - [x] E2E validator - [x] OpenSpec validator - [x] Full Playwright suite (parallel + serial) - [x] Retry of previously-failing TCs confirms 6/7 were environment / pre-existing flakes 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9d27419 commit 5bd0229

52 files changed

Lines changed: 213 additions & 178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

hack/tests/e2e/content/notice/TC0037-notice-crud.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0037-notice-crud.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { NoticePage } from '../../../pages/NoticePage';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { NoticePage } from '../../pages/NoticePage';
44

55
test.describe('TC0037 通知公告 CRUD', () => {
66
test.beforeEach(async ({ adminPage }) => {

hack/tests/e2e/content/notice/TC0038-notice-search.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0038-notice-search.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { NoticePage } from '../../../pages/NoticePage';
4-
import { waitForDropdown } from '../../../support/ui';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { NoticePage } from '../../pages/NoticePage';
4+
import { waitForDropdown } from '@host-tests/support/ui';
55

66
test.describe('TC0038 通知公告搜索筛选', () => {
77
test.beforeEach(async ({ adminPage }) => {

hack/tests/e2e/content/notice/TC0039-notice-publish.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0039-notice-publish.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { NoticePage } from '../../../pages/NoticePage';
4-
import { config } from '../../../fixtures/config';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { NoticePage } from '../../pages/NoticePage';
4+
import { config } from '@host-tests/fixtures/config';
55

66
const API_BASE = `${config.baseURL}/api/v1`;
77

hack/tests/e2e/content/notice/TC0041-notice-detail.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0041-notice-detail.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { config } from '../../../fixtures/config';
4-
import { LoginPage } from '../../../pages/LoginPage';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { config } from '@host-tests/fixtures/config';
4+
import { LoginPage } from '@host-tests/pages/LoginPage';
55

66
const API_BASE = `${config.baseURL}/api/v1`;
77

hack/tests/e2e/content/notice/TC0043-notice-preview.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0043-notice-preview.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { NoticePage } from '../../../pages/NoticePage';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { NoticePage } from '../../pages/NoticePage';
44

55
test.describe('TC0043 通知公告预览', () => {
66
test.beforeEach(async ({ adminPage }) => {

hack/tests/e2e/content/notice/TC0121-notice-type-options-from-dict.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0121-notice-type-options-from-dict.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { NoticePage } from '../../../pages/NoticePage';
4-
import { waitForDialogReady, waitForDropdown } from '../../../support/ui';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { NoticePage } from '../../pages/NoticePage';
4+
import { waitForDialogReady, waitForDropdown } from '@host-tests/support/ui';
55

66
test.describe('TC0121 通知公告类型选项来源于后端字典', () => {
77
test.beforeEach(async ({ adminPage }) => {

hack/tests/e2e/content/notice/TC0122-message-type-label-localized-by-host.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0122-message-type-label-localized-by-host.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { APIRequestContext } from '@playwright/test';
1+
import type { APIRequestContext } from '@host-tests/support/playwright';
22

3-
import { expect, test } from '../../../fixtures/auth';
4-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3+
import { expect, test } from '@host-tests/fixtures/auth';
4+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
55
import {
66
createAdminApiContext,
77
expectSuccess,
8-
} from '../../../support/api/job';
8+
} from '@host-tests/support/api/job';
99

1010
interface MessageItem {
1111
id: number;

hack/tests/e2e/content/notice/TC0123-notify-category-agnostic.ts renamed to apps/lina-plugins/content-notice/hack/tests/e2e/notice/TC0123-notify-category-agnostic.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { APIRequestContext } from '@playwright/test';
1+
import type { APIRequestContext } from '@host-tests/support/playwright';
22

3-
import { expect, test } from '../../../fixtures/auth';
4-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3+
import { expect, test } from '@host-tests/fixtures/auth';
4+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
55
import {
66
createAdminApiContext,
77
expectSuccess,
8-
} from '../../../support/api/job';
8+
} from '@host-tests/support/api/job';
99

1010
interface MessageItem {
1111
id: number;

hack/tests/pages/NoticePage.ts renamed to apps/lina-plugins/content-notice/hack/tests/pages/NoticePage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { Page } from '@playwright/test';
1+
import type { Page } from '@host-tests/support/playwright';
22

33
import {
44
waitForConfirmOverlay,
55
waitForDialogReady,
66
waitForRouteReady,
77
waitForTableReady,
8-
} from '../support/ui';
8+
} from '@host-tests/support/ui';
99

1010
export class NoticePage {
1111
constructor(private page: Page) {}

hack/tests/e2e/monitor/loginlog/TC0030-loginlog-auto-record.ts renamed to apps/lina-plugins/monitor-loginlog/hack/tests/e2e/TC0030-loginlog-auto-record.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { test, expect } from '../../../fixtures/auth';
2-
import { ensureSourcePluginEnabled } from '../../../fixtures/plugin';
3-
import { LoginPage } from '../../../pages/LoginPage';
4-
import { config } from '../../../fixtures/config';
5-
import { waitForRouteReady } from '../../../support/ui';
1+
import { test, expect } from '@host-tests/fixtures/auth';
2+
import { ensureSourcePluginEnabled } from '@host-tests/fixtures/plugin';
3+
import { LoginPage } from '@host-tests/pages/LoginPage';
4+
import { config } from '@host-tests/fixtures/config';
5+
import { waitForRouteReady } from '@host-tests/support/ui';
66

77
test.describe('TC0030 登录日志自动记录', () => {
88
test.beforeEach(async ({ adminPage }) => {

0 commit comments

Comments
 (0)