Skip to content

Cucumber profile configuration not working with default wrapper #8

@deepracticexs

Description

@deepracticexs

Problem

When using --profile dev with cucumber-js, it fails with error:

Error: Requested profile "dev" doesn't exist

Configuration Structure

Current cucumber.cjs:

const baseConfig = require("@deepracticex/cucumber-config");

module.exports = {
  default: {
    ...baseConfig,
    paths: ["features/**/*.feature"],
    import: ["tests/e2e/**/*.steps.ts", "tests/e2e/support/**/*.ts"],
  },
};

Where baseConfig contains:

{
  formatOptions: { snippetInterface: "async-await" },
  format: [...],
  parallel: 2,
  profiles: {
    dev: { format: [...], parallel: 1, failFast: true },
    ci: { format: [...], parallel: 4, retry: 1 }
  }
}

Issue

The profiles from baseConfig are nested under default, so cucumber looks for default.profiles.dev but the actual structure becomes:

{
  default: {
    profiles: {
      dev: {...}
    }
  }
}

This makes profiles inaccessible when using --profile dev flag.

Workaround

Running tests without profile works:

pnpm test  # Works
pnpm test:dev --profile dev  # Fails

Affected Packages

  • apps/cli
  • packages/logger

Expected Behavior

Profiles should be accessible when specified with --profile flag, similar to how it works in standard cucumber configurations.

Potential Solutions

  1. Move profiles to top level outside of default wrapper
  2. Find correct cucumber configuration structure for profiles with default wrapper
  3. Update baseConfig to export profiles separately

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions