-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
FutureDeferred - beyond v1/v2 scope, consider for future versionsDeferred - beyond v1/v2 scope, consider for future versionsbugSomething isn't workingSomething isn't workingtestingv1-legacyV1-specific issue, retained as reference for Phase 3 UI rebuildV1-specific issue, retained as reference for Phase 3 UI rebuild
Description
Problem
The E2E test test_mobile_smoke.spec.ts:50 incorrectly detects Mobile Chrome and Mobile Safari browsers as desktop, causing viewport assertions to fail.
Failing Tests
[Mobile Chrome] › test_mobile_smoke.spec.ts:50:7 › should have correct mobile viewport @smoke[Mobile Safari] › test_mobile_smoke.spec.ts:50:7 › should have correct mobile viewport @smoke
Error
Error: expect(received).toBeGreaterThan(expected)
Expected: > 800
Received: 393 (Mobile Chrome)
Received: 390 (Mobile Safari)
Root Cause
The test logs show:
Running mobile test on: chromium (mobile: false)
ℹ️ Desktop viewport: 1280x720 (not a mobile test)
When running on Mobile Chrome/Safari projects, the test incorrectly:
- Detects
mobile: false - Branches to desktop viewport assertion (
width > 800) - Fails because actual viewport is mobile-sized (~390px)
Location
tests/e2e/test_mobile_smoke.spec.ts:50-64- Possibly
tests/e2e/playwright.config.ts(project configuration)
Expected Behavior
When running on "Mobile Chrome" or "Mobile Safari" projects:
- Test should detect
mobile: true - Assert mobile viewport width (< 500px)
- Pass with actual width of ~390px
Suggested Fix
Check the mobile detection logic in the test or playwright config:
// Current (broken)
const isMobile = page.context().isMobile; // Returns false incorrectly
// Fix option 1: Check project name
const isMobile = test.info().project.name.includes('Mobile');
// Fix option 2: Check viewport directly
const viewport = page.viewportSize();
const isMobile = viewport && viewport.width < 500;Impact
- 2 smoke test failures
- Blocks mobile testing confidence
Related
- [P3] E2E Tests: Fix mobile browser and Firefox compatibility issues #230 - E2E Tests: Fix mobile browser and Firefox compatibility issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FutureDeferred - beyond v1/v2 scope, consider for future versionsDeferred - beyond v1/v2 scope, consider for future versionsbugSomething isn't workingSomething isn't workingtestingv1-legacyV1-specific issue, retained as reference for Phase 3 UI rebuildV1-specific issue, retained as reference for Phase 3 UI rebuild