From 75ec48cd801d96eb3ccfc6b35cf2207a40acfaa9 Mon Sep 17 00:00:00 2001 From: Cesar Avitia Date: Wed, 9 Feb 2022 18:01:07 -0700 Subject: [PATCH 1/5] fix ui issues --- .../__snapshots__/migration.spec.ts.js | 12 ++++++++++++ .../data-context/src/sources/migration/utils.ts | 6 +++++- packages/frontend-shared/src/locales/en-US.json | 15 ++++++++------- .../launchpad/src/migration/OptOutModalStep1.vue | 13 +++++++++++++ .../src/migration/RenameSpecsManual.vue | 16 ++++++++++++++-- .../src/migration/fragments/MigrationStep.vue | 3 ++- 6 files changed, 54 insertions(+), 11 deletions(-) diff --git a/packages/data-context/__snapshots__/migration.spec.ts.js b/packages/data-context/__snapshots__/migration.spec.ts.js index 6751a1d6058b..01889df8a6aa 100644 --- a/packages/data-context/__snapshots__/migration.spec.ts.js +++ b/packages/data-context/__snapshots__/migration.spec.ts.js @@ -4,6 +4,8 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ viewportWidth: 300, e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, @@ -17,6 +19,8 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, @@ -31,6 +35,8 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, @@ -45,6 +51,8 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ viewportWidth: 300, e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, @@ -60,6 +68,8 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, @@ -73,6 +83,8 @@ const { defineConfig } = require('cypress') module.exports = defineConfig({ e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./path/to/plugin/file')(on, config) }, diff --git a/packages/data-context/src/sources/migration/utils.ts b/packages/data-context/src/sources/migration/utils.ts index c22546e96976..cdec56483f6b 100644 --- a/packages/data-context/src/sources/migration/utils.ts +++ b/packages/data-context/src/sources/migration/utils.ts @@ -197,7 +197,9 @@ function formatObjectForConfig (obj: Record) { function createE2eTemplate (pluginPath: string, hasPluginsFile: boolean, options: Record) { const requirePlugins = `return require('.${path.sep}${pluginPath}')(on, config)` - const setupNodeEvents = `setupNodeEvents(on, config) { + const setupNodeEvents = `// We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { ${hasPluginsFile ? requirePlugins : ''} }` @@ -208,6 +210,8 @@ function createE2eTemplate (pluginPath: string, hasPluginsFile: boolean, options function createComponentTemplate (options: Record) { return `component: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. setupNodeEvents(on, config) {},${formatObjectForConfig(options)} },` } diff --git a/packages/frontend-shared/src/locales/en-US.json b/packages/frontend-shared/src/locales/en-US.json index 1d46ed47d3a2..e30f60bc51c5 100644 --- a/packages/frontend-shared/src/locales/en-US.json +++ b/packages/frontend-shared/src/locales/en-US.json @@ -496,7 +496,7 @@ "migration": { "before": "Before", "after": "After", - "heresWhy": "here's why", + "heresWhy": "here's why:", "renameAuto": { "title": "We'll automatically rename your specs in this step", "changeButton": "change", @@ -511,8 +511,9 @@ "line1": "Cypress now supports the ability to create new spec files from within the UI for both E2E and component specs.", "line2": "All new spec files created within Cypress will use the default pattern of: ", "line3": "We want to rename your existing specs so that they have a consistent filename pattern for both E2E and component testing.", - "line4": "We've changed the placement of component specs to be next to their source files (e.g. src/Button.jsx and src/Button.cy.jsx)", - "line5": "The new default pattern of {0} prevents targeting conflicts with other testing frameworks. (e.g. Jest)", + "line4": "All documentation and example code will be using: ", + "line5": "We've changed the placement of component specs to be next to their source files (e.g. src/Button.jsx and src/Button.cy.jsx)", + "line6": "The new default pattern of {0} prevents targeting conflicts with other testing frameworks. (e.g. Jest)", "buttonProceed": "I still want to change the spec file extension", "buttonCancel": "Cancel, keep the default extension" }, @@ -539,7 +540,7 @@ "changedSupportFile": "We've renamed the E2E support file from:" }, "configFile": { - "title": "We need to move the Cypress configuration file", + "title": "We need to migrate to the new Cypress configuration file", "changedDefault": "We've changed the default Cypress config file from:", "customOptions": "We've set a custom {specPattern} option based on your {options}.", "willConvert": "We'll automatically create a new {jsFile} file and seed it with your options from your existing {jsonFile}." @@ -555,13 +556,13 @@ "title": "Migration Helper", "description": "Complete the steps below to migrate your project to Cypress 10", "step1": { - "title": "Automatically rename existing specs", + "title": "Rename existing specs", "description": "In this step, we'll automatically rename and move your existing spec files.", "button": "Rename these specs for me", "buttonSkip": "Skip renaming specs" }, "step2": { - "title": "Manually move your existing component specs", + "title": "Move your existing component specs", "description": "In this step, you'll manually move your existing component specs to their new default location.", "buttonWait": "Waiting for you to move your component specs...", "buttonDone": "I have moved my component specs", @@ -573,7 +574,7 @@ "button": "Rename the support file for me" }, "step4": { - "title": "Automatically migrate the Cypress configuration file", + "title": "Migrate to the new Cypress configuration file", "description": "In this step, we'll automatically migrate your existing cypress configuration to the new Cypress configuration file.", "button": "Migrate the configuration for me" }, diff --git a/packages/launchpad/src/migration/OptOutModalStep1.vue b/packages/launchpad/src/migration/OptOutModalStep1.vue index 0bee5b998573..d47d513640b7 100644 --- a/packages/launchpad/src/migration/OptOutModalStep1.vue +++ b/packages/launchpad/src/migration/OptOutModalStep1.vue @@ -28,6 +28,9 @@ {{ t('migration.renameAuto.modals.step1.line4') }} + + [filename].cy.[ext] + + + + + [filename].cy.[ext] + + +