---
title: "cy.prompt can now wait for network requests"
url: "https://www.cypress.io/blog/cy-prompt-can-now-wait-for-network-requests"
description: "cy.prompt can now wait for cy.intercept aliases directly inside your prompt instructions. Keep AI-assisted tests readable without breaking out of the prompt…"
---

# cy.prompt can now wait for network requests

March 11, 2026

By Jennifer Shehane

You're writing a test with `cy.prompt()`. The flow is clean: natural language instructions, no boilerplate, AI handling the mechanics. Then you need to wait for a network request before the next assertion is safe to make.

Until now, that meant breaking out of `cy.prompt`. You'd write your intercept, run your prompt, stop, insert `cy.wait('@users')`, and then try to pick the thread back up. It worked, but it interrupted the test's readability and defeated part of the point.

Starting today, `cy.prompt` supports waiting for aliases you've already defined. You can reference an alias name directly inside your prompt instructions, and Cypress will handle the wait without requiring you to exit the flow.

* * *

### What this looks like in practice

Define your intercept and alias as you normally would, outside of `cy.prompt`. Then reference the alias by name inside your prompt instructions:

```javascript
cy.intercept('/users').as('users')

cy.prompt([
  'Click on the users link',
  'wait for the @users request to finish',
  'verify there is a users table visible'
])
```

That's the full test. The alias is defined once. The prompt references it by name. Cypress resolves the wait in the correct sequence before moving to the next instruction.

There's nothing new to learn about how intercepts or aliases work. If you already use `cy.intercept` with `.as()`, this is additive. You're just telling `cy.prompt` to acknowledge what you've already set up.

* * *

### Why this matters for AI-assisted test writing

`cy.prompt` is designed to keep test intent readable in one place. When a test requires network coordination, the previous approach forced you to split that intent across multiple lines. You'd have AI-driven instructions alongside imperative waits, and the test read like two different approaches stitched together.

This change keeps coordination inside the prompt. The instructions stay in sequence. A reader can follow the test from top to bottom without needing to understand where `cy.wait` was inserted and why.

For teams adopting `cy.prompt` as part of their test authoring workflow, this removes one of the more common reasons to reach outside the prompt block.

* * *

### What's required

A few things to keep in mind:

-   The alias must be defined **before** `cy.prompt` runs. Define your `cy.intercept` and `.as()` outside and above the prompt block.
-   Reference the alias using the `@` prefix in your prompt instruction, matching the name you gave it exactly.

If the alias isn't defined before the prompt runs, the wait will fail the same way a standalone `cy.wait('@missingAlias')` would. The behavior is consistent with how Cypress handles aliases everywhere else.

* * *

### The simplest version of something useful

This is the first iteration of network-awareness inside `cy.prompt`, and we want to be direct about what that means: it handles the simplest case, waiting for a named intercept before continuing, but it isn't a full network coordination layer yet.

We're shipping this now because it solves a real friction point without requiring you to change how you define intercepts. It works with patterns you already use.

We'd like to hear from you on where to take this next. What types of network behavior are you working around today? What would make `cy.prompt` more useful in tests that involve complex async sequences? You can share feedback by opening an issue in our [GitHub repo](https://github.com/cypress-io/cypress?ref=cypress-io.ghost.io) or reach us through your usual support channel.

* * *

### Try it now

If you're using `cy.prompt`, try referencing an alias in your next prompt. The [cy.prompt documentation](https://docs.cypress.io/api/commands/prompt?utm_source=blog&utm_medium=inline-link&utm_content=cy.prompt+documentation&utm_campaign=cy-prompt-alias-wait) covers the full syntax and supported patterns.

If you haven't used `cy.prompt` yet, this is a good time to take a look. It's designed to reduce the gap between describing what a test should do and writing the code that does it.