Forrest logo
back to the npx tool

cypress:run:mobile-viewport

Run Cypress Headless With a Mobile Viewport
$ npx cypress run --config viewportWidth=${width},viewportHeight=${height}
try on your machine

This command runs Cypress in headless mode using the specified viewport width and height as configurations. The npx cypress run part of the command runs Cypress in the terminal or command line interface, while the --config flag is used to pass configuration options to Cypress. The viewportWidth and viewportHeight are two of the available configuration options for setting the browser viewport. The ${width} and ${height} are variables that can be substituted with specific values, such as 1280 and 720, respectively, to set the viewport width and height to 1280 pixels and 720 pixels.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the npx tool