{"record":{"id":"6f933d781fccf2ed","repo":"juspay/hyperswitch","slug":"createauthenticationprocessorconnectortest-profil","errorCode":null,"errorMessage":"createAuthenticationProcessorConnectorTest: profile_id is not available in globalState (key: ${profilePrefix}Id). Ensure the AccountCreate prereq has completed successfully.","messagePattern":"createAuthenticationProcessorConnectorTest: profile_id is not available in globalState \\(key: (.+?)Id\\)\\. Ensure the AccountCreate prereq has completed successfully\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cypress-tests/cypress/support/commands.js","lineNumber":1815,"sourceCode":");\n\nCypress.Commands.add(\n  \"createAuthenticationProcessorConnectorTest\",\n  (\n    createConnectorBody,\n    globalState,\n    profilePrefix = \"profile\",\n    mcaPrefix = \"authProcessorConnector\",\n    expectedStatus = 200\n  ) => {\n    const apiKey = globalState.get(\"apiKey\");\n    const baseUrl = globalState.get(\"baseUrl\");\n    const merchantId = globalState.get(\"merchantId\");\n    const profileId = globalState.get(`${profilePrefix}Id`);\n    const url = `${baseUrl}/account/${merchantId}/connectors`;\n\n    if (!profileId) {\n      throw new Error(\n        `createAuthenticationProcessorConnectorTest: profile_id is not available in globalState (key: ${profilePrefix}Id). Ensure the AccountCreate prereq has completed successfully.`\n      );\n    }\n\n    createConnectorBody.connector_type = \"authentication_processor\";\n    createConnectorBody.profile_id = profileId;\n\n    cy.readFile(globalState.get(\"connectorAuthFilePath\")).then(\n      (jsonContent) => {\n        const { authDetails } = getValueByKey(\n          JSON.stringify(jsonContent),\n          createConnectorBody.connector_name\n        );\n\n        if (authDetails && authDetails.connector_account_details) {\n          createConnectorBody.connector_account_details =\n            authDetails.connector_account_details;\n        }","sourceCodeStart":1797,"sourceCodeEnd":1833,"githubUrl":"https://github.com/juspay/hyperswitch/blob/9b8b89dc378b62c9a6feda647bad4719d2de7699/cypress-tests/cypress/support/commands.js#L1797-L1833","documentation":"Thrown synchronously — before any HTTP call — by the createAuthenticationProcessorConnectorTest command (cypress-tests/cypress/support/commands.js:1815) when globalState.get(`${profilePrefix}Id`) is falsy. It is a prerequisite guard: creating an authentication_processor connector requires a profile_id that an earlier business-profile creation step must have stored under the same prefix.","triggerScenarios":"Invoking the command before the matching createBusinessProfileTest step; passing a custom profilePrefix (e.g. 'authProfile') whose profile was never created; the earlier create step being skipped (TRIGGER_SKIP) or failing so `${prefix}Id` was never set.","commonSituations":"Spec reordering, or running a single test with .only so setup is skipped; copy-pasting the command with a new prefix without adding the corresponding create step; globally skipped prerequisites due to config flags.","solutions":["Run the prerequisite first: cy.createBusinessProfileTest(profileBody, globalState, profilePrefix) with the SAME prefix","If the profile step was skipped by config (TRIGGER_SKIP), un-skip it or pre-seed the state","Dump globalState to see which `${prefix}Id` keys actually exist","Remember the default prefix is 'profile' — either create that profile or pass your custom prefix consistently"],"exampleFix":"// before — auth-processor connector without its profile\ncy.createAuthenticationProcessorConnectorTest(body, globalState, 'authProfile');\n// after — create the namespaced profile first\ncy.createBusinessProfileTest(profileBody, globalState, 'authProfile');\ncy.createAuthenticationProcessorConnectorTest(body, globalState, 'authProfile');","handlingStrategy":"validation","validationCode":"const profileId = globalState.get(`${profilePrefix}Id`);\nif (!profileId) {\n  throw new Error(`Prereq missing: create a business profile with prefix '${profilePrefix}' before this step`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Group setup and dependent step in one it() block so .only cannot split them","Namespace profile prefixes deliberately and document each pairing","Check for TRIGGER_SKIP config that silently skipped the prerequisite"],"tags":["cypress","hyperswitch","prerequisites","global-state","ordering"],"backgroundTag":null,"analyzedSha":"9b8b89dc378b62c9a6feda647bad4719d2de7699","analyzedAt":"2026-08-16T09:01:53.433Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}