diff --git a/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts b/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts index 2498e0328..74656c1ae 100644 --- a/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/statistic/basic-usage.spec.ts @@ -3,18 +3,6 @@ import { test, expect } from '@playwright/test' test('基本用法', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('statistic#basic-usage') - await page - .locator('div') - .filter({ hasText: /123\/100$/ }) - .first() - .click() - await page - .locator('div') - .filter({ hasText: /^基本用法$/ }) - .first() - .click() - await page - .locator('div') - .filter({ hasText: /^306,526\.23$/ }) - .click() + await page.locator('#basic-usage').getByText('306,526', { exact: true }) + await page.getByText('306,526.23') }) diff --git a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue index 028c004b8..0e22a2788 100644 --- a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue +++ b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot-composition-api.vue @@ -2,15 +2,21 @@
- - - - + - - + + + + + + + + + + +
diff --git a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.spec.ts b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.spec.ts new file mode 100644 index 000000000..1ef74f5e5 --- /dev/null +++ b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.spec.ts @@ -0,0 +1,19 @@ +import { test, expect } from '@playwright/test' + +test('前后缀', async ({ page }) => { + page.on('pageerror', (exception) => expect(exception).toBeNull()) + await page.goto('statistic#prefix-suffix-slot') + await page + .locator('div') + .filter({ hasText: /^已使用容量\(GB\)306GB$/ }) + .first() + await page + .locator('div') + .filter({ hasText: /^¥1,280\.00\/年$/ }) + .first() + await page + .locator('div') + .filter({ hasText: /^300GB$/ }) + .first() + await expect(page.getByText(/^¥1,280\.00\/年$/)).toHaveClass(/tiny-statistic__slots/) +}) diff --git a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue index aaf3f7a9c..fbfe4db28 100644 --- a/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue +++ b/examples/sites/demos/pc/app/statistic/prefix-suffix-slot.vue @@ -2,15 +2,21 @@
- - - - + - - + + + + + + + + + + +
diff --git a/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue b/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue index fd1ec6348..2b3b8054b 100644 --- a/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue +++ b/examples/sites/demos/pc/app/statistic/statistic-slot-composition-api.vue @@ -3,7 +3,10 @@ - + + + + diff --git a/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts b/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts index d6179bc93..b86b41de2 100644 --- a/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts +++ b/examples/sites/demos/pc/app/statistic/statistic-slot.spec.ts @@ -3,11 +3,9 @@ import { test, expect } from '@playwright/test' test('插槽用法', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('statistic#statistic-slot') - await page.locator('div').filter({ hasText: /^10,010,258$/ }) await page .locator('div') - .filter({ hasText: /^306,526\.23$/ }) + .filter({ hasText: /^存储总量已使用容量\(GB\)10,010,258GB$/ }) .first() - await page.getByText('Like:306,526').click() - await page.getByText('600/').click() + await page.getByText('306,526存储平均值').click() }) diff --git a/examples/sites/demos/pc/app/statistic/statistic-slot.vue b/examples/sites/demos/pc/app/statistic/statistic-slot.vue index c0cc4395a..e8d11ab14 100644 --- a/examples/sites/demos/pc/app/statistic/statistic-slot.vue +++ b/examples/sites/demos/pc/app/statistic/statistic-slot.vue @@ -3,7 +3,10 @@ - + + + + diff --git a/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue b/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue index 228a0eeca..9a441ab7c 100644 --- a/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue +++ b/examples/sites/demos/pc/app/statistic/statistic-style-composition-api.vue @@ -2,7 +2,7 @@
- + - +