> For the complete documentation index, see [llms.txt](https://furkans-organization-1.gitbook.io/cypress-notlari/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://furkans-organization-1.gitbook.io/cypress-notlari/4.-cypress-ile-ilk-test.md).

# 4. Cypress ile İlk Test

Bir test dosyası ekleyelim

<figure><img src="https://3980405858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXo8f7XEmBCFGkCUtWWUO%2Fuploads%2Fpp0b1UnzErM8bmvTerwB%2FScreenshot%202023-02-20%20at%2023.38.37.png?alt=media&amp;token=17e7a8aa-edca-47df-8891-86f757ec8871" alt=""><figcaption></figcaption></figure>

**Cypress Dosya Yapısını inceleyelim**

**fixtures:** Testler için anahtar-değer çiftleri şeklindeki test verileri burada tutulur.

**integration ya da e2e:** Test senaryoları burada tutulur.

**plugins:** Cypress olayları (bir test için yürütülecek önceki ve sonraki olaylar) burada muhafaza edilir.

**support:** Test tarafından kullanılabilen yeniden kullanılabilir yöntemler veya özelleştirilmiş komutlar vakalar doğrudan, nesne oluşturmadan burada oluşturulur.

**videos**: Yürütülen test adımları video şeklinde kaydedilir ve burada tutulur. Bu özelliği istersek kapatabiliyoruz. Ben kapatmayı tercih ediyorum fazla yer kapladığı için.

## İlk Test

İlk test için **e2e** klasörü altında ***ilk-test.cy.js*** şeklinde oluşturalım.

```javascript
describe('example to-do app', () => {
    it('adds two numbers', () => {
        cy.visit('http://porti.wtf')

        cy.get('.add').click()
        cy.get('.add').click()

        cy.get('.total').should('have.text', '2')
    })
})

```

şeklinde ekleyip, çalıştırarak ilk testimizi oluşturmuş olduk.

#### Bir Test Senaryasonun yapısı şu şekilde kurmalıyız

```javascript
// test suite name
describe('Porti Test', function () {
// Test case
 it('Scenario 1', function (){
 // test step for URL launching
 cy.visit("https://www.google.com/");
 });
 }
```
