Skip to content
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

fix(net-stubbing): match cy.intercept(url) globs against url+path #14241

Merged
merged 5 commits into from Dec 21, 2020

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Dec 18, 2020

User facing changelog

Additional details

  • adds a matchUrlAgainstPath property to RouteMatcher
    • allows differentiating cy.intercept(url) from cy.intercept({ url }) or cy.intercept({ path })
    • also follows old cy.route behavior by applying a / prefix to un-prefixed url values that are being matched against a path - old behavior:
      // be nice to our users and prepend
      // pattern with "/" if it doesnt have one
      // and str does
      if (pattern[0] !== '/' && str[0] === '/') {
      pattern = `/${pattern}`
      }

How has the user experience changed?

now works as described in #9379 (comment)

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 18, 2020

Thanks for taking the time to open a PR!

@flotwig flotwig marked this pull request as ready for review December 18, 2020 18:25
@cypress
Copy link

cypress bot commented Dec 18, 2020



Test summary

9170 0 118 3Flakiness 1


Run details

Project cypress
Status Passed
Commit 1be0bed
Started Dec 21, 2020 5:10 PM
Ended Dec 21, 2020 5:23 PM
Duration 12:30 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

Can you add a test for passing matchUrlAgainstPath: false to ensure this will strictly match against the url if set to false?

Should be good to merge after my comments are addressed.

flotwig and others added 2 commits December 21, 2020 10:19
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants