Skip to content
Discussion options

You must be logged in to vote

This does work in version 10 and you can extend from the default config:

I put a mobile config file under cypress/configs/cypress.mobile.config.ts

Then reference it in package.json scripts:
"cy:open:mobile": "cypress open --e2e --browser chrome --config-file cypress/configs/cypress.mobile.config.ts",

File cypress.mobile.config.ts contents:

import { defineConfig } from 'cypress';
import defu from 'defu';

import defaultConfig from '../../cypress.config';

export default defineConfig(
  defu(
    {
      viewportWidth: 375,
      viewportHeight: 812,
      userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) Mobile/15E148',
      env: {
        device: 'mobile',
      },
   …

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@Victorgabarullo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@notfounnd
Comment options

@stavares843
Comment options

@notfounnd
Comment options

Answer selected by emilyrohrbough
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants