-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(driver): add filtering API for request logs #22458
Conversation
Thanks for taking the time to open a PR!
|
|
||
context('Cypress.ProxyLogging', () => { | ||
describe('.logInterception', () => { | ||
it('creates a fake log for unmatched requests', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now covered by 'can ignore an intercept log' which was added above.
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
Flakiness
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 |
…ypress into issue-9358-ignore-http-logs
@@ -0,0 +1,443 @@ | |||
import { expect } from 'chai' | |||
|
|||
describe('Request Logs', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of this file is the same as it was in proxy-logging.cy.ts
, but GitHub's diff viewer doesn't seem to detect the rename.
Co-authored-by: Blue F <blue@cypress.io>
To match the phrasing used by DevTools and elsewhere.
@@ -278,7 +278,7 @@ class $Cypress { | |||
|
|||
// TODO: Remove this after $Events functions are added to $Cypress. | |||
// @ts-ignore | |||
this.ProxyLogging = new ProxyLogging(this) | |||
this.NetworkLogs = new NetworkLogs(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a much better name!
We will most likely not add this API for the time being. Instead, we will solve #9358 by implementing two features:
Then, users can disable the default logging like so: cy.intercept({ resourceType: /xhr|fetch/ }, { log: false }) |
Flaky test issues:
User facing changelog
Exposed a new function,
Cypress.RequestLogs.filter
, which enables users to selectively enable or disable Command Log output for HTTP requests.Additional details
cy.intercept()
s until we have acy.intercept({ log: false })
? - no - add a prop for thisSteps to test
Follow the examples below and see what gets logged when HTTP requests are made.
How has the user experience changed?
New API is available for selectively logging HTTP requests:
PR Tasks
cypress-documentation
? docs(api): add Cypress.NetworkLogs API cypress-documentation#4884type definitions
?