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

chore: add internal log group API and update log group styles #20857

Merged
merged 26 commits into from
Apr 5, 2022

Conversation

emilyrohrbough
Copy link
Member

@emilyrohrbough emilyrohrbough commented Mar 30, 2022

User facing changelog

n/a - this is an internal API that will be used in the coming experimental multi-domain command.

Details

  • Added log group api to be consumed internally by Cypress commands.
  • Update Reporter's Command UI
    • Group to be open by default for parent or child commands This will remain closed for Sessions commands.
      • When closed, will display number of logs within the group
    • Group cannot be pinned or render snapshots. This will be updated and allowed in 10.0+
      • The pin icon will not show on a command group.
      • A snapshot will not display when a group is hovered.
Screen.Recording.2022-04-01.at.12.17.56.PM.mov

PR Tasks

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

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 30, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Mar 31, 2022



Test summary

19363 0 218 0Flakiness 3


Run details

Project cypress
Status Passed
Commit 6c56096
Started Apr 5, 2022 9:18 PM
Ended Apr 5, 2022 9:30 PM
Duration 11:53 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

settings_spec.js Flakiness
1 Settings > file preference panel > loads preferred editor, available editors and shows spinner
commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > should handle aborted requests
commands/navigation_spec.js Flakiness
1 src/cy/commands/navigation > #visit > window immediately resolves and doesn't reload when visiting the same URL with hashes

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

@emilyrohrbough emilyrohrbough changed the title feat: add internal log group API and update log group styles chore: add internal log group API and update log group styles Apr 1, 2022
@mjhenkes mjhenkes assigned mjhenkes and emilyrohrbough and unassigned mjhenkes Apr 1, 2022
@emilyrohrbough emilyrohrbough marked this pull request as ready for review April 1, 2022 19:45
@emilyrohrbough emilyrohrbough requested a review from a team as a code owner April 1, 2022 19:45
@mjhenkes mjhenkes requested review from chrisbreiding and mschile and removed request for a team April 1, 2022 19:45
packages/driver/src/cy/logGroup.ts Show resolved Hide resolved
@@ -202,18 +202,18 @@ const defaults = function (state, config, obj) {
},
})

const logGroup = _.last(state('logGroup'))
const logGroups = state('logGroup') || []
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Member Author

Choose a reason for hiding this comment

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

packages/runner-shared/src/event-manager.js Outdated Show resolved Hide resolved
Comment on lines 65 to 67
@computed get isInvisible () {
return this.visible !== undefined && !this.visible
}
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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'
Copy link
Member

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?

Copy link
Member Author

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)

@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) {
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member Author

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)

Copy link
Member

Choose a reason for hiding this comment

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

Yes thanks!

mjhenkes
mjhenkes previously approved these changes Apr 5, 2022
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
Copy link
Contributor

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.

Copy link
Member Author

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)

@emilyrohrbough emilyrohrbough changed the title chore: add internal log group API and update log group styles chore: add internal log group API and update log group styles Apr 5, 2022
@emilyrohrbough emilyrohrbough merged commit d0fc93b into develop Apr 5, 2022
@emilyrohrbough emilyrohrbough deleted the new-cmd-group-9.x branch April 5, 2022 22:18
mschile added a commit that referenced this pull request Apr 6, 2022
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+
@emilyrohrbough emilyrohrbough added the type: chore Work is required w/ no deliverable to end user label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore Work is required w/ no deliverable to end user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add internal log group API
3 participants