Can someone please explain me what is the difference between cy.get(selector).trigger(‘be.visible’) and cy.get(selector).should(‘be.visible’)
I’ve seen that they are working in similar way I and I wanted to know deeper because in official documentation I saw only should(‘be.visible’) is explained.
>Solution :
.trigger() can only be used with events, but .trigger('be.visible') is not sending an event.
It’s attempting to make a chaijs assertion in the wrong command, and will throw an error if you use it.
Syntax
.trigger(eventName)
.trigger(eventName, position)
.trigger(eventName, options)
.trigger(eventName, x, y)
.trigger(eventName, position, options)
.trigger(eventName, x, y, options)