Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow viewport preset in configuration #18829

Open
CypressCecelia opened this issue Nov 9, 2021 · 3 comments
Open

Allow viewport preset in configuration #18829

CypressCecelia opened this issue Nov 9, 2021 · 3 comments
Labels
E2E Issue related to end-to-end testing type: feature New feature that does not currently exist

Comments

@CypressCecelia
Copy link
Contributor

What would you like?

Currently, cy.viewport() allows the option to pass a preset value instead of a separate height/width.

However, in the Cypress configuration file, only viewportHeight and viewportWidth are available.

It would be helpful to allow the option to set a preset viewport globally via configuration.

Why is this needed?

For convenience, primarily. Instead of having to manually look up and set the height and width for specific devices, to be able to set using a preset in configuration (and, by extension, setting via --config at run time) would be easier when testing multiple device viewports.

Other

No response

@jablesyeah
Copy link

Bump on this.
Seems like something that should definitely work, using the presets, even if that means still passing the height and width values separately, but using the preset, e.g.

viewportHeight: 'iPhone-6.height',
viewportWidth: 'iPhone-6.width'

@jjorgenson-globality
Copy link

Bumping this, too - this would be great to have

@francisco-monteiro
Copy link

This would be really useful, indeed.

@nagash77 nagash77 added type: feature New feature that does not currently exist E2E Issue related to end-to-end testing labels May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

5 participants