diff --git a/npm/create-cypress-tests/scripts/example.js b/npm/create-cypress-tests/scripts/example.js index 49b35fd7ee..0925901447 100644 --- a/npm/create-cypress-tests/scripts/example.js +++ b/npm/create-cypress-tests/scripts/example.js @@ -13,9 +13,13 @@ program await fs.remove(destinationPath) await fs.copy(exampleFolder, destinationPath, { recursive: true }) - console.log(`✅ Example was successfully created at ${chalk.cyan(destination)}`) + console.log(`✅ E2E Examples were successfully created at ${chalk.cyan(destination)}`) - await fs.copy(path.join(__dirname, 'example-tsconfig.json'), path.join(destination, 'tsconfig.json')) + await fs.copy(path.join(__dirname, 'examples', 'cypress'), path.join(destination)) + + console.log(`✅ Cypress Setup was successfully created at ${chalk.cyan(destination)}`) + + await fs.copy(path.join(__dirname, 'examples', 'tsconfig.json'), path.join(destination, 'tsconfig.json')) console.log(`✅ tsconfig.json was created for ${chalk.cyan(destination)}`) }) diff --git a/packages/example/cypress/fixtures/example.json b/npm/create-cypress-tests/scripts/examples/cypress/fixtures/example.json similarity index 100% rename from packages/example/cypress/fixtures/example.json rename to npm/create-cypress-tests/scripts/examples/cypress/fixtures/example.json diff --git a/packages/example/cypress/support/commands.js b/npm/create-cypress-tests/scripts/examples/cypress/support/commands.js similarity index 100% rename from packages/example/cypress/support/commands.js rename to npm/create-cypress-tests/scripts/examples/cypress/support/commands.js diff --git a/npm/create-cypress-tests/scripts/examples/cypress/support/component.js b/npm/create-cypress-tests/scripts/examples/cypress/support/component.js new file mode 100644 index 0000000000..5e450a7b1a --- /dev/null +++ b/npm/create-cypress-tests/scripts/examples/cypress/support/component.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/component.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/npm/create-cypress-tests/scripts/examples/cypress/support/e2e.js b/npm/create-cypress-tests/scripts/examples/cypress/support/e2e.js new file mode 100644 index 0000000000..d1dd1353e8 --- /dev/null +++ b/npm/create-cypress-tests/scripts/examples/cypress/support/e2e.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/e2e.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/npm/create-cypress-tests/scripts/example-tsconfig.json b/npm/create-cypress-tests/scripts/examples/tsconfig.json similarity index 100% rename from npm/create-cypress-tests/scripts/example-tsconfig.json rename to npm/create-cypress-tests/scripts/examples/tsconfig.json diff --git a/packages/app/cypress/e2e/specs.cy.ts b/packages/app/cypress/e2e/specs.cy.ts index de73e4a280..e7a192bd9c 100644 --- a/packages/app/cypress/e2e/specs.cy.ts +++ b/packages/app/cypress/e2e/specs.cy.ts @@ -81,11 +81,13 @@ describe('App: Specs', () => { 'cypress_api', 'files', 'location', + 'misc', 'navigation', 'network_requests', 'querying', 'spies_stubs_clocks', 'storage', + 'traversal', 'utilities', 'viewport', 'waiting', @@ -114,10 +116,7 @@ describe('App: Specs', () => { additionalIgnorePattern: [], })).map((spec) => spec.relative) - // Validate that all expected paths have been generated within the data context - expect(generatedSpecPaths.filter((path) => { - return options.expectedScaffoldPathsForPlatform.includes(path) - })).to.have.lengthOf(options.expectedScaffoldPathsForPlatform.length) + expect(generatedSpecPaths).to.include.members(options.expectedScaffoldPathsForPlatform) }, { expectedScaffoldPathsForPlatform }) // cy.percySnapshot() // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 diff --git a/packages/app/src/specs/generators/scaffold/ScaffoldGeneratorStepOne.vue b/packages/app/src/specs/generators/scaffold/ScaffoldGeneratorStepOne.vue index 548519c60d..70b776d097 100644 --- a/packages/app/src/specs/generators/scaffold/ScaffoldGeneratorStepOne.vue +++ b/packages/app/src/specs/generators/scaffold/ScaffoldGeneratorStepOne.vue @@ -56,7 +56,7 @@