🪝26. Cypress Hooks
before: Herhangi bir testin önceden yürütülmesinden sonra yürütülür gerçekleştirilir.
after: Tüm testlerin yürütülmesinden sonra yürütülür gerçekleştirilir.
beforeEach: Her bir testin yürütülmesinden önce yürütülür.
afterEach: Her bir testing yürütülmesinden sonra yürütülür
describe('Tutorialspoint', function() {
before(function() {
// executes once prior all tests in it block
cy.log("Before hook")
})
after(function() {
// executes once post all tests in it block
cy.log("After hook")
})
beforeEach(function() {
// executes prior each test within it block
cy.log("BeforeEach hook")
})
afterEach(function() {
// executes post each test within it block
cy.log("AfterEac hook")
})
it('First Test', function() {
cy.log("First Test")
})
it('Second Test', function() {
cy.log("Second Test")
})
})Implementation with .only and .skip
Last updated