fix: update mobile menu tests to use mobile viewport

This commit is contained in:
张翔
2026-02-27 11:10:00 +08:00
parent b787c769ec
commit 0c7a7f5b05
4 changed files with 13 additions and 4 deletions
@@ -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();