Skip to content

Can I import parametrized CodeceptJS tests?

Yes, you can import parametrized CodeceptJS tests, but the scenario name must be readable as plain text for the importer to recognize it. The import process scans your source code without executing it.

  • Use a template literal with the parameter as a placeholder:

    Data(kidsParameters).Scenario(
    ({ current }) => `Register kid ${current.name}`,
    async ({ I, current }) => { /* ... */ }
    );

    The test is imported with ${current.name} as a placeholder in the name, and the actual values appear in your run reports.

  • Avoid string concatenation, like 'Register ' + current.name.
  • Avoid values that only exist during test execution.

The importer cannot interpret these during a static scan.