0

Im new to cypress and have a question about what happens to my script when it fails. I have a script with the following code. It fails on a check because there is a bug, but when it finds the bug the script stops running and doesn't continue to the end of the script. How can i get it to log the fail but continue with test until the end.

This is my code

//Remove all records in the Script History
cy.request('https://glv0055.infraxis.com/IQScloudWeb/IQScloudManager/apiv2/runtestcase?token=8zf0bb1ue0qkk8x0&env=447391806981543900000&sim=2211180816258863451900&testset=2304171604143385976850&testcase=2304181315125936533470')
//Refresh the screen
cy.get('.toolbtn > #searchbutton').click()
cy.get('#accountDetailsTabs > :nth-child(4) > a').should('be.visible').click()
//Check the state of the buttons when no records appear
cy.get('#emvScriptHistory > .ng-isolate-scope > .panel > :nth-child(3) > .row > .col-md-12 > [ng-disabled="currentPage === 0"]').should('be.visible').and('be.disabled')
cy.get('#emvScriptHistory > .ng-isolate-scope > .panel > :nth-child(3) > .row > .col-md-12 > [ng-disabled="!(getFirstItem() > 0)"]').should('be.visible').and('be.disabled')
cy.get('#emvScriptHistory > .ng-pristine > .panel > :nth-child(3) > .row > .col-md-12 > .ng-binding').should('have.text',"1 / 1")
cy.get('#emvScriptHistory > .ng-isolate-scope > .panel > :nth-child(3) > .row > .col-md-12 > [ng-click="nextPage()"]').should('be.visible').and('be.disabled')
cy.get('#emvScriptHistory > .ng-isolate-scope > .panel > :nth-child(3) > .row > .col-md-12 > [ng-click="lastPage()"]').should('be.visible').and('be.disabled')

The script fails on this line

cy.get('#emvScriptHistory > .ng-pristine > .panel > :nth-child(3) > .row > .col-md-12 > .ng-binding').should('have.text',"1 / 1")

the actual results are it has the text .should('have.text',"1 / 0")

I appreciate any help you can give me

  • Hi Michelle, I think your question already has solution at : https://stackoverflow.com/questions/57122122/how-to-continue-to-execution-even-when-one-check-fail – Omkar76 May 24 '23 at 09:16

0 Answers0