| 123456789101112131415161718192021222324252627282930313233 |
- import { expect, Page, test } from '@playwright/test';
- import path from 'node:path';
- declare global {
- interface Window {
- __seedIpOperatorScenario?: (scenario: 'ready') => unknown;
- }
- }
- const scenarioSeedPath = path.resolve(__dirname, '../scripts/validation/ip-operator-scenario-seed.js');
- async function seedReadyScenario(page: Page) {
- await page.addInitScript({ path: scenarioSeedPath });
- await page.addInitScript(() => {
- window.__seedIpOperatorScenario?.('ready');
- localStorage.setItem('tiktok.currentTab', 'ip-operator');
- });
- }
- test('evidence workspace exposes account works and comments without legacy V1 forms', async ({ page }) => {
- await seedReadyScenario(page);
- await page.goto('/');
- await expect(page.locator('.ip-operator-page')).toBeVisible();
- await page.getByRole('button', { name: '证据 作品与评论' }).click();
- await expect(page.locator('.account-monitor-panel')).toContainText('账号作品与评论样本');
- await expect(page.locator('.account-monitor-work-list article').first()).toBeVisible();
- await expect(page.locator('.account-monitor-work-list')).toContainText('评论');
- await expect(page.getByRole('button', { name: '保存证据' })).toHaveCount(0);
- await expect(page.getByRole('button', { name: '分析痛点' })).toHaveCount(0);
- await expect(page.locator('.legacy-plan-archive')).toHaveCount(0);
- });
|