Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/api/commands/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ Option | Default | Description
cy.get('.second').next()
```

### Testing a datalist
```html
<input list="fruit" />
<datalist id="fruit">
<option>Apple</option>
<option>Banana</option>
<option>Cantaloupe</option>
</datalist>
```

```javascript
cy.get('#fruit option')
.first().should('have.text', 'Apple')
.next().should('have.text', 'Banana')
.next().should('have.text', 'Cantaloupe')
```

## Selector

### Find the very next sibling of each li. Keep only the ones with a class `selected`
Expand Down
15 changes: 15 additions & 0 deletions source/api/commands/type.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ Each keypress is delayed 10ms by default in order to simulate how a very fast us
cy.get('[contenteditable]').type('some text!')
```

### 'Selecting' an option from datalist
For 'selecting' an option, just type it into the input.
```html
<input list="fruit" />
<datalist id="fruit">
<option>Apple</option>
<option>Banana</option>
<option>Cantaloupe</option>
</datalist>
```

```javascript
cy.get('input').type('Apple')
```

## Tabindex

### Type into a non-input or non-textarea element with `tabindex`
Expand Down