Find, First ,Set Cookie, Wait ,Assertions, Navigating in Cypress - Bug Reaper

                  Bug Reaper

Lean about Automation Testing,Selenium WebDriver,RestAssured,Appium,Jenkins,JAVA,API Automation,TestNG,Maven, Rest API, SOAP API,Linux,Maven,Security Testing,Interview Questions

Thursday, 16 July 2020

Find, First ,Set Cookie, Wait ,Assertions, Navigating in Cypress

Find, First Command

describe('Inputs',function(){

it('Cypress Find',function(){
cy.visit('https://the-internet.herokuapp.com/tables',{retryOnNetworkFailure:true})
cy.get('#table1').find('tbody>tr').first().find('td').find('a').first().click()
cy.url('match','#edit')
})
})

Set Cookie

describe('Inputs',function(){

it('Cypress Find',function(){
cy.visit('https://the-internet.herokuapp.com/tables',{retryOnNetworkFailure:true})
cy.setCookie('neeraj',"bakhtani")
cy.getCookie('neeraj').should('exist')
})
})

Wait 
cy.wait(100000)

Asserting Title

cy.visit('https://the-internet.herokuapp.com/tables',{retryOnNetworkFailure:true})
cy.title().should('eq','The Internet')

Navigating Back and Forward

describe('Inputs',function(){

it('Cypress Find',function(){
cy.visit('https://the-internet.herokuapp.com/tables',{retryOnNetworkFailure:true})
cy.visit('https://the-internet.herokuapp.com/inputs',{retryOnNetworkFailure:true})
cy.go('back')
cy.go('forward')
cy.go(-1) //back
cy.go(1)//forward

})
})

No comments:

Post a Comment