How to add assersion message #14486
              
                Unanswered
              
          
                  
                    
                      iyangdidi
                    
                  
                
                  asked this question in
                Questions and Help
              
            Replies: 1 comment 1 reply
-
| I think the problem is the element you are getting and not the assertion. Is there any other way to get the element and be more precise? If you can share the source-code at least, maybe I could try to help you. | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I need to add customized assersion message to make the failure more readable.
According to the documents https://docs.cypress.io/api/commands/should.html#Function
expect($lis.eq(0), 'first item').to.contain('Walk the dog')will worksBut the message will only shown when using 'cypress open' not 'cypress run'
'cypress open'

'cypress run'

Beta Was this translation helpful? Give feedback.
All reactions