fix: resolve remaining TypeScript errors in mobile testing~
This commit is contained in:
@@ -76,7 +76,7 @@ test.describe('移动端兼容性测试 @mobile @compatibility', () => {
|
||||
await expect(page.locator('header')).toBeVisible();
|
||||
await expect(page.locator('main')).toBeVisible();
|
||||
|
||||
const headerHeight = await page.locator('header').evaluate(el => el.offsetHeight);
|
||||
const headerHeight = await page.locator('header').evaluate(el => (el as HTMLElement).offsetHeight);
|
||||
expect(headerHeight).toBeLessThan(100);
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test';
|
||||
import { getMobileDevices } from '../../../utils/devices';
|
||||
import { networkConfigs } from '../../../config/network-configs';
|
||||
import { MobilePerformanceMonitor } from '../../../utils/MobilePerformanceMonitor';
|
||||
import { MobileTestDataGenerator } from '../../../utils/MobileTestDataGenerator';
|
||||
import { generatePerformanceBaseline } from '../../../utils/MobileTestDataGenerator';
|
||||
|
||||
test.describe('移动端性能测试 @mobile @performance', () => {
|
||||
const devices = getMobileDevices().slice(0, 3);
|
||||
@@ -19,7 +19,7 @@ test.describe('移动端性能测试 @mobile @performance', () => {
|
||||
const monitor = new MobilePerformanceMonitor(page);
|
||||
const vitals = await monitor.getCoreWebVitals();
|
||||
|
||||
const baseline = MobileTestDataGenerator.generatePerformanceBaseline(device.name, network);
|
||||
const baseline = generatePerformanceBaseline(device.name, network);
|
||||
|
||||
expect(vitals.LCP).toBeLessThan(baseline.LCP);
|
||||
expect(vitals.FCP).toBeLessThan(baseline.FCP);
|
||||
|
||||
Reference in New Issue
Block a user