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
Problem
The E2E test
test_mobile_smoke.spec.ts:50incorrectly 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 @smokeError
Root Cause
The test logs show:
When running on Mobile Chrome/Safari projects, the test incorrectly:
mobile: falsewidth > 800)Location
tests/e2e/test_mobile_smoke.spec.ts:50-64tests/e2e/playwright.config.ts(project configuration)Expected Behavior
When running on "Mobile Chrome" or "Mobile Safari" projects:
mobile: trueSuggested Fix
Check the mobile detection logic in the test or playwright config:
Impact
Related