How do you test both portrait and landscape layouts?

Test portrait and landscape as different width-and-height conditions, not as two screenshots of the same page. Start in each orientation, rotate while the page is open, and preserve the user’s position and task. Landscape phones often expose height problems that width-only breakpoint tests miss.
Check the narrowest portrait width and a short landscape height on physical phones. Menus, cookie banners, sticky actions and full-screen sections can consume most of a horizontal phone. A layout that resembles desktop by width may still need compact spacing because the visible height is limited.
Rotate during forms, video playback, open dialogs and navigation. The keyboard may remain open while dimensions change. Confirm that focused fields stay visible, modals recalculate their maximum height, media keeps its state and the page does not jump to the top.
Use CSS orientation queries only when orientation itself affects the design. Most rules should respond to available size with width, height or aspect-ratio conditions. A targeted query such as @media (orientation: landscape) and (max-height: 32rem) can reduce oversized vertical decoration without changing wider desktop layouts.
Include zoom, larger text and a device with rotation lock enabled. The page must remain usable when orientation cannot change. Test safe-area padding on phones with cutouts and verify fixed controls on both edges, since the protected areas can move when the device rotates.
Automate screenshots for stable portrait and landscape viewports, then keep manual rotation in release testing. Automated dimensions catch visual regressions; physical rotation exposes intermediate resize events, browser toolbar changes and state loss. Record orientation and viewport size with every defect report.