diff --git a/examples/tree-shake-antd/e2e.spec.ts b/examples/tree-shake-antd/e2e.spec.ts index 3b788617c..2f5a14882 100644 --- a/examples/tree-shake-antd/e2e.spec.ts +++ b/examples/tree-shake-antd/e2e.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from 'vitest'; +import { test, expect, describe } from 'vitest'; import { startProjectAndTest } from '../../e2e/vitestSetup'; import { basename, dirname } from 'path'; import { fileURLToPath } from 'url'; @@ -6,23 +6,28 @@ import { fileURLToPath } from 'url'; const name = basename(import.meta.url); const projectPath = dirname(fileURLToPath(import.meta.url)); -test(`e2e tests - ${name}`, async () => { +describe(`e2e tests - ${name}`, async () => { const runTest = (command?: 'start' | 'preview') => startProjectAndTest( projectPath, async (page) => { - const button = await page.waitForSelector('.test-antd-button'); - const promise = page.waitForEvent('console', { predicate: (msg) => msg.text() === 'antd button clicked' }); + const button = await page.waitForSelector('.test-antd-button'); + button.click(); await promise; }, command ); - await runTest(); - await runTest('preview'); + test(`exmaples ${name} run start`, async () => { + await runTest(); + }); + + test(`exmaples ${name} run prevew`, async () => { + await runTest('preview'); + }); });