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

feat: IATR-M0 Page Header #24722

Merged
merged 14 commits into from
Nov 22, 2022
Merged

Conversation

amehta265
Copy link
Contributor

@amehta265 amehta265 commented Nov 17, 2022

User facing changelog

This component is the header of the new debug page that represents the chosen run and its metadata.
The design for this page can be found here

Additional details

  • The DebugPageHeader contains metadata related to a user's test. In order to render the status of the test (i.e. number of passed, failed, skipped, pending tests) I have also created another component DebugResults. DebugResults utilizes an already existing component ResultCounts to render the UI for this section. Changes have been ResultCounts.vue to accommodate for a change in the order of statuses shown as per design requirements.
  • debugPageHeader accepts gql values as a prop. In case these props are not passed to the component it will render default values.
  • Certain functions such as commitsAhead() are merely placeholders and will be implemented later on. Furthermore the gql query will potentially change in the future

Steps to test

This issue has 3 component tests. Checkout to this branch to run the tests
Both DebugPageHeader.vue and DebugResults.vue exist in the packages/app/ folder. To run these tests:

  1. Change directory to packages/app
  2. Run yarn dev
  3. Navigate to Component Testing and run DebugPageHeader.cy.tsx and DebugResults.cy.tsx

To test ResultsCounts.vue

  1. Go to the cypress root directory
  2. Run yarn cypress:open
  3. Add frontend-shared as a project
  4. Open frontend-shared in Component Testing and run ResultCounts.cy.tsx

How has the user experience changed?

Screenshot 2022-11-17 at 12 07 40 PM

PR Tasks

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

@amehta265 amehta265 requested review from a team and warrensplayer November 17, 2022 17:14
@cypress
Copy link

cypress bot commented Nov 17, 2022



Test summary

436 1 10 0Flakiness 2


Run details

Project cypress
Status Failed
Commit 1271412
Started Nov 22, 2022 6:07 AM
Ended Nov 22, 2022 6:19 AM
Duration 12:29 💡
OS Linux Debian -
Browser Chrome 106

View run in Cypress Dashboard ➡️


Failures

cypress/e2e/runs.cy.ts Failed
1 App: Runs > refetching > should fetch newer runs and maintain them when navigating

Flakiness

runner/reporter-ct-mount-hover.cy.ts Flakiness
1 CT Mount angular-14 > While hovering on Mount(), shows component on AUT for angular-14
specs_list_latest_runs.cy.ts Flakiness
1 App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs

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
Contributor

@warrensplayer warrensplayer left a comment

Choose a reason for hiding this comment

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

Still looking through details, but wanted to get this feedback to you.

packages/frontend-shared/src/components/ResultCounts.vue Outdated Show resolved Hide resolved
packages/frontend-shared/src/components/ResultCounts.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugResults.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
@warrensplayer warrensplayer requested a review from a team November 17, 2022 20:46
]
const acc: status[] = []

if (props.order) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the order even be configurable? The results this component displays should be consistent across features, otherwise it becomes confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an attempt to make the ResultCounts.vue component more generic. In its current implementation, the status can only appear in a certain order i.e. skipped, pending, passed, failed. You can see this generic component in the Runs tab for the app.
Based on the design requirements for this issue, the order of these "statuses" is different. Hence, instead of building a whole new component we can utilize ResultCounts.vue and just pass in a different order incase in the future the order of "statuses" is different.

As for the component being consistent, I agree with that. I don't see why the "status" order should differ across pages. However this has been added to meet the design requirements

Copy link
Contributor

Choose a reason for hiding this comment

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

I would sync back with design regarding this, this result of this list (in my mind) should be consistent regardless of if you're looking at the runs page or the debug page

packages/app/src/debug/DebugResults.vue Show resolved Hide resolved
packages/app/src/debug/DebugResults.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Sure looks pretty, left some comments

packages/app/src/debug/DebugPageHeader.cy.tsx Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.vue Show resolved Hide resolved

</script>
<style scoped>
ul:nth-child(2) li:not(:first-child)::before {
Copy link
Contributor

Choose a reason for hiding this comment

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

Woah, this is specific. I think this CSS could break easily.

I'm not sure what it does, but can we use a class or id or something that isn't tied to a specific DOM structure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This adds the " . " after each component in the bottom section of the UI. That way we don't manually have to add " . " in our template. It is similar to styling here

packages/app/src/debug/DebugResults.cy.tsx Show resolved Hide resolved
<div
class="text-red-400 font-semibold text-sm flex items-center border-r-1px px-2"
>
<component
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just

  <FailedSolidIcon
    class=...
    data-cy=...
/>

<component> is good for dynamic content - but this isn't. (Could be missing something).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not always be a FailedSolidIcon. In future iterations, this could be a PassedIcon or hold other statuses hence the <component>

import type { DebugResultsFragment } from '../generated/graphql'
import { gql } from '@urql/core'
import FailedSolidIcon from '~icons/cy/status-failed-solid_x24.svg'
import ResultCounts from '@packages/frontend-shared/src/components/ResultCounts.vue'
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious what the team things but this seems like it's not really a good candidate for frontend-shared. It doesn't seem like something we will use in other packages (like launchpad).

Thoughts? cc @marktnoonan, we had a brief discussion around this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@lmiller1990 The ResultsCounts is an existing component that was just getting reused here with a minor addition. I do agree that it is only used in app so does not need to be in frontend-shared, but we can refactor that another time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me

@amehta265 amehta265 changed the title feature: IATR-M0 Page Header feat: IATR-M0 Page Header Nov 21, 2022
Copy link
Contributor

@warrensplayer warrensplayer left a comment

Choose a reason for hiding this comment

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

Just one minor nit-pick

packages/app/src/debug/DebugPageHeader.vue Outdated Show resolved Hide resolved
import type { DebugResultsFragment } from '../generated/graphql'
import { gql } from '@urql/core'
import FailedSolidIcon from '~icons/cy/status-failed-solid_x24.svg'
import ResultCounts from '@packages/frontend-shared/src/components/ResultCounts.vue'
Copy link
Contributor

Choose a reason for hiding this comment

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

@lmiller1990 The ResultsCounts is an existing component that was just getting reused here with a minor addition. I do agree that it is only used in app so does not need to be in frontend-shared, but we can refactor that another time.

Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Looks good, left one last comment but not a blocker.

packages/app/src/debug/DebugPageHeader.cy.tsx Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPageHeader.cy.tsx Outdated Show resolved Hide resolved
import type { DebugResultsFragment } from '../generated/graphql'
import { gql } from '@urql/core'
import FailedSolidIcon from '~icons/cy/status-failed-solid_x24.svg'
import ResultCounts from '@packages/frontend-shared/src/components/ResultCounts.vue'
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me

@lmiller1990
Copy link
Contributor

Updating the feature branch and merging it in here, should fix CI. I'll merge once this is green.

@lmiller1990
Copy link
Contributor

Looks like we have a CI failure - re-ran but still failing, want to take a look @amehta265? https://app.circleci.com/pipelines/github/cypress-io/cypress/46041/workflows/a86994bb-0f07-454a-bfaf-60c6048476a0/jobs/1936007/tests#failed-test-0

@lmiller1990
Copy link
Contributor

Actually @amehta265 it might be flake, see #24575
If you want to verify it passes locally, I'd recommending pushing a commit to skip this and reference #24575 so we can fix it next sprint.

@amehta265 amehta265 merged commit 5d44df4 into feature/IATR-M0 Nov 22, 2022
@amehta265 amehta265 deleted the ankit/IATR-M0-debugPageHeader branch November 22, 2022 14:45
@warrensplayer warrensplayer mentioned this pull request Dec 8, 2022
1 task
warrensplayer pushed a commit that referenced this pull request Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants