Cypress

 Cypress  Its  is a free and open source automation tool, MIT-licensed and written in JavaScript

--------------------------------------------------------------------------------------------------------------------

Implicit assertion ( it appears on LOGs every time )
----------------------------------------------------------------------------
cy.url().should('include','theExpectedText')   // to check the particular test inside the respective URL



should-contain     .should('contain),'any text')



should-have        .should('have.class','abc')
    have.text
    have.html
should-be    .should('be.visible')
    be.enabled
    be.selected
    be.disabled
    be.focused = have.focus

// We can use two condition to check
cy.get('input[name=userName]').should('be.visible').should('be.enabled').type('Hello World')


should-equal    .invoke('attr','id').should('equal','abc')
         .should('eq','expectedText')
//TO get Title of the portal / page
Cy.title().should('eq','expectedText')



//Not / negative 
    .should('not.be.checked')

chain assertion
   .should('be.visible').and(be.selected)


Explicit ( it appears on LOGs only when it got failed )
----------------------------------------------------------------------------
except     expect(true).to.be.true
let name = 'abc'
except(name).to.be.equal('abc')

to.not.equal()
to.be.a('string')
to.be.true
to.be.false
to.be.null
to.exist

assert assert.equal
assert.notEqual
assert.strictEqual
assert.isAbove
assert.isBelow
assert.exists
assert.notExists
assert.true
assert.isNumber
----------------------------------------------------------------------------

Click 
Normal Click - click()
Forceful Click - click({force:true})  // if that element is covered by someother / overlap object


Comments

Popular posts from this blog

The self healing automation framework - Healenium Updated Dec2023

Heleanium - Web without using Docker