From e22c5dfb78c087b3b2434af239e4be4cb0f6910c Mon Sep 17 00:00:00 2001 From: chenhang Date: Fri, 3 Jul 2026 14:43:45 +0800 Subject: [PATCH] test(e2e): stabilize fixture imports --- .../mock/{ => auth}/email-login-from-other-options.spec.ts | 4 ++-- e2e/specs/mock/{ => auth}/logout-from-sidebar.spec.ts | 4 ++-- e2e/specs/mock/{ => chat}/chat-quantity-limit.spec.ts | 4 ++-- .../mock/{ => chat}/chat-send-token-refresh-retry.spec.ts | 4 ++-- e2e/specs/mock/paid-image.spec.ts | 6 +++--- .../image-unlock-insufficient-credits.spec.ts | 6 +++--- .../voice-unlock-insufficient-credits.spec.ts | 6 +++--- e2e/specs/real/email-login-from-other-options.spec.ts | 2 +- tsconfig.json | 3 ++- 9 files changed, 20 insertions(+), 19 deletions(-) rename e2e/specs/mock/{ => auth}/email-login-from-other-options.spec.ts (90%) rename e2e/specs/mock/{ => auth}/logout-from-sidebar.spec.ts (91%) rename e2e/specs/mock/{ => chat}/chat-quantity-limit.spec.ts (97%) rename e2e/specs/mock/{ => chat}/chat-send-token-refresh-retry.spec.ts (95%) rename e2e/specs/mock/{ => unlock-message}/image-unlock-insufficient-credits.spec.ts (91%) rename e2e/specs/mock/{ => unlock-message}/voice-unlock-insufficient-credits.spec.ts (89%) diff --git a/e2e/specs/mock/email-login-from-other-options.spec.ts b/e2e/specs/mock/auth/email-login-from-other-options.spec.ts similarity index 90% rename from e2e/specs/mock/email-login-from-other-options.spec.ts rename to e2e/specs/mock/auth/email-login-from-other-options.spec.ts index d93741e6..757cf229 100644 --- a/e2e/specs/mock/email-login-from-other-options.spec.ts +++ b/e2e/specs/mock/auth/email-login-from-other-options.spec.ts @@ -1,12 +1,12 @@ import { expect, test } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; import { clearBrowserState, enterChatFromSplash, submitEmailLogin, switchToEmailSignIn, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; test.beforeEach(async ({ baseURL, context, page }) => { await clearBrowserState(context, page, baseURL); diff --git a/e2e/specs/mock/logout-from-sidebar.spec.ts b/e2e/specs/mock/auth/logout-from-sidebar.spec.ts similarity index 91% rename from e2e/specs/mock/logout-from-sidebar.spec.ts rename to e2e/specs/mock/auth/logout-from-sidebar.spec.ts index 09c31503..0d213034 100644 --- a/e2e/specs/mock/logout-from-sidebar.spec.ts +++ b/e2e/specs/mock/auth/logout-from-sidebar.spec.ts @@ -1,10 +1,10 @@ import { expect, test } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; import { clearBrowserState, signInWithEmailAndOpenChat, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; test.beforeEach(async ({ baseURL, context, page }) => { await clearBrowserState(context, page, baseURL); diff --git a/e2e/specs/mock/chat-quantity-limit.spec.ts b/e2e/specs/mock/chat/chat-quantity-limit.spec.ts similarity index 97% rename from e2e/specs/mock/chat-quantity-limit.spec.ts rename to e2e/specs/mock/chat/chat-quantity-limit.spec.ts index bae1c610..4bf5e10f 100644 --- a/e2e/specs/mock/chat-quantity-limit.spec.ts +++ b/e2e/specs/mock/chat/chat-quantity-limit.spec.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; import { clearBrowserState, completeVipPayment, @@ -10,7 +10,7 @@ import { expectVipChatSubscriptionUrl, submitEmailLogin, switchToEmailSignIn, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; const mockedLimitTriggerAt = 5; const maxManualTestMessages = 51; diff --git a/e2e/specs/mock/chat-send-token-refresh-retry.spec.ts b/e2e/specs/mock/chat/chat-send-token-refresh-retry.spec.ts similarity index 95% rename from e2e/specs/mock/chat-send-token-refresh-retry.spec.ts rename to e2e/specs/mock/chat/chat-send-token-refresh-retry.spec.ts index 71053355..f16281ce 100644 --- a/e2e/specs/mock/chat-send-token-refresh-retry.spec.ts +++ b/e2e/specs/mock/chat/chat-send-token-refresh-retry.spec.ts @@ -1,10 +1,10 @@ import { expect, test, type Request } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; import { clearBrowserState, signInWithEmailAndOpenChat, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; test.beforeEach(async ({ baseURL, context, page }) => { await clearBrowserState(context, page, baseURL); diff --git a/e2e/specs/mock/paid-image.spec.ts b/e2e/specs/mock/paid-image.spec.ts index 69a60a2e..12f7ca7b 100644 --- a/e2e/specs/mock/paid-image.spec.ts +++ b/e2e/specs/mock/paid-image.spec.ts @@ -1,7 +1,7 @@ import { expect, test } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; -import { paidImageMessageId } from "../../fixtures/test-data"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; +import { paidImageMessageId } from "@e2e/fixtures/test-data"; import { clearBrowserState, completeVipPayment, @@ -11,7 +11,7 @@ import { expectVipChatSubscriptionUrl, submitEmailLogin, switchToEmailSignIn, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; test.beforeEach(async ({ baseURL, context, page }) => { await clearBrowserState(context, page, baseURL); diff --git a/e2e/specs/mock/image-unlock-insufficient-credits.spec.ts b/e2e/specs/mock/unlock-message/image-unlock-insufficient-credits.spec.ts similarity index 91% rename from e2e/specs/mock/image-unlock-insufficient-credits.spec.ts rename to e2e/specs/mock/unlock-message/image-unlock-insufficient-credits.spec.ts index f45a4eb0..82acc264 100644 --- a/e2e/specs/mock/image-unlock-insufficient-credits.spec.ts +++ b/e2e/specs/mock/unlock-message/image-unlock-insufficient-credits.spec.ts @@ -1,14 +1,14 @@ import { expect, test } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; -import { paidImageMessageId } from "../../fixtures/test-data"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; +import { paidImageMessageId } from "@e2e/fixtures/test-data"; import { clearBrowserState, dismissChatInterruptions, expectInsufficientCreditsDialog, expectVipChatSubscriptionUrl, signInWithEmailAndOpenChat, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; test.beforeEach(async ({ baseURL, context, page }) => { await clearBrowserState(context, page, baseURL); diff --git a/e2e/specs/mock/voice-unlock-insufficient-credits.spec.ts b/e2e/specs/mock/unlock-message/voice-unlock-insufficient-credits.spec.ts similarity index 89% rename from e2e/specs/mock/voice-unlock-insufficient-credits.spec.ts rename to e2e/specs/mock/unlock-message/voice-unlock-insufficient-credits.spec.ts index 92c0f7ba..a9f759b9 100644 --- a/e2e/specs/mock/voice-unlock-insufficient-credits.spec.ts +++ b/e2e/specs/mock/unlock-message/voice-unlock-insufficient-credits.spec.ts @@ -1,13 +1,13 @@ import { expect, test } from "@playwright/test"; -import { mockCoreApis } from "../../fixtures/api-mocks"; -import { paidVoiceMessageId } from "../../fixtures/test-data"; +import { mockCoreApis } from "@e2e/fixtures/api-mocks"; +import { paidVoiceMessageId } from "@e2e/fixtures/test-data"; import { clearBrowserState, expectInsufficientCreditsDialog, expectVipChatSubscriptionUrl, signInWithEmailAndOpenChat, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; test.beforeEach(async ({ baseURL, context, page }) => { await clearBrowserState(context, page, baseURL); diff --git a/e2e/specs/real/email-login-from-other-options.spec.ts b/e2e/specs/real/email-login-from-other-options.spec.ts index 0bfda546..3e27fae5 100644 --- a/e2e/specs/real/email-login-from-other-options.spec.ts +++ b/e2e/specs/real/email-login-from-other-options.spec.ts @@ -4,7 +4,7 @@ import { enterChatFromSplash, submitEmailLogin, switchToEmailSignIn, -} from "../../fixtures/test-helpers"; +} from "@e2e/fixtures/test-helpers"; const preReleaseHost = "frontend-test.banlv-ai.com"; const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? ""; diff --git a/tsconfig.json b/tsconfig.json index cf9c65d3..f14f4998 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ } ], "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "@e2e/*": ["./e2e/*"] } }, "include": [