{"record":{"id":"72f6ef4b539543dd","repo":"cypress-io/cypress","slug":"testing-type-not-configured","errorCode":"TESTING_TYPE_NOT_CONFIGURED","errorMessage":"Input path matched specPattern for '${targetTestingType}' testing type, but it is not configured.","messagePattern":"Input path matched specPattern for '(.+?)' testing type, but it is not configured\\.","errorType":"error_code","errorClass":"RunSpecError","httpStatus":null,"severity":"error","filePath":"packages/data-context/src/actions/ProjectActions.ts","lineNumber":556,"sourceCode":"      } else {\n        throw new RunSpecError('NO_SPEC_PATTERN_MATCH', 'Unable to determine testing type, spec does not match any configured specPattern')\n      }\n\n      debug(`Spec %s matches '${targetTestingType}' pattern`, specPath)\n\n      debug('Attempting to launch spec %s', specPath)\n\n      // Look to see if there's actually a file at the target location\n      // This helps us avoid switching testingType *then* finding out the spec doesn't exist\n      if (!this.ctx.fs.existsSync(specPath)) {\n        throw new RunSpecError('SPEC_NOT_FOUND', `No file exists at path ${specPath}`)\n      }\n\n      // We now know what testingType we need to be in - if we're already there, great\n      // If not, verify that type is configured then switch (or throw an error if not configured)\n      if (this.ctx.coreData.currentTestingType !== targetTestingType) {\n        if (!this.ctx.lifecycleManager.isTestingTypeConfigured(targetTestingType)) {\n          throw new RunSpecError('TESTING_TYPE_NOT_CONFIGURED', `Input path matched specPattern for '${targetTestingType}' testing type, but it is not configured.`)\n        }\n\n        debug('Setting testing type to %s', targetTestingType)\n\n        const specChangeSubscription = this.ctx.emitter.subscribeTo('specsChange', { sendInitial: false })\n\n        const originalTestingType = this.ctx.coreData.currentTestingType\n\n        // Temporarily toggle testing type so the `activeBrowser` can be initialized\n        // for the targeted testing type. Browser has to be initialized prior to our \"relaunch\"\n        // call below - this can be an issue when Cypress is still on the launchpad and no\n        // browser has been launched yet\n        this.ctx.lifecycleManager.setCurrentTestingType(targetTestingType)\n        await this.ctx.lifecycleManager.setInitialActiveBrowser()\n        this.ctx.lifecycleManager.setCurrentTestingType(originalTestingType)\n\n        // This is the magic sauce - we now have a browser selected, so this will toggle\n        // the testing type, trigger specs to update, and launch the browser","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/packages/data-context/src/actions/ProjectActions.ts#L538-L574","documentation":"Thrown by ProjectActions.runSpec (ProjectActions.ts:554-557) with code TESTING_TYPE_NOT_CONFIGURED when the resolved targetTestingType differs from the current one AND lifecycleManager.isTestingTypeConfigured(targetTestingType) returns false. 'Configured' means the corresponding e2e or component block exists/is set up in cypress.config and onboarding for that type was completed. So the file matches the pattern (e.g. a component glob) but that testing type was never set up, blocking an automatic switch. Returned as { code: 'TESTING_TYPE_NOT_CONFIGURED', detailMessage }.","triggerScenarios":"Running a spec whose pattern maps to a testing type that is not configured — most commonly a component spec when only e2e was onboarded, or an e2e spec when only component testing was set up. The runSpec switch-and-relaunch path requires the target type to be configured first.","commonSituations":"User completed onboarding only for e2e, then tries to run a file that matches the component specPattern (or vice versa); a cypress.config that defines specPattern for a type but no top-level e2e/component configuration block; partial/failed onboarding; switching projects where the other testing type was never initialized.","solutions":["Complete onboarding for the target testing type: run `cypress open`, choose Component/E2E Testing, and let Cypress scaffold the config block.","Manually add the missing e2e {} or component {} configuration block to cypress.config.{js,ts} (including componentNameAndFilePathFunc/bundler settings for CT as needed).","Verify isTestingTypeConfigured returns true for the target type before calling runSpec (the launchpad should show the type as set up).","If you did not intend to run that testing type, check the specPattern — the file may be matching the wrong glob."],"exampleFix":"// before (cypress.config.ts) — only e2e configured, running a component spec\n// export default defineConfig({ e2e: { ... } })\n\n// after — add the component block and onboard\n// export default defineConfig({\n//   e2e: { ... },\n//   component: { specPattern: 'src/**/*.cy.{js,ts,jsx,tsx}', devServerConfig: { ... } }\n// })","handlingStrategy":"validation","validationCode":"// Confirm the target testing type is configured before runSpec\nconst targetTestingType: TestingType = /* derived from specPattern match */\n\nif (\n  ctx.coreData.currentTestingType !== targetTestingType &&\n  !ctx.lifecycleManager.isTestingTypeConfigured(targetTestingType)\n) {\n  // prompt the user to onboard that testing type; do not call runSpec yet\n  return\n}\nawait ctx.actions.runSpec({ specPath })","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Complete onboarding for each testing type you intend to run (e2e and component) via `cypress open`.","Ensure cypress.config defines both e2e {} and component {} blocks when mixing spec types.","Surface the 'testing type not configured' state in the launchpad so users onboard before running."],"tags":["runspec","testing-type","configuration","onboarding","component-testing"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}