🥝
Cypress Notlari
  • 🥑1. Cypress – Giriş
  • 📐2. Cypress Kurulum
  • 🥳3. Test Runner
  • 🔥4. Cypress ile İlk Test
  • ⚔️5. Cypress Destekleyen Tarayıcılar
  • 🦇6. Cypress Basit Komutlar
  • 👾7. Cypress Değişkenler (Variables)
  • 😎8. Cypress Aliases
  • 👻9. Cypress Locators
  • ☝️10. Cypress Assertions(iddia)
  • 📔11. Cypress Metin Doğrulaması
  • 🧞12. Cypress Eşzamansız Davranış(Asynchronous Behavior)
  • 🦊13. Cypress XHR ile çalışma
  • ✅14. Cypress Checkbox
  • 🍪15. Cypress Cookie İşlemleri
  • ☘️16. Cypress Get ve Post İşlemleri
  • 🦆17. Api Response Data Type Kontrolu
  • ☔18. Chai Json Schema
  • 🥳19. Chai ile Schema Oluşturma Örnekleri
  • 🇲🇬20. Cypress Fixtures
  • 🆓21. Cypress — Dashboard Hackliyoruz
  • 🎥22. Cypress Screenshotlar ve Videolar
  • 😋23. Cypress Debugging
  • 🛃24. Cypress Custom Commands
  • 📖25. Cypress Environment Variables
  • 🪝26. Cypress Hooks
  • 🎑27. Cypress Reports
  • ⛳28.Best Practices
  • Kaynakça
Powered by GitBook
On this page

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

describe('Tutorialspoint', function()
    //it block with tag .only
    it.only('First Test', function() {
        cy.log("First Test")
    })
    
    //it block with tag .only
    It.only('Second Test', function() {
        cy.log("Second Test")
    })
    
    it('Third Test', function() {
        vacy.log("Third Test")
    })
    
    //it block with tag .skip
     it.skip('Skip Test', function() {
         cy.log("Skip Test")
     })
})
Previous25. Cypress Environment VariablesNext27. Cypress Reports

Last updated 2 years ago

🪝