# Cypress Documentation
# Source: https://raw.githubusercontent.com/cypress-io/cypress-documentation/main/docs/api/commands/pause.mdx
# Path: docs/api/commands/pause.mdx

---
title: 'pause | Cypress Documentation'
description: Stop `cy` commands from running and allow interaction with the application under test.
sidebar_label: pause
slug: /api/commands/pause
---

<ProductHeading product="app" />

# pause

Stop `cy` commands from running and allow interaction with the application under
test. You can then "resume" running all commands or choose to step through the
"next" commands from the Command Log.

It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) to
chain further commands that rely on a DOM element as the subject after
`.pause()`.

:::info

This does not set a `debugger` in your code, unlike
[`.debug()`](/api/commands/debug)

:::

## Syntax

```javascript
.pause()
.pause(options)

cy.pause()
cy.pause(options)
```

### Usage

<Icon name="check-circle" color="green" /> **Correct Usage**

```javascript
cy.pause().getCookie('app') // Pause at the beginning of commands
cy.get('nav').pause() // Pause after the 'get' commands yield
```

### Arguments

<Icon name="angle-right" /> **options _(Object)_**

Pass in an options object to change the default behavior of `.pause()`.

| Option | Default | Description                                                                         |
| ------ | ------- | ----------------------------------------------------------------------------------- |
| `log`  | `true`  | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |

<HeaderYields />

- `.pause()` yields the same subject it was given.
- It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried)
  to chain further commands that rely on a DOM element as the subject after
  `.pause()`.

## Examples

### No Args

#### Pause after assertion

```javascript
cy.get('a')
  .should('have.attr', 'href')
  .and('match', /dashboard/)
  .pause()
cy.get('button').should('not.be.disabled')
```

## Rules

<HeaderRequirements />

- `.pause()` can be chained off of `cy` or off another command.

<HeaderAssertions />

- `.pause()` is a utility command.
- `.pause()` will not run assertions. Assertions will pass through as if this
  command did not exist.

<HeaderTimeouts />

- `.pause()` cannot time out.

## Command Log

**_Pause and step through each `.click()` command_**

```javascript
cy.get('#action-canvas').click(80, 75)
cy.pause()
cy.get('#action-canvas').click(170, 75)
cy.get('#action-canvas').click(80, 165)
cy.get('#action-canvas').click(100, 185)
cy.get('#action-canvas').click(125, 190)
cy.get('#action-canvas').click(150, 185)
cy.get('#action-canvas').click(170, 165)
```

The commands above will display in the Command Log as:

<DocsImage
  src="/img/api/pause/initial-pause-in-gui-highlights-the-pause-command.png"
  alt="Pause command on intial pause"
/>

When clicking on "Next: 'click'" at the top of the Command Log, the Command Log
will run only the next command and pause again.

#### Click "Next"

<DocsImage
  src="/img/api/pause/next-goes-on-to-next-command-during-pause.png"
  alt="Pause command after clicking next"
/>

#### Click "Next" again

<DocsImage
  src="/img/api/pause/continue-in-pause-command-just-like-debugger.png"
  alt="Continue to next command during pause"
/>

#### Click "Next" again

<DocsImage
  src="/img/api/pause/pause-goes-to-show-next-click.png"
  alt="Pause command"
/>

#### Click "Next" again

<DocsImage
  src="/img/api/pause/clicking-on-canvas-continues-as-we-click-next.png"
  alt="Pause command"
/>

#### Click "Next" again

<DocsImage
  src="/img/api/pause/last-next-click-before-out-test-is-finished.png"
  alt="Pause command"
/>

#### Click "Next" again, then 'Resume'

<DocsImage
  src="/img/api/pause/next-then-resume-shows-our-test-has-ended.png"
  alt="Pause command"
/>

## See also

- [Cypress Cloud](https://on.cypress.io/cloud)
- [`cy.debug()`](/api/commands/debug)
- [`cy.log()`](/api/commands/log)
- [`cy.screenshot()`](/api/commands/screenshot)