CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

'dry-run' produces console errors for 'tryTo' instances

Open das-en opened this issue 3 years ago • 1 comments

What are you trying to achieve?

Export steps for BDD scenarios.

What do you get instead?

Tests run as expected, but 'dry-run' throws error for 'tryTo' instances.

Provide console output if related. Use --verbose mode for more details.

  Submit randomized answers @Smoke @CRUD @DB
    Given I am on the About You page 
  ✖ FAILED in 11ms


-- FAILURES:

  1) Submission
       Submit randomized answers @Smoke @CRUD @DB:
     tryTo is not defined

The step calls a function that uses tryTo: const result = await tryTo(() => I.see('This survey requires that your browser accept cookies from our web site.'));

Details

  • CodeceptJS version: 3.3.3
  • NodeJS Version: 16.14.2
  • Operating System: OSX 12.4
  • Playwright
  • Configuration file:
  plugins: {
    screenshotOnFail: {
      enabled: true
    },
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    },
    fakerTransform: {
      enabled: true
    },
  },

das-en avatar Jun 08 '22 21:06 das-en

I do not have a bdd approach and I am having the same error when executing dry-run

imdedios avatar Jun 14 '22 19:06 imdedios

By default, all plugins are disabled when running dry-run command, https://codecept.io/commands/#dry-run so that's why you got this error.

Please either enable the plugin by passing -p tryTo or wait for https://github.com/codeceptjs/CodeceptJS/pull/3940 which is more convenient to enable all plugin at once -p all

kobenguyent avatar Oct 20 '23 14:10 kobenguyent