🥝
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
  • Get Metodu
  • Post Metodu

16. Cypress Get ve Post İşlemleri

Get Metodu

Bir Get işlemi gerçekleştirmek için cy.request() ile bir HTTP isteği yapacağız ve Get yöntemini ve URL'yi bu yönteme parametre olarak geçmeliyiz.

describe("Get Method", function(){
    it("Scenario 2", function(){
    cy.request("GET", "https://jsonplaceholder.cypress.io/comments", {})
        .then((r) => {
            expect(r.status).to.eq(200)
            expect(r).to.have.property('headers')
            expect(r).to.have.property('duration')
        });
    })
})

Post Metodu

Post yöntemini kullanırken aslında bilgi gönderiyoruz. Eğer elimizde bir grup varlıkları, Post'un yardımıyla sonuna yenilerini ekleyebiliriz.

describe("Post Method", function(){
    it("Scenario 3", function(){
        cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
            .its('body.0') // yields the first element of the returned list
        
        // make a new post on behalf of the user
        cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
            title: 'Cypress',
            body: 'Automation Tool',
        })
    })
 });
Previous15. Cypress Cookie İşlemleriNext17. Api Response Data Type Kontrolu

Last updated 2 years ago

☘️