diff --git a/examples/sites/demos/pc/app/loading/background.spec.ts b/examples/sites/demos/pc/app/loading/background.spec.ts index 0d1c3a285..5c0637013 100644 --- a/examples/sites/demos/pc/app/loading/background.spec.ts +++ b/examples/sites/demos/pc/app/loading/background.spec.ts @@ -4,5 +4,5 @@ test('自定义遮罩背景色', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('loading#background') const loadingBg = page.locator('.tiny-loading__mask') - await expect(loadingBg).toHaveCSS('background-color', 'rgba(0, 0, 0, 0.3)') + await expect(loadingBg).toHaveCSS('background-color', 'rgba(0, 0, 0, 0.2)') }) diff --git a/examples/sites/demos/pc/app/loading/custom-class.spec.ts b/examples/sites/demos/pc/app/loading/custom-class.spec.ts index 4510540b3..28f5e0d93 100644 --- a/examples/sites/demos/pc/app/loading/custom-class.spec.ts +++ b/examples/sites/demos/pc/app/loading/custom-class.spec.ts @@ -5,6 +5,6 @@ test('自定义样式', async ({ page }) => { await page.goto('loading#custom-class') const loadingBg = page.locator('.tiny-loading__mask') const loadingText = page.locator('.new-loading') - await expect(loadingBg).toHaveCSS('background-color', 'rgba(0, 0, 0, 0.8)') + await expect(loadingBg).toHaveCSS('background-color', 'rgba(0, 0, 0, 0.7)') await expect(loadingText).toBeVisible() }) diff --git a/examples/sites/demos/pc/app/loading/directive.spec.ts b/examples/sites/demos/pc/app/loading/directive.spec.ts index ec25f1fe5..c76b4aadf 100644 --- a/examples/sites/demos/pc/app/loading/directive.spec.ts +++ b/examples/sites/demos/pc/app/loading/directive.spec.ts @@ -2,7 +2,12 @@ import { test, expect } from '@playwright/test' test('修饰符', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) - await page.goto('loading#body') - const loadingText = page.locator('.tiny-loading__text') - await expect(loadingText).toHaveText('同 v——loading 指令中的 body 修饰符') + await page.goto('loading#directive') + + await expect(page.getByText('v-loadingText')).not.toBeVisible() + await page.getByRole('button', { name: 'change loading' }).click() + await expect(page.getByText('v-loadingText')).toBeVisible() + + await page.getByRole('button', { name: 'change loading' }).click() + await expect(page.getByText('v-loadingText')).not.toBeVisible() }) diff --git a/examples/sites/demos/pc/app/loading/fullscreen.spec.ts b/examples/sites/demos/pc/app/loading/fullscreen.spec.ts index 72f5e805a..319ae0dbb 100644 --- a/examples/sites/demos/pc/app/loading/fullscreen.spec.ts +++ b/examples/sites/demos/pc/app/loading/fullscreen.spec.ts @@ -3,7 +3,6 @@ import { test, expect } from '@playwright/test' test('全局加载', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('loading#fullscreen') - const loadingText = page.locator('.tiny-loading__text') await page.getByRole('button', { name: '指令方式加载全屏Loading' }).click() const vLoading = page.locator('.circular') await expect(vLoading).toBeVisible() diff --git a/examples/sites/demos/pc/app/loading/loading-tip-text.spec.ts b/examples/sites/demos/pc/app/loading/loading-tip-text.spec.ts index 1c3df484e..9aa1124bc 100644 --- a/examples/sites/demos/pc/app/loading/loading-tip-text.spec.ts +++ b/examples/sites/demos/pc/app/loading/loading-tip-text.spec.ts @@ -4,5 +4,5 @@ test('自定义加载提示文本', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('loading#loading-tip-text') const loadingText = page.locator('.tiny-loading__text') - await expect(loadingText).toBeVisible() + await expect(loadingText).toContainText('加载中') }) diff --git a/examples/sites/demos/pc/app/loading/spinner.spec.ts b/examples/sites/demos/pc/app/loading/spinner.spec.ts index 05e5f9318..7faababd6 100644 --- a/examples/sites/demos/pc/app/loading/spinner.spec.ts +++ b/examples/sites/demos/pc/app/loading/spinner.spec.ts @@ -4,13 +4,8 @@ test('自定义加载图标', async ({ page }) => { page.on('pageerror', (exception) => expect(exception).toBeNull()) await page.goto('loading#spinner') const loadingText = page.locator('.tiny-loading__text') - const sloading = page.locator('.tiny-loading__spinner-small') - const mloading = page.locator('.tiny-loading__spinner-medium') - const lloading = page.locator('.tiny-loading__spinner-large') - const svg = page.locator('.tiny-loading__spinner-large > svg > defs > linearGradient > stop').nth(1) - await expect(loadingText).toHaveText(['自定义loading图标', '自定义loading图标', '自定义loading图标']) - await expect(sloading).toBeVisible() - await expect(mloading).toBeVisible() - await expect(lloading).toBeVisible() - await expect(svg).toHaveAttribute('stop-color', '#191919') + + const svg = page.locator('#tiny-demo-loading-spinner .tiny-icon-loading') + await expect(loadingText).toContainText('自定义loading图标') + await expect(svg).toHaveClass(/tiny-icon-loading/) })