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