Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
das-en opened this issue Jun 8, 2022 · 2 comments · Fixed by #3940
Closed

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

das-en opened this issue Jun 8, 2022 · 2 comments · Fixed by #3940

Comments

@das-en
Copy link

das-en commented Jun 8, 2022

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
    },
  },
@imdedios
Copy link

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

@kobenguyent
Copy link
Collaborator

kobenguyent commented Oct 20, 2023

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 #3940 which is more convenient to enable all plugin at once -p all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants