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(ui): display duplicate aliases in command log #16382

Merged
merged 2 commits into from
May 7, 2021

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented May 6, 2021

User facing changelog

  • Improved the way that cy.intercept() and cy.route() requests with multiple aliases are displayed in the command log.

Additional details

How has the user experience changed?

The aliases are now displayed in one line (ignore the lack of badge background, this is just a test):

image

But the list can still be expanded, in which case it's unjoined:

image

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 6, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented May 6, 2021



Test summary

13760 0 164 5Flakiness 0


Run details

Project cypress
Status Passed
Commit 0f8df43
Started May 6, 2021 8:47 PM
Ended May 6, 2021 9:00 PM
Duration 12:52 💡
OS Linux Debian - 10.8
Browser Multiple

View run in Cypress Dashboard ➡️


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

@flotwig flotwig marked this pull request as ready for review May 6, 2021 21:24
@flotwig flotwig requested a review from a team as a code owner May 6, 2021 21:24
@flotwig flotwig requested review from chrisbreiding and removed request for a team May 6, 2021 21:24
@flotwig flotwig changed the title ui: display duplicate aliases in command log fix(ui): display duplicate aliases in command log May 6, 2021
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.

Why don't the tests have the proper classes for the display?

Inside test

Screen Shot 2021-05-07 at 8 41 59 AM

Outside test

Screen Shot 2021-05-07 at 8 42 37 AM

I feel like this should reflect reality.

Anyway, I fixed the css so that:

  • the weird circular alias shouldn't show anymore.
  • there is a max width on the matched aliases because it was really gnarly if there were more than 5 matches or so.

Not sure how great of a solution this is for people reviewing videos of the run.

@flotwig
Copy link
Contributor Author

flotwig commented May 7, 2021

Changes look great @jennifer-shehane. Finally, the weird cut-off-pill shape has been fixed!

@jennifer-shehane
Copy link
Member

@flotwig So the percy screenshots looks a little off with my css changes, but...again, I'm not sure if this is accurate to real situations that would happen. I can try to recreate locally, but at least the dup one in the screenshots doesn't look like that usually. https://percy.io/cypress-io/cypress/builds/10298521

@jennifer-shehane
Copy link
Member

I think the percy discrepencies are a zoom issue or something, because the css doesn't display the same as the snapshots when at 100%.

@flotwig Is this what's meant to be addressed in the other command log issue, but why are there duplicate logs for requests in this example 5 - 10 - 10?

It looks a lot clearer with the aliases displayed in this PR anyway.

it('test cy.intercept()', () => {
  cy.intercept('/u*').as('getUrl1')
  cy.intercept('/us*').as('getUrl2')
  cy.intercept('/use*').as('getUrl3')
  cy.intercept('/user*').as('getUrl4')
  cy.intercept('/users*').as('getUrl5')

  cy.visit('https://example.com')
  cy.window().then((win) => {
    const xhr = new win.XMLHttpRequest()
    xhr.open('GET', '/users')
    xhr.send()
  })

  cy.window().then((win) => {
    const xhr = new win.XMLHttpRequest()
    xhr.open('GET', '/users')
    xhr.send()
  })
  cy.window().then((win) => {
    const xhr = new win.XMLHttpRequest()
    xhr.open('GET', '/users')
    xhr.send()
  })

  cy.window().then((win) => {
    const xhr = new win.XMLHttpRequest()
    xhr.open('GET', '/users')
    xhr.send()
  })
  cy.window().then((win) => {
    const xhr = new win.XMLHttpRequest()
    xhr.open('GET', '/users')
    xhr.send()
  })

  cy.wait('@getUrl1')
  cy.wait('@getUrl2')
  cy.wait('@getUrl3')
  cy.wait('@getUrl4')
  cy.wait('@getUrl5')
})

Screen Shot 2021-05-07 at 10 29 58 AM

@flotwig
Copy link
Contributor Author

flotwig commented May 7, 2021

Is this what's meant to be addressed in the other command log issue, but why are there duplicate logs for requests in this example 5 - 10 - 10?

@jennifer-shehane the browser is probably retrying the request, since presumably it's failing?

Copy link
Contributor

@bahmutov bahmutov left a comment

Choose a reason for hiding this comment

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

super

@flotwig flotwig merged commit 1e7a3fa into develop May 7, 2021
tgriesser added a commit that referenced this pull request May 10, 2021
* develop:
  remove unused deps from webpack-preprocessor (#16384)
  feat: exclude html pwa plugin in webpack dev server (#16388)
  fix(ui): display duplicate aliases in command log (#16382)
  fix(ui): show req stub/fn when a handler is supplied (#16383)
  feat(component-testing): Expose CT through CLI module API (#16368)
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 10, 2021

Released in 7.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 10, 2021
@flotwig flotwig deleted the issue-9588-intercept-command-log branch January 24, 2022 18:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants