Skip to content

Lifetime of intercept #9395

Dec 1, 2020 · 5 comments · 3 replies
Discussion options

You must be logged in to vote

How long is the lifetime of an intercept() command? (It should be documented that the effect is reset before each test.)

After each test - https://docs.cypress.io/api/commands/intercept.html#Usage

What happens when you execute multiple intercept() commands? Does the second one replace the first? Or are they "stacked" on each other?

See discussion on this issue: #9302

Is it possible to manually remove the effect of all intercept() commands within a test (or the effect of the last one if they are "stacked")?

Not currently, but this is something that would be good to add in the future for advanced use cases.

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@flotwig
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by flotwig
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@flotwig
Comment options

@the0neWhoKnocks
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants