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 having the exact same issue reported back in 2019 with issue #5480 #5480
When running a large test that checks many form fields, cypress errors at different points due to not completing the previous command before running the next command. If I break this test into smaller sections, it seems to work fine and I get no errors, but when running the test over the entire form, each time I get an error in a different spot.
The last time it failed, it was supposed to type an invalid value of "100" before checking to see if there was an error message for that field. Cypress failed stating, "expected [data-cy="alt_chan_outgain_errors_0-1"] to exist in the DOM" however, on inspection, it had NOT typed 100 before proceeding to that next check. On other runs, it got past this check and failed in a similar fashion on another input. I originally had the commands chained together (ex. cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').clear().type('100'); )and separated them to see if that would fix it, and it helped slightly, but I'm still getting errors.
Another instance of it failing while running the test was it didn't clear before typing the new value. The previous value was 10 and should clear and then type 9. This worked as it looped through several inputs just fine, but randomly failed on one. Instead of 10 as the value, it was 910. The value never cleared even though the command "clear()" ran.
Again, if I just run the test on this one section at a time, it passes. It seems that it gets overloaded when running the full form with the .each loops.
Desired behavior
Finish the command fully before checking the next command.
Test code to reproduce
cy.get('[data-cy="device_alternate_gains"] > .nav-item').each(($tab,idx)=>{cy.get('[data-cy="alt_chan'+idx+'"]').click();cy.get('[data-cy="alt_chan_hw_selector'+idx+'"]').should('exist');letgainArr=[1,2,3];gainArr.forEach(gain=>{cy.get('[data-cy="alt_chan_mic_'+idx+'-'+gain+'"]').should('be.visible').check();cy.get('[data-cy="alt_chan_ingain_'+idx+'-'+gain+'"]').invoke('val').then(val=>{letoriginalVal=parseInt(valasunknownasstring,10);letnumToUse=originalVal===10 ? '9' : '10';cy.get('[data-cy="alt_chan_ingain_'+idx+'-'+gain+'"]').clear();cy.get('[data-cy="alt_chan_ingain_'+idx+'-'+gain+'"]').type('-10');cy.get('[data-cy="alt_chan_ingain_errors_'+idx+'-'+gain+'"]').should('exist').should('not.be.empty');cy.get('[data-cy="fdh_save"]').should('exist').should('be.disabled');cy.get('[data-cy="fdh_unsaved_msg"]').should('exist').contains('Form has invalid values');cy.get('[data-cy="alt_chan_ingain_'+idx+'-'+gain+'"]').clear();cy.get('[data-cy="alt_chan_ingain_'+idx+'-'+gain+'"]').type(numToUse);cy.get('[data-cy="alt_chan_ingain_errors_'+idx+'-'+gain+'"]').should('not.exist')});cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').invoke('val').then(val=>{letoriginalVal=parseInt(valasunknownasstring,10);letnumToUse=originalVal===10 ? '9' : '10';cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').clear();cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').type('100');cy.get('[data-cy="alt_chan_outgain_errors_'+idx+'-'+gain+'"]').should('exist').should('not.be.empty');cy.get('[data-cy="fdh_save"]').should('exist').should('be.disabled');cy.get('[data-cy="fdh_unsaved_msg"]').should('exist').contains('Form has invalid values');cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').clear();cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').type(numToUse);cy.get('[data-cy="alt_chan_outgain_errors_'+idx+'-'+gain+'"]').should('not.exist')});});});
Cypress Version
13.9.0
Node version
18.15.0
Operating System
Mac OS 14.3.1
Debug Logs
No response
Other
Using this with Angular 17.2.3
The text was updated successfully, but these errors were encountered:
@mmestas Can you provide an example that we can run to see the issue? It will be impossible to address without this, as the issue is likely dependent on how the form functions.
Current behavior
I'm having the exact same issue reported back in 2019 with issue #5480
#5480
When running a large test that checks many form fields, cypress errors at different points due to not completing the previous command before running the next command. If I break this test into smaller sections, it seems to work fine and I get no errors, but when running the test over the entire form, each time I get an error in a different spot.
The last time it failed, it was supposed to type an invalid value of "100" before checking to see if there was an error message for that field. Cypress failed stating, "expected [data-cy="alt_chan_outgain_errors_0-1"] to exist in the DOM" however, on inspection, it had NOT typed 100 before proceeding to that next check. On other runs, it got past this check and failed in a similar fashion on another input. I originally had the commands chained together (ex. cy.get('[data-cy="alt_chan_outgain_'+idx+'-'+gain+'"]').clear().type('100'); )and separated them to see if that would fix it, and it helped slightly, but I'm still getting errors.
Another instance of it failing while running the test was it didn't clear before typing the new value. The previous value was 10 and should clear and then type 9. This worked as it looped through several inputs just fine, but randomly failed on one. Instead of 10 as the value, it was 910. The value never cleared even though the command "clear()" ran.
![Screenshot 2024-07-01 at 9 10 13 AM](https://private-user-images.githubusercontent.com/17856852/344688038-c47b6290-c34f-4de4-8f9b-a295074f0d01.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNjQ1NTksIm5iZiI6MTcyMDE2NDI1OSwicGF0aCI6Ii8xNzg1Njg1Mi8zNDQ2ODgwMzgtYzQ3YjYyOTAtYzM0Zi00ZGU0LThmOWItYTI5NTA3NGYwZDAxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA1VDA3MjQxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiODJiZmI4ZDIwOGZmY2UzMDg4ZmIyODBkYTUwMTYzMGI2OTUxZTExNGI5N2ExMDBhNTYxZWQ2ZDRjNjdiMTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ut22DIfgnb_fYeQV-pq4z5jxacmjszlTWawcdZF4vwI)
![Screenshot 2024-07-01 at 9 10 32 AM](https://private-user-images.githubusercontent.com/17856852/344688182-b06089d5-6e7f-4b06-bc88-0ef1c1ab1534.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNjQ1NTksIm5iZiI6MTcyMDE2NDI1OSwicGF0aCI6Ii8xNzg1Njg1Mi8zNDQ2ODgxODItYjA2MDg5ZDUtNmU3Zi00YjA2LWJjODgtMGVmMWMxYWIxNTM0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA1VDA3MjQxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiOWE1YTM5MTI2YjNhZGRiYTk3NmM3ZDVlNzM5MzQ5NDZiZTQ3MGNiNjM0YTk4YjIzMjg4N2E4NzBhMmMyYTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.skJWWUtYcljEN6hI3CIbS5okAEX0q0QGiPkmba6N1Qs)
Again, if I just run the test on this one section at a time, it passes. It seems that it gets overloaded when running the full form with the .each loops.
Desired behavior
Finish the command fully before checking the next command.
Test code to reproduce
Cypress Version
13.9.0
Node version
18.15.0
Operating System
Mac OS 14.3.1
Debug Logs
No response
Other
Using this with Angular 17.2.3
The text was updated successfully, but these errors were encountered: