juspay/hyperswitch · error · Error

createAuthenticationProcessorConnectorTest: profile_id is no

Error message

createAuthenticationProcessorConnectorTest: profile_id is not available in globalState (key: ${profilePrefix}Id). Ensure the AccountCreate prereq has completed successfully.

What it means

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.

Source

Thrown at cypress-tests/cypress/support/commands.js:1815

);

Cypress.Commands.add(
  "createAuthenticationProcessorConnectorTest",
  (
    createConnectorBody,
    globalState,
    profilePrefix = "profile",
    mcaPrefix = "authProcessorConnector",
    expectedStatus = 200
  ) => {
    const apiKey = globalState.get("apiKey");
    const baseUrl = globalState.get("baseUrl");
    const merchantId = globalState.get("merchantId");
    const profileId = globalState.get(`${profilePrefix}Id`);
    const url = `${baseUrl}/account/${merchantId}/connectors`;

    if (!profileId) {
      throw new Error(
        `createAuthenticationProcessorConnectorTest: profile_id is not available in globalState (key: ${profilePrefix}Id). Ensure the AccountCreate prereq has completed successfully.`
      );
    }

    createConnectorBody.connector_type = "authentication_processor";
    createConnectorBody.profile_id = profileId;

    cy.readFile(globalState.get("connectorAuthFilePath")).then(
      (jsonContent) => {
        const { authDetails } = getValueByKey(
          JSON.stringify(jsonContent),
          createConnectorBody.connector_name
        );

        if (authDetails && authDetails.connector_account_details) {
          createConnectorBody.connector_account_details =
            authDetails.connector_account_details;
        }

View on GitHub (pinned to 9b8b89dc37)

Solutions

  1. Run the prerequisite first: cy.createBusinessProfileTest(profileBody, globalState, profilePrefix) with the SAME prefix
  2. If the profile step was skipped by config (TRIGGER_SKIP), un-skip it or pre-seed the state
  3. Dump globalState to see which `${prefix}Id` keys actually exist
  4. Remember the default prefix is 'profile' — either create that profile or pass your custom prefix consistently

Example fix

// before — auth-processor connector without its profile
cy.createAuthenticationProcessorConnectorTest(body, globalState, 'authProfile');
// after — create the namespaced profile first
cy.createBusinessProfileTest(profileBody, globalState, 'authProfile');
cy.createAuthenticationProcessorConnectorTest(body, globalState, 'authProfile');
Defensive patterns

Strategy: validation

Validate before calling

const profileId = globalState.get(`${profilePrefix}Id`);
if (!profileId) {
  throw new Error(`Prereq missing: create a business profile with prefix '${profilePrefix}' before this step`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of juspay/hyperswitch@9b8b89dc37 (2026-08-16). Data as JSON: /api/errors/6f933d781fccf2ed. Report an issue: GitHub.