-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: add cy.exec() Cypress 15 misc test compatibility #984
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
feat: add cy.exec() Cypress 15 misc test compatibility #984
Conversation
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
🎉 This PR is included in version 5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@MikeMcC399 These tests began failing after this merge: https://app.circleci.com/pipelines/github/cypress-io/cypress/73417/workflows/ac918eaf-0377-4c50-8222-b46ac217b77a/jobs/3057018 |
|
@jennifer-shehane / @AtofStryker Sorry, I didn't quite anticipate this happening, although I did write that the changes need to be coordinated. In fact CircleCI clones the default branch |
@MikeMcC399 Yah, no worries. I did merge it. 😄 This makes sense. It is strange how we pull this into our tests honestly. |
This has highlighted some gaps in process and documentation in dealing with breaking API changes. It would be good to look at it again when things have settled down to try and make future transitions more robust. In the meantime it would probably just be best to fast-track the |
@MikeMcC399 I'm looking into the |
Situation
PR cypress-io/cypress#32238 plans to update execa in Cypress from [email protected] to [email protected] and for cy.exec() to yield property
exitCode
instead ofcode
.PR #983 currently proposes to convert cypress/e2e/2-advanced-examples/misc.cy.js from using:Edit: closed in favor of this onecode
(Cypress 14 and below) to insteadexitCode
(Cypress 15 - currently unreleased)causing a breaking change, in that the repo will then fail for Cypress 14, and scaffolded tests will also fail if a project is installed with Cypress 15 and then downgraded to Cypress 14 or below.Change
In the test "'cy.exec() - execute a system command'" of cypress/e2e/2-advanced-examples/misc.cy.js, use Cypress.version to provide two different versions of
cy.exec('pwd')
appropriate for Cypress 14 and below, and for Cypress 15 respectively.For publication on https://example.cypress.io/commands/misc update app/commands/misc.html to use Cypress 15 syntax with a comment to use
code
for Cypress 14 and below.Add the npm package [email protected] toEdit: removed because this does not work if Cypress is globally installed by npm.devDependencies
. This is not essential, just good practice. Cypress already includessemver
as a dependency (see https://www.npmjs.com/package/cypress?activeTab=dependencies) and so it is available anyway.Verification
On Ubuntu
24.04.3
LTS, Node.js22.18.0
LTSgit clone https://github.com/cypress-io/cypress-example-kitchensink cd cypress-example-kitchensink npm ci npm run start
In a separate terminal
Confirm that all tests run.
git clone https://github.com/cypress-io/cypress cd cypress git switch breaking/update_execa yarn yarn cypress:run --project ../cypress-example-kitchensink -s ../cypress-example-kitchensink/cypress/e2e/2-advanced-examples/misc.cy.js