🥝
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
  • Implicit Assertions
  • Explicit Assertions
  • Diğer Cypress Assertionları

10. Cypress Assertions(iddia)

Cypress, Mocha ve Chai gibi çeşitli kütüphanelerden elde edilen birden fazla assertion türüne sahiptir.

Implicit Assertions

describe('Assertion Lesson', function () {
  it('Scenario 1', function (){
 
 // test step to launch a URL
 cy.visit("https://www.iddaa.com")
 
 // assertion to validate count of sub-elements and class attribute value
 cy.get('.toc chapters').find('li').should('have.length',5)
    .and('have.class', 'dropdown')
  });
});

Explicit Assertions

describe('Tutorialspoint', function () {
 // it function to identify test
    it('Scenario 1', function (){
       // test step to launch a URL
       cy.visit("https://accounts.google.com")
       // identify element
       cy.get('h1#headingText').find('span').then(function(e){
       const t = e.text()
       // assertion expect
       expect(t).to.contains('Sign')
     })
   })
})

Diğer Cypress Assertionları

  • cy.visit ()

  • cy.request ()

  • cy.contains ()

  • cy.get ()

  • .find ()

  • .type ()

  • .click ()

  • .its ()

cy.get('#txt-fld').should('have.length',5)
cy.get(' #txt-fld').should('have.value', 'Cypress')
cy.get('#txt-fld'').should('have.class', 'txt')
cy.get('#txt-fld'').should('contain', 'Cypress')
cy.get('#txt-fld'').should('be.visible')
cy.get('#txt-fld'').should('not.exist');
cy.get('#txt-fld'').should('have.css', 'display', 'block');

Previous9. Cypress LocatorsNext11. Cypress Metin Doğrulaması

Last updated 2 years ago

☝️