Emulating Mobile Devices (like Chrome Device Toolbar) #14787
Unanswered
ShiftedDesign
asked this question in
Questions and Help
Replies: 1 comment 5 replies
-
Hey @ShiftedDesign did you try with viewport ? https://docs.cypress.io/api/commands/viewport.html#Examples |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So I've been trying to get Cypress to emulate mobile, specifically trying to get the media query:
@media (hover: none)
to work.We have been using this to detect the difference between a desktop or tablet/mobile device, but I haven't been able to get Cypress to emulate correctly.
I've tried setting the
userAgent
in the config as well asvisitMobile
from: https://gitlab.com/nTopus/cy-mobile-commands#readmeNeither of these produce the results I was looking for, I can obviously just trigger the device emulator from chrome's inspector by hand but it would be nice to have desktop and mobile tests running one after another without user intervention.
Does anyone have any info or possible work out?
Beta Was this translation helpful? Give feedback.
All reactions