Skip to content
Merged
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
20 changes: 18 additions & 2 deletions docs/guides/guides/network-requests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ cy.wait('@new-user').then(console.log)

## Command Log

Cypress logs all `XMLHttpRequest`s and `fetch`es made by the application under
test in the Command Log. Here is an example of what this looks like:
By default, Cypress logs all `XMLHttpRequest`s and `fetch`es made by the
application under test in the Command Log. Here is an example of what this looks
like:

<!-- Code to reproduce screenshot:
cy.visit('https://jsonplaceholder.cypress.io')
Expand All @@ -541,6 +542,21 @@ test in the Command Log. Here is an example of what this looks like:
alt="Screenshot of fetch and XHR requests"
/>

:::info

**Note:** Logging can be disabled by passing `{ log: false }` with the static
response.

```js
cy.intercept('/users*', { body: ['user1', 'user2'], log: false }).as('getUsers')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the example that disables all xhr/fetch logs?

https://docs.cypress.io/api/commands/intercept#Disabling-logs-for-a-request

Copy link
Contributor Author

@mjhenkes mjhenkes Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically used the example from farther down in the guide to match: https://github.com/cypress-io/cypress-documentation/pull/5124/files#diff-bb8ce895b7660f9f324902a3e98c85d05f942fdd16997394dd5fc0dc46abb095L554

but could change to disable all if people want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also link out to the example that shows how to disable all if we didn't want to update here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in c020484

```

To disable logs for all xhr/fetch requests, checkout our
[example](/api/commands/intercept#Disabling-logs-for-a-request) on the intercept
api page.

:::

The circular indicator on the left side indicates if the request went to the
destination server or not. If the circle is solid, the request went to the
destination server; if it is outlined, the response was stubbed by
Expand Down