This repository was archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
Example test not compatible with Cypress 12 #14
Comments
Closed
from isolated test for troubleshooting: context.only('Item', function () {
// New commands used here:
// - cy.clear https://on.cypress.io/api/clear
it.only('should allow me to mark items as complete', function () {
// we are aliasing the return value of
// our custom command 'createTodo'
//
// the return value is the <li> in the <ul.todos-list>
cy.createTodo(TODO_ITEM_ONE).as('firstTodo')
cy.createTodo(TODO_ITEM_TWO).as('secondTodo')
cy.get('@firstTodo')
.find('.toggle')
.check()
cy.get('@firstTodo').should('have.class', 'completed')
cy.get('@secondTodo').should('not.have.class', 'completed')
cy.get('@secondTodo')
.find('.toggle')
.check()
cy.get('@firstTodo').should('have.class', 'completed')
cy.get('@secondTodo').should('have.class', 'completed')
}) The above works without problems on Cypress 11 and fails to work on Cypress 12. |
The Cypress 12.0 Migration Guide includes a section Behavior Changes in Alias Resolution which says: "Cypress always re-queries aliases when they are referenced. This can result in certain tests that used to pass could start to fail." This may be the reason for the failure. |
According to information from @nagash77 the repository has been replaced by |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem description
After upgrading to Cypress 12.5.1 out of 28 tests in total, 20 pass and 8 fail.
(Using Cypress 11.2.0 the tests report 28 pass and 0 fail.)
Steps to reproduce
Edit
package.json
and change"cypress": "^7.0.0"
to"cypress": "^12.0.0"
Execute
In a separate terminal window execute
Take defaults for migration to Cypress 12.
Select E2E Testing
Select Electron
Start E2E Testing in Electron
Select
app.spec.js
to runNote test run results 20 pass, 8 fail.
Repeat the above using
"cypress": "^11.0.0"
instead and note that all 28 tests pass.Expectation
It should be possible to use the test in the latest current major version of Cypress 12.x.
The text was updated successfully, but these errors were encountered: