fix: update mobile menu tests to use mobile viewport

This commit is contained in:
张翔 committed 2026-02-27 11:10:00 +08:00
1 parent b787c769ec
commit 0c7a7f5b05
4 files changed
+13 -4

No files matched your search

@@ -44,15 +44,18 @@ test.describe('导航冒烟测试 @smoke', () => {
});
test('应该显示移动端菜单按钮', async ({ homePage }) => {
await homePage.page.setViewportSize({ width: 375, height: 667 });
await expect(homePage.mobileMenuButton).toBeVisible();
});
test('应该能够打开移动端菜单', async ({ homePage }) => {
await homePage.page.setViewportSize({ width: 375, height: 667 });
await homePage.openMobileMenu();
await expect(homePage.mobileMenu).toBeVisible();
});
test('应该能够关闭移动端菜单', async ({ homePage }) => {
await homePage.page.setViewportSize({ width: 375, height: 667 });
await homePage.openMobileMenu();
await homePage.closeMobileMenu();
await expect(homePage.mobileMenu).not.toBeVisible();