Home
Basics
Introduction Environment Setup Cypress Components First Test Running Tests Reports Element Identification GUI interaction Cypress Hooks Cypress Fixtures Integration with CI serversAdvanced
Page Object Model Custom Commands Intercepting Requests Backend Testing Interview Questions and AnswersCypress Hooks
Hooks are special methods that get executed before or after test.- before - This is executed before describe block.
- after - This is executed after describe block..
- beforeEach - This is executed before each test
- afterEachThis is executed after each test
describe('Softpost Hook Test', function () {
beforeEach(function(){
cy.log('This will be executed before every test')
})
it('Sample Test', function (){
cy.visit("https://softpost.org/selenium-test-page")
cy.get('#fn').type(this.data.firstName)
});
});
Web development and Automation testing
solutions delivered!!