Skip to content

Cypress.env deprecation / cy.env addition #1620

Open

Description

@MikeMcC399

Current behavior

Desired behavior

  • Follow developments in Cypress and migrate usage of Cypress.env() as appropriate, and at an appropriate time, to avoid demonstrating any deprecated API usage and instead demonstrate handling environment variables according to updated recommendations.

Activity

  1. changed the issue type fromtoon Jan 29, 2026
  2. MikeMcC399 commented on Feb 10, 2026

    @MikeMcC399
    CollaboratorAuthor
  3. MikeMcC399 commented on Feb 10, 2026

    @MikeMcC399
    Author
  4. MikeMcC399 commented on Feb 11, 2026

    @MikeMcC399
    CollaboratorAuthor

    Migrating the examples in this repo to use new API functions that are only available in Cypress >=15.10.0 would mean that the examples would no longer be compatible with earlier Cypress versions. Effectively the use of new API functions from Cypress >= 15.10.0 would be a breaking change in this repo.

    I suggest to delay any related updates here until Cypress 16 is available.

    The new API can be demonstrated in https://github.com/cypress-io/cypress-example-kitchensink, where GitHub Actions examples workflows are also available.

  5. MikeMcC399 commented on Apr 28, 2026

    @MikeMcC399
    CollaboratorAuthor
  6. MikeMcC399 commented on Sep 3, 2026

    @MikeMcC399
    CollaboratorAuthor
    • cypress@16.0.0, released on Sep 1, 2026, removes Cypress.env() and the Migration Guide links to Cypress.env() removed.

    • The recommended replacement is:

    • Cypress.expose() is already demonstrated through examples/expose and .github/workflows/example-expose.yml. This also shows the usage of the action's expose parameter.

    • The Cypress Module API option env corresponding to the action parameter env is now specified for use with secret environment variables.

    • Cypress.env() usage must be removed or replaced to allow upgrade of the repo to Cypress 16.

    • examples/env uses the Cypress.env() however it demonstrates the use of non-sensitive environment variables.

    • cy.env() has very different usage to Cypress.expose(). It is not possible to simply replace Cypress.expose() with cy.env(). That will fail.

  7. MikeMcC399 commented on Sep 3, 2026

    @MikeMcC399
    CollaboratorAuthor

    @jennifer-shehane

    The presence of the current state of the env examples blocks upgrading to Cypress 16:

    There is no simple migration path for these examples, so they either need to be removed or replaced with something which demonstrates cy.env() in a GitHub Actions environment. Possibly also some of the details from the env example needs to be integrated into the expose example.

    This probably needs a decision from the Cypress.io team.

  8. self-assigned this
    on Sep 5, 2026
  9. MikeMcC399 commented on Sep 5, 2026

    @MikeMcC399
    CollaboratorAuthor
  10. MikeMcC399 commented on Sep 9, 2026

    @MikeMcC399
    CollaboratorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions