-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update intercept.mdx #5485
Update intercept.mdx #5485
Conversation
Fix url variable cy.intercept
👷 Deploy request for cypress-docs pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for benevolent-cat-040f48 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
@RobinsonRojas the original example should still work and using the options object as you propose should also do the trick as well, but with a full HTTP request URL. Do you have a reproducible example of the original API not working? |
@jaffrepaul yes this is /// <reference types="cypress" />
context('Waiting', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/waiting')
})
it('cy.wait() - wait for a specific route', () => {
// Listen to GET to comments/1
// CypressError
cy.intercept('https://jsonplaceholder.cypress.io/comments/1', { times: 1 }).as('getComment')
// No CypressError
// cy.intercept({ url:'https://jsonplaceholder.cypress.io/comments/1', times: 1 }).as('getComment')
cy.get('.network-btn').click()
// wait for GET comments/1
cy.wait('@getComment')
.its('response.statusCode')
.should('be.oneOf', [200, 304])
})
}) |
@RobinsonRojas Can you run lint on the PR? |
Code style fix
@jennifer-shehane Yes but I didn't find the format error. |
Fix url variable cy.intercept