# 6. Cypress Basit Komutlar

### visit

Bir URL başlatır.

```javascript
cy.visit('https://www.iddaa.com')
```

### get

DOM üzerinden tekli veya çoklu elemanlar elde eder.

```javascript
cy.get('#txt')
```

### title

```javascript
cy.title()
```

### reload

```javascript
cy.reload()
```

### viewport

```javascript
// viewport to 100px and 500px
cy.viewport(100, 500)
```

### wait

```javascript
cy.wait(1000)
```

### go

```javascript
//like clicking back button
cy.go('back')
//like clicking forward button
cy.go('forward')
```

### getCookie ya da getCookies

```javascript
cy.getCookie('abc')

cy.getCookies()
```

### First ve End

Find: Bir grup elemandan ilk elemanı elde eder.

End: Bir grup elemandan son elemanı elde eder.

```javascript
//obtain first td in tr
cy.get('tr>td').first()

//obtain first td in tr
cy.get('tr>td').end()
```

### Contains

Belirli bir metne sahip bir eleman elde eder. Eleman metinden daha fazlasına sahip olabilir. Baktığımız metinde içeriğinde var mı kontrolu yapar.

```javascript
//returns element in #txt having Tutor text
cy.get('#txt').contains('İddaa')
```

### and

Bir assertion oluşturmak için kullanılır ve **.should()** ifadesinin takma adıdır.

```javascript
//element is visible & enabled
cy.get('#txt').should('be.visible').and('be.enabled')
//element is checked
cy.contains('Subject').and('be.checked')
```

### as

Daha sonra daha kolay ulaşıp kullanmak için bir takma ad sağlar.

```javascript
//alias element as parent
cy.get('#txt').find('li').first().as('parent')
```

### click

DOM üzerinde bir ögeye(genellikle bir butona) tıklamayı sağlar.

```javascript
//click on element with id txt
cy.get('#txt').click()
```

### each

Bir dizi boyunca yineleme yaparak testimizi yazmamızı sağlar.

```javascript
//iterate through individual li
cy.get('li').each(() => {...})
```

### eq

Bir eleman dizisinde belirli bir indeksteki bir elemanı ifade eder.

```javascript
//obtain third td in tr
cy.get('tr>td').eq(2)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://furkans-organization-1.gitbook.io/cypress-notlari/6.-cypress-basit-komutlar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
