You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to overwrite the "type" command to make it more robust for our app. The override I'm using seems to work fine on a previous version of Cypress (v8) but now appears to be failing on the most recent version of cypress.
Here is the minimal amount of overwriting code necessary to reproduce the error (note I'm not actually doing any thing besides adding a wait(0) in front of the "type" command:
Cypress.Commands.overwrite("type",(originalFn,element,text,options={})=>{// this code works:// return originalFn(element, text, options);// // this code does not work:cy.wait(0).then(()=>{// run the original type command on the same elementreturnoriginalFn(element,text,options);});});
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
Current behavior
Hi there @bahmutov and others!
I'm trying to overwrite the "type" command to make it more robust for our app. The override I'm using seems to work fine on a previous version of Cypress (v8) but now appears to be failing on the most recent version of cypress.
Here is the minimal amount of overwriting code necessary to reproduce the error (note I'm not actually doing any thing besides adding a wait(0) in front of the "type" command:
Running the following test
Produces this output:
When I hit print to console I see this:
Which brings me to this line of code:
Where it appears
$el.length === 0
is failing since el does not exist.Desired behavior
I would like for my type override to work even after a .then() clause.
Test code to reproduce
https://github.com/tnrich/type-overwrite-bug
Cypress package version: 13.3.2
Cypress binary version: 13.3.2
Electron version: 25.8.4
Bundled Node version: 18.15.0
Cypress Version
13.3.2
Node version
18.15.0
Operating System
macOS 12.6
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: