From 150b04cbe55c06da88d3487683352d594ad2b4e7 Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Thu, 24 Aug 2023 19:36:24 -0400 Subject: [PATCH] chore: add v13 welcome page content (#27549) * feat: add v13 splash page content (wip) chore: add video link for v13 inside graphql context and root resolver. add migration tests outside of migration manager and update component tests to test aspects chore: update copy to most recent. Needs onlink deployments chore: opt for named slot in major version welcome as we still want to show the changes whether or not the video is present chore: fix video margin by shrinking the margin for a more appealing loadout chore: update onlinks for what is expected in deploy chore: adjust margins around video, move video up, and reduce margin on major welcome title chore: bump release date to 8/29 chore: update stubbed query to reference actual video * Update packages/launchpad/src/migration/MajorVersionWelcome.vue Co-authored-by: Mark Noonan * Update packages/launchpad/src/migration/MajorVersionWelcome.vue Co-authored-by: Mark Noonan * chore: update code elements to be inlinecodefragments * chore: update utm links to reflect correct nomenclature * stub migration src in network performance launchpad test on video as abortcontroller is difficult to test with current ctx setup --------- Co-authored-by: Mark Noonan --- .../data-context/src/data/coreDataShape.ts | 2 + .../src/sources/MigrationDataSource.ts | 31 +++++ .../support/mock-graphql/stubgql-Query.ts | 9 ++ packages/graphql/schemas/schema.graphql | 3 + .../src/schemaTypes/objectTypes/gql-Query.ts | 11 ++ .../launchpad/cypress/e2e/migration.cy.ts | 66 +++++++++++ .../launchpad/cypress/e2e/slow-network.cy.ts | 14 ++- packages/launchpad/src/Main.vue | 21 +++- .../src/migration/MajorVersionWelcome.cy.tsx | 26 ++--- .../src/migration/MajorVersionWelcome.vue | 106 ++++++++++-------- packages/types/src/constants.ts | 2 +- .../migration-v12-to-v13/cypress.config.js | 10 ++ .../cypress/e2e/spec.cy.js | 5 + 13 files changed, 244 insertions(+), 62 deletions(-) create mode 100644 system-tests/projects/migration-v12-to-v13/cypress.config.js create mode 100644 system-tests/projects/migration-v12-to-v13/cypress/e2e/spec.cy.js diff --git a/packages/data-context/src/data/coreDataShape.ts b/packages/data-context/src/data/coreDataShape.ts index 85d766a8f0f7..14e1e9e9a18e 100644 --- a/packages/data-context/src/data/coreDataShape.ts +++ b/packages/data-context/src/data/coreDataShape.ts @@ -79,6 +79,7 @@ export interface WizardDataShape { export interface MigrationDataShape { // TODO: have the model of migration here step: MigrationStep + videoEmbedHtml: string | null legacyConfigForMigration?: LegacyCypressConfigJson | null filteredSteps: MigrationStep[] flags: { @@ -214,6 +215,7 @@ export function makeCoreData (modeOptions: Partial = {}): CoreDa }, migration: { step: 'renameAuto', + videoEmbedHtml: null, legacyConfigForMigration: null, filteredSteps: [...MIGRATION_STEPS], flags: { diff --git a/packages/data-context/src/sources/MigrationDataSource.ts b/packages/data-context/src/sources/MigrationDataSource.ts index 0d2d67790aa3..a5c00f14b086 100644 --- a/packages/data-context/src/sources/MigrationDataSource.ts +++ b/packages/data-context/src/sources/MigrationDataSource.ts @@ -96,6 +96,37 @@ export class MigrationDataSource { return this.ctx.lifecycleManager.metaState.needsCypressJsonMigration && Boolean(legacyConfigFileExists) } + async getVideoEmbedHtml () { + if (this.ctx.coreData.migration.videoEmbedHtml) { + return this.ctx.coreData.migration.videoEmbedHtml + } + + const versionData = await this.ctx.versions.versionData() + const embedOnLink = `https://on.cypress.io/v13-video-embed/${versionData.current.version}` + + debug(`Getting videoEmbedHtml at link: ${embedOnLink}`) + + // Time out request if it takes longer than 3 seconds + const controller = new AbortController() + const timeoutId = setTimeout(() => controller.abort(), 3000) + + try { + const response = await this.ctx.util.fetch(embedOnLink, { method: 'GET', signal: controller.signal }) + const { videoHtml } = await response.json() + + this.ctx.update((d) => { + d.migration.videoEmbedHtml = videoHtml + }) + + return videoHtml + } catch { + // fail silently, no user-facing error is needed + return null + } finally { + clearTimeout(timeoutId) + } + } + async getComponentTestingMigrationStatus () { debug('getComponentTestingMigrationStatus: start') if (!this.legacyConfig || !this.ctx.currentProject) { diff --git a/packages/frontend-shared/cypress/support/mock-graphql/stubgql-Query.ts b/packages/frontend-shared/cypress/support/mock-graphql/stubgql-Query.ts index 14dabf0b80a0..4f242eefcb51 100644 --- a/packages/frontend-shared/cypress/support/mock-graphql/stubgql-Query.ts +++ b/packages/frontend-shared/cypress/support/mock-graphql/stubgql-Query.ts @@ -43,4 +43,13 @@ export const stubQuery: MaybeResolver = { scaffoldedFiles () { return null }, + videoEmbedHtml () { + return `