I want to check that buttons urls are contain specific urls (without clicking on them), is it possible?
You can use the jquery enabled selector to check whether the button is enabled or not and based on that perform other actions.
visit() . By default, the cy. visit() commands' will use the pageLoadTimeout and baseUrl set globally in your configuration. The URL to visit.
Check out the list of supported assertions: https://docs.cypress.io/guides/references/assertions.html#Chai
You can use have.attr
to test the href
attribute of an <a>
tag.
For example:
cy.get('a.my-link').should('have.attr', 'href', 'https://example.com')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With