-
Notifications
You must be signed in to change notification settings - Fork 3.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
chore: add internal log group API and update log group styles #20857
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ 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 |
packages/driver/src/cypress/log.ts
Outdated
@@ -202,18 +202,18 @@ const defaults = function (state, config, obj) { | |||
}, | |||
}) | |||
|
|||
const logGroup = _.last(state('logGroup')) | |||
const logGroups = state('logGroup') || [] |
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.
const logGroups = state('logGroup') || [] | |
const logGroupIds = state('logGroupIds') || [] |
I think this might make it a little clearer what the state holds. I won't add comments for each one, but of course, this also means updating other references as well.
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.
@computed get isInvisible () { | ||
return this.visible !== undefined && !this.visible | ||
} |
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.
I find it confusing and a little redundant for the command model to have both visible
and isInvisible
properties. Could we add logic in constructor
and update
to ensure model.invisible
is a boolean, based on whatever default makes sense, then use that instead of adding an extra property?
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.
👍🏻 Sure I can slip the logic to in the constructor to handle 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.
@@ -9,7 +9,7 @@ const LONG_RUNNING_THRESHOLD = 1000 | |||
|
|||
interface RenderProps { | |||
message?: string | |||
indicator?: string | |||
indicator?: 'successful' | 'pending' | 'aborted' | 'bad' |
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.
What does the status 'bad' mean?
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 set in three places and meant to represent the response status code however it's been pulled into sessions to indicate if a session failed (we intend to update this later on)
- xhr - a status code that does not start with 2
- requests proxy-logging - a non-200 status code
- sessions - failed on session validation
@computed get numChildren () { | ||
// and one to include self so it's the total number of same events | ||
return this.children.length + 1 | ||
if (this.event) { |
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.
add a comment about why if this.event exists we return? it's not evident in the name.
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.
does the comment below explain 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.
does this help? 7b0746a
(#20857)
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.
Yes thanks!
this.visible = props.visible | ||
// command log that are not associated with elements will not have a visibility | ||
// attribute set. i.e. cy.visit(), cy.readFile() or cy.log() | ||
this.isInvisible = props.visible !== undefined && !props.visible |
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.
While this gets rid of the redundancy, how about sticking with model.visible
since it mirrors the props? So here and in update
, it could be this.visible = props.visible === true || props.visible === undefined
instead.
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.
I originally changed it to reflect the boolean value and to reflect it's usage in the UI, but I change it back: 6f5a7d9
(#20857)
commit 17e6bf4 Author: Matt Henkes <mjhenkes@gmail.com> Date: Wed Apr 6 11:26:03 2022 -0500 chore: [Multi-domain] Rename switchToDomain to origin (#20927) * chore: [Multi-domain] Rename switchToDomain to origin * Regenerate system tests snapshots * Update cli/schema/cypress.schema.json Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com> * Update cli/types/cypress.d.ts Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com> commit 0772f85 Merge: 81e9283 d0fc93b Author: mjhenkes <mjhenkes@gmail.com> Date: Wed Apr 6 09:51:49 2022 -0500 Merge branch 'develop' into feature-multidomain commit d0fc93b Author: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> Date: Tue Apr 5 17:18:39 2022 -0500 chore: add internal log group API and update log group styles (#20857) Co-authored-by: Matt Henkes <mjhenkes@gmail.com> commit ee7495f Author: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> Date: Tue Apr 5 15:45:12 2022 -0500 fix: fix flaky report test (#20886) commit 81e9283 Merge: f45be5e edf9c11 Author: Matt Henkes <mjhenkes@gmail.com> Date: Tue Apr 5 11:40:02 2022 -0500 Merge branch 'develop' into feature-multidomain commit f45be5e Author: Matt Henkes <mjhenkes@gmail.com> Date: Tue Apr 5 11:39:53 2022 -0500 chore: [Multi-domain] Resolve flaky test (#20917) * chore: [Multi-domain] Resolve flaky test * remove ts ignore * update comment * remove dead code * Updated comment commit edf9c11 Author: Chris Breiding <chrisbreiding@users.noreply.github.com> Date: Tue Apr 5 12:07:56 2022 -0400 fix: Resend *.enable commands on CDP reconnect (#20916) Co-authored-by: Zach Bloomquist <git@chary.us> Co-authored-by: Matt Henkes <mjhenkes@gmail.com> commit 0cce18a Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue Apr 5 10:04:55 2022 -0500 chore: Update Chrome (stable) to 100.0.4896.75 (#20909) Co-authored-by: cypress-bot[bot] <2f0651858c6e38e0+cypress-bot[bot]@users.noreply.github.com> commit e0ebd08 Merge: 2e48f85 94fa50d Author: Blue F <blue@cypress.io> Date: Mon Apr 4 14:39:23 2022 -0700 Merge pull request #20839 from sainthkh/issue-20562 fix: `cy.type()` + `{enter}` or ` ` should work with Firefox 98+ commit 2e48f85 Author: David Munechika <david.munechika@gatech.edu> Date: Mon Apr 4 11:47:02 2022 -0400 fix: --spec with glob incorrectly splits filename (#20848) Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> commit c0d638c Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon Apr 4 06:33:59 2022 +1000 chore: Update Chrome (beta) to 101.0.4951.15 (#20882) Co-authored-by: cypress-bot[bot] <2f0651858c6e38e0+cypress-bot[bot]@users.noreply.github.com> commit 0df0d7a Author: Jon Koops <jonkoops@gmail.com> Date: Fri Apr 1 03:08:22 2022 +0200 fix(types): add correct type for preserve cookie callback (#20513) Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com> commit 94fa50d Author: KHeo <sainthkh@naver.com> Date: Thu Mar 31 15:03:48 2022 +0900 feedback commit c66a23e Author: KHeo <sainthkh@naver.com> Date: Wed Mar 30 16:18:26 2022 +0900 fix: `cy.type()` should work with Firefox 98+
User facing changelog
n/a - this is an internal API that will be used in the coming experimental multi-domain command.
Details
Screen.Recording.2022-04-01.at.12.17.56.PM.mov
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?