Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 427 Bytes

7.-cypress-degiskenler-variables.md

File metadata and controls

16 lines (14 loc) · 427 Bytes

👾 7. Cypress Değişkenler (Variables)

Cypress'te var, let ve const gibi değişkenlerin kullanımı vardır.

cy.get('.btn').then(($span) => {
 // value capture before button click and stored in const
 const n = parseInt($span.text())
 cy.get('b').click().then(() => {
 // value capture after button click and stored in const
 const m = parseInt($span.text())
 // comparison
 expect(n).to.eq(m)
 })
})