From 0e239bf2108b6a80c0d4a5a4c017b77568101549 Mon Sep 17 00:00:00 2001 From: Dave Kasper Date: Thu, 14 Sep 2023 16:35:12 -0500 Subject: [PATCH] feat(app): Update Runs page visuals to new layout and card design (#27770) * basic card visuals, working on click * visual tweaks and i18n * match other i18n * redo duration format, should make common too * basic debug, needs validation of relevant run * refactor and move files * working top level state * working grouping, needs subcomponent * switch click target * remove dayjs change * fix current commit * revise commit for message * working view runs button * fix type check * fix tests * fix integration tests * remove old test * add layout * add component test for new layout and cleanup * add count check * standardize cy tags * revise count test * fix typos * fix padding * start wrapping * happy wrap, next trunc * responsive if wonky * clean up and titles * magic resize, needs tests per breakpoint * standardize the rollup * working default rollup * rollup spacing tweaks * center elements * update tests for multiple viewports * add missing breakpoint tests * fix debug tests for status and badge * remove unneeded check * add functional component * fix check_ts * update container test * add changelog * add tooltip, needs aria label and external link update * fix overflow * fix avatar and add aria label to count summary * change to external href * remove popup sizing * add tests * add missing data cy * fix runcard test * Truncate result count * make truncate style conditional * match design truncate position * adddress PR comments * chore:updating styles (#27798) * add tooltip content tests and skeletons * clean up tooltip validation * fix runs selector * Update packages/app/src/runs/RunsSkeletonRow.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunTagCount.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunsSkeleton.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunTagCount.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunsSkeleton.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunsSkeletonRow.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunTagCount.vue Co-authored-by: Stokes Player * Update packages/app/src/runs/RunTagCount.vue Co-authored-by: Stokes Player * remove redundant shrink-1s * more shrinks --------- Co-authored-by: Stokes Player --- cli/CHANGELOG.md | 8 + packages/app/cypress/e2e/debug.cy.ts | 4 +- packages/app/cypress/e2e/runs.cy.ts | 53 ++-- packages/app/package.json | 2 +- packages/app/src/debug/DebugPageHeader.cy.tsx | 8 +- packages/app/src/debug/DebugPageHeader.vue | 12 +- packages/app/src/debug/DebugResults.cy.tsx | 51 --- packages/app/src/debug/DebugResults.vue | 59 ---- packages/app/src/debug/DebugRunNavigation.vue | 10 +- .../app/src/debug/DebugRunNavigationRow.vue | 10 +- packages/app/src/debug/DebugRunNumber.cy.tsx | 14 - packages/app/src/debug/DebugRunNumber.vue | 45 --- packages/app/src/debug/StatsMetadata.vue | 5 +- packages/app/src/pages/Runs.vue | 9 +- packages/app/src/runs/RunCard.cy.tsx | 194 ++++++++---- packages/app/src/runs/RunCard.vue | 290 +++++++++++++----- packages/app/src/runs/RunNumber.cy.tsx | 34 ++ packages/app/src/runs/RunNumber.vue | 58 ++++ packages/app/src/runs/RunResults.cy.tsx | 57 +++- packages/app/src/runs/RunResults.vue | 43 ++- packages/app/src/runs/RunTag.cy.tsx | 37 +++ packages/app/src/runs/RunTag.vue | 34 ++ packages/app/src/runs/RunTagCount.cy.tsx | 81 +++++ packages/app/src/runs/RunTagCount.vue | 126 ++++++++ packages/app/src/runs/RunsComposable.ts | 2 + packages/app/src/runs/RunsContainer.cy.tsx | 5 +- packages/app/src/runs/RunsContainer.vue | 31 +- packages/app/src/runs/RunsLayout.cy.tsx | 171 +++++++++++ packages/app/src/runs/RunsLayout.vue | 157 ++++++++++ packages/app/src/runs/RunsSkeleton.cy.tsx | 10 +- packages/app/src/runs/RunsSkeleton.vue | 90 ++++-- packages/app/src/runs/RunsSkeletonRow.cy.tsx | 7 + packages/app/src/runs/RunsSkeletonRow.vue | 39 +++ packages/app/src/runs/useGitTreeRuns.ts | 11 + packages/app/src/runs/useProjectRuns.ts | 1 + .../src/sources/RelevantRunsDataSource.ts | 2 +- .../src/components/ResultCounts.vue | 1 + .../frontend-shared/src/locales/en-US.json | 12 + packages/graphql/schemas/schema.graphql | 2 +- .../schemaTypes/objectTypes/gql-Mutation.ts | 5 +- yarn.lock | 16 +- 41 files changed, 1378 insertions(+), 428 deletions(-) delete mode 100644 packages/app/src/debug/DebugResults.cy.tsx delete mode 100644 packages/app/src/debug/DebugResults.vue delete mode 100644 packages/app/src/debug/DebugRunNumber.cy.tsx delete mode 100644 packages/app/src/debug/DebugRunNumber.vue create mode 100644 packages/app/src/runs/RunNumber.cy.tsx create mode 100644 packages/app/src/runs/RunNumber.vue create mode 100644 packages/app/src/runs/RunTag.cy.tsx create mode 100644 packages/app/src/runs/RunTag.vue create mode 100644 packages/app/src/runs/RunTagCount.cy.tsx create mode 100644 packages/app/src/runs/RunTagCount.vue create mode 100644 packages/app/src/runs/RunsLayout.cy.tsx create mode 100644 packages/app/src/runs/RunsLayout.vue create mode 100644 packages/app/src/runs/RunsSkeletonRow.cy.tsx create mode 100644 packages/app/src/runs/RunsSkeletonRow.vue diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index d413af3445ba..6418a505b6e8 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,4 +1,12 @@ +## 13.3.0 + +_Released 09/19/2023 (PENDING)_ + +**Features:** + + - Introduces new layout for Runs page providing additional run information. Addresses [#27203](https://github.com/cypress-io/cypress/issues/27203). + ## 13.2.0 _Released 09/12/2023_ diff --git a/packages/app/cypress/e2e/debug.cy.ts b/packages/app/cypress/e2e/debug.cy.ts index a5252b99eb56..c2c39129028b 100644 --- a/packages/app/cypress/e2e/debug.cy.ts +++ b/packages/app/cypress/e2e/debug.cy.ts @@ -75,7 +75,7 @@ describe('App - Debug Page', () => { .contains('View in Cypress Cloud') .should('have.attr', 'href', 'https://cloud.cypress.io/projects/7p5uce/runs/2?utm_medium=Debug+Tab&utm_campaign=View+in+Cypress+Cloud&utm_source=Binary%3A+App') - cy.findByTestId('debug-runNumber-PASSED').contains('#2') + cy.findByTestId('runNumber-status-PASSED').contains('#2') cy.findByTestId('debug-commitsAhead').contains('You are 1 commit ahead') cy.findByTestId('metadata').within(() => { @@ -136,7 +136,7 @@ describe('App - Debug Page', () => { cy.findByLabelText('Relevant run had 1 test failure').should('be.visible').contains('1') - cy.findByTestId('debug-runNumber-FAILED').contains('#136') + cy.findByTestId('runNumber-status-FAILED').contains('#136') cy.findByTestId('debug-commitsAhead').contains('You are 1 commit ahead') cy.findByTestId('metadata').within(() => { diff --git a/packages/app/cypress/e2e/runs.cy.ts b/packages/app/cypress/e2e/runs.cy.ts index d89a684b872d..5e6efb766d58 100644 --- a/packages/app/cypress/e2e/runs.cy.ts +++ b/packages/app/cypress/e2e/runs.cy.ts @@ -60,7 +60,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { cy.visitApp() cy.findByTestId('sidebar-link-runs-page').click() - cy.get('[data-cy="runs-loader"]') + cy.get('[data-cy*="runsSkeleton-"]') cy.get('[data-cy="runs"]') }) }) @@ -103,7 +103,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { cy.visitApp() moveToRunsPage() - cy.contains('a', 'OVERLIMIT').click() + cy.findByTestId('runNumber-status-OVERLIMIT').click() cy.withCtx((ctx, o) => { expect((ctx.actions.electron.openExternal as SinonStub).lastCall.lastArg).to.contain('http://dummy.cypress.io/runs/4') @@ -666,29 +666,25 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { cy.visitApp() moveToRunsPage() - cy.get('[href^="http://dummy.cypress.io/runs/0"]').first().within(() => { - cy.findByText('fix: make gql work CANCELLED') - cy.get('[data-cy="run-card-icon-CANCELLED"]') + cy.get('[data-cy="runCard-status-CANCELLED"]').first().within(() => { + cy.get('[data-cy="runNumber-status-CANCELLED"]') }) - cy.get('[href^="http://dummy.cypress.io/runs/1"]').first().within(() => { - cy.findByText('fix: make gql work ERRORED') - cy.get('[data-cy="run-card-icon-ERRORED"]') + cy.get('[data-cy="runCard-status-ERRORED"]').first().within(() => { + cy.get('[data-cy="runNumber-status-ERRORED"]') }) - cy.get('[href^="http://dummy.cypress.io/runs/2"]').first().within(() => { - cy.findByText('fix: make gql work FAILED') - cy.get('[data-cy="run-card-icon-FAILED"]') + cy.get('[data-cy="runCard-status-FAILED"]').first().within(() => { + cy.get('[data-cy="runNumber-status-FAILED"]') }) - cy.get('[href^="http://dummy.cypress.io/runs/0"]').first().as('firstRun') + cy.get('[data-cy="runCard-status-CANCELLED"]').first().as('firstRun') cy.get('@firstRun').within(() => { - cy.get('[data-cy="run-card-author"]').contains('John Appleseed') - cy.get('[data-cy="run-card-avatar"]') - cy.get('[data-cy="run-card-branch"]').contains('main') - cy.get('[data-cy="run-card-created-at"]').contains('an hour ago') - cy.get('[data-cy="run-card-duration"]').contains('01:00') + cy.get('[data-cy="runCard-author"]').contains('John Appleseed') + cy.get('[data-cy="runCard-avatar"]') + cy.get('[data-cy="runCard-branchName"]').contains('main') + cy.get('[data-cy="runCard-createdAt"]').contains('01m 00s (an hour ago)') cy.contains('span', 'skipped') cy.get('span').contains('pending') @@ -702,7 +698,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { cy.visitApp() moveToRunsPage() - cy.get('[data-cy^="runCard-"]').first().click() + cy.get('[data-cy="runNumber-status-CANCELLED"]').first().click() cy.withCtx((ctx) => { expect((ctx.actions.electron.openExternal as SinonStub).lastCall.lastArg).to.contain('http://dummy.cypress.io/runs/0') @@ -765,19 +761,18 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { cy.visitApp() moveToRunsPage() + cy.findByText('fix: using Git data CANCELLED') cy.get('[href^="http://dummy.cypress.io/runs/0"]').first().within(() => { - cy.findByText('fix: using Git data CANCELLED') - cy.get('[data-cy="run-card-icon-CANCELLED"]') + cy.get('[data-cy="runNumber-status-CANCELLED"]') }) - cy.get('[href^="http://dummy.cypress.io/runs/0"]').first().as('firstRun') + cy.get('[data-cy="runCard-status-CANCELLED"]').first().as('firstRun') cy.get('@firstRun').within(() => { - cy.get('[data-cy="run-card-author"]').contains('John Appleseed') - cy.get('[data-cy="run-card-avatar"]') - cy.get('[data-cy="run-card-branch"]').contains('main') - cy.get('[data-cy="run-card-created-at"]').contains('an hour ago') - cy.get('[data-cy="run-card-duration"]').contains('01:00') + cy.get('[data-cy="runCard-author"]').contains('John Appleseed') + cy.get('[data-cy="runCard-avatar"]') + cy.get('[data-cy="runCard-branchName"]').contains('main') + cy.get('[data-cy="runCard-createdAt"]').contains('01m 00s (an hour ago)') cy.contains('span', 'skipped') cy.get('span').contains('pending') @@ -791,7 +786,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { cy.visitApp() moveToRunsPage() - cy.get('[data-cy^="runCard-"]').first().click() + cy.get('[data-cy="runNumber-status-CANCELLED"]').first().click() cy.withCtx((ctx) => { expect((ctx.actions.electron.openExternal as SinonStub).lastCall.lastArg).to.contain('http://dummy.cypress.io/runs/0') @@ -955,7 +950,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { const itSkipIfWindows = Cypress.platform === 'win32' ? it.skip : it itSkipIfWindows('should re-query for executing runs', () => { - cy.get('[data-cy="run-card-icon-RUNNING"]').should('have.length', RUNNING_COUNT).should('be.visible') + cy.get('[data-cy="runNumber-status-RUNNING"]').should('have.length', RUNNING_COUNT).should('be.visible') cy.remoteGraphQLIntercept(async (obj) => { await new Promise((resolve) => setTimeout(resolve, 100)) @@ -976,7 +971,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => { }) function completeNext (passed) { - cy.get('[data-cy="run-card-icon-PASSED"]').should('have.length', passed).should('be.visible') + cy.get('[data-cy="runNumber-status-PASSED"]').should('have.length', passed).should('be.visible') if (passed < RUNNING_COUNT) { completeNext(passed + 1) } diff --git a/packages/app/package.json b/packages/app/package.json index c4a45f225676..e2c9505defcf 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -21,7 +21,7 @@ "dependencies": {}, "devDependencies": { "@cypress-design/vue-button": "^0.10.1", - "@cypress-design/vue-icon": "^0.25.0", + "@cypress-design/vue-icon": "^0.26.0", "@cypress-design/vue-statusicon": "^0.5.0", "@cypress-design/vue-tabs": "^0.5.1", "@graphql-typed-document-node/core": "^3.1.0", diff --git a/packages/app/src/debug/DebugPageHeader.cy.tsx b/packages/app/src/debug/DebugPageHeader.cy.tsx index 20a5b574ebb2..b5de9ddd2260 100644 --- a/packages/app/src/debug/DebugPageHeader.cy.tsx +++ b/packages/app/src/debug/DebugPageHeader.cy.tsx @@ -43,11 +43,11 @@ describe('', { cy.findByTestId('debug-results').should('be.visible') - cy.findByTestId('debug-runNumber-FAILED') + cy.findByTestId('runNumber-status-FAILED') .should('have.text', '#432') .children().should('have.length', 2) - cy.findByTestId('debug-flaky-badge') + cy.findByTestId('runResults-flakyBadge') .should('not.exist') defaults.forEach((obj) => { @@ -73,7 +73,7 @@ describe('', { }, }) - cy.findByTestId('debug-flaky-badge') + cy.findByTestId('runResults-flakyBadge') .contains(defaultMessages.specPage.flaky.badgeLabel) cy.findByTestId('total-flaky-tests') @@ -97,7 +97,7 @@ describe('', { }, }) - cy.findByTestId(`debug-runNumber-${status}`).should('be.visible') + cy.findByTestId(`runNumber-status-${status}`).should('be.visible') }) }) diff --git a/packages/app/src/debug/DebugPageHeader.vue b/packages/app/src/debug/DebugPageHeader.vue index 020eaffac4be..ee5f734d598b 100644 --- a/packages/app/src/debug/DebugPageHeader.vue +++ b/packages/app/src/debug/DebugPageHeader.vue @@ -51,12 +51,12 @@
  • - - @@ -92,7 +92,7 @@ v-if="debug.createdAt" data-cy="debug-header-createdAt" > - diff --git a/packages/app/src/debug/DebugRunNavigation.vue b/packages/app/src/debug/DebugRunNavigation.vue index ff2a1c4a260f..7bd9be4e92d2 100644 --- a/packages/app/src/debug/DebugRunNavigation.vue +++ b/packages/app/src/debug/DebugRunNavigation.vue @@ -38,12 +38,12 @@