Cypress Important Points

 Cypress offers developers a powerful and user-friendly testing framework that simplifies test automation and enhances the reliability of web applications


How to do drag and drop in cypress

cy.get('#id').trigger('mousedown' , {which : 1 }) -  click on the middle of the icon
cy.get('data-set').trigger('mousemove')
cy.get('.class').trigger('mouseup')

How to verify Title

    cy.title().should('include', 'test automation')
    • This means that it doesn't require the full text of the title. Only part of it is enough 

Multiple assertions

       cy.get('#id').should('contain','abc').and('be.visible')

contain and contains
Contain : Method is used to assert that a DOM element contains specific text content

cy.get('#id').should('contain', 'Submit')

Contains : Method is used to select and interact with elements that contain specific text content

 cy.contains('Submit').click()

 



No comments:

Post a Comment