---
id: api/commands/end
title: end | Cypress Documentation
description: End a chain of commands in Cypress.
section: api
source_path: docs/api/commands/end.mdx
version: fa8f60eba6ec9a949b75fe9f9f5f6591719cd01f
updated_at: '2026-05-05T21:21:10.048Z'
---
# end

End a chain of commands.

## Syntax

```
.end()
```

### Usage

**Correct Usage**

```
cy.contains('ul').end() // Yield 'null' instead of 'ul' element
```

**Incorrect Usage**

```
cy.end()
```

### Yields [Learn about subject management](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Subject-Management)

*   `.end()` yields `null`.

## Examples

`.end()` is useful when you want to end a chain of commands and force the next command to not receive what was yielded in the previous command.

```
cy.contains('User: Cheryl')  .click()  .end() // yield null  .contains('User: Charles')  .click() // contains looks for content in document now
```

Alternatively, you can always start a new chain of commands off of `cy`.

```
cy.contains('User: Cheryl').click()cy.contains('User: Charles').click() // contains looks for content in document now
```

## Rules

### Requirements [Learn about chaining commands](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Chains-of-Commands)

*   `.end()` requires being chained off a previous command.

### Assertions [Learn about assertions](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Assertions)

*   `.end()` cannot have any assertions chained.

### Timeouts [Learn about timeouts](/llm/markdown/app/core-concepts/introduction-to-cypress.md#Timeouts)

*   `.end()` cannot time out.

## Command Log

*   `.end()` does _not_ log in the Command Log

## See also

*   [`.root()`](/llm/markdown/api/commands/root.md)
*   [`.within()`](/llm/markdown/api/commands/within.md)
