Skip to content

[WIP] Dry-run mode #1825

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

Merged
merged 6 commits into from
Aug 15, 2019
Merged

[WIP] Dry-run mode #1825

merged 6 commits into from
Aug 15, 2019

Conversation

DavertMik
Copy link
Contributor

@DavertMik DavertMik commented Aug 4, 2019

In this mode, you can print tests output with no commands actually being executed.
This mode disables all helpers and plugins but preserves all events and console output, so you can easily see what all tests are doing, and validate your tests before running them completely

Usage

npx codeceptjs dry-run

OUTPUT

Screenshot from 2019-08-06 02-44-30

When passed --steps or --debug option runs tests, disabling all plugins and helpers, so you can get step-by-step report with no tests actually executed.

npx codeceptjs dry-run --steps

If a plugin needs to be enabled in dry-run mode, pass its name in -p option:

npx codeceptjs dry-run --steps -p allure

OUTPUT

Screenshot from 2019-08-05 12-04-51

@pablopaul
Copy link
Collaborator

@DavertMik what is the use case for dry mode?

@DavertMik
Copy link
Contributor Author

@pablopaul Use cases:

  • To print all test scenarios in a human-readable format on a screen
  • Create reports for tests without running them
  • Check actual steps will be executed when a test will be run.
  • Dry run mode can also be used as validator for JS tests (validate all tests before running them), however, it has limitations working with grep* so I'm not sure about this use-case. However, if all custom code is stored in helpers and not used in tests, such validation will pass

@DavertMik
Copy link
Contributor Author

Btw, the similar PR for mocha was never merged mochajs/mocha#1070

@codeceptjs codeceptjs deleted a comment Aug 6, 2019
@codeceptjs codeceptjs deleted a comment Aug 6, 2019
@codeceptjs codeceptjs deleted a comment Aug 10, 2019
@codeceptjs codeceptjs deleted a comment Aug 10, 2019
@DavertMik DavertMik merged commit f5175cb into master Aug 15, 2019
@DavertMik DavertMik deleted the dry-run branch August 15, 2019 02:37
To enable bootstrap script in dry-run mode, pass in `--bootstrap` option when running with `--steps` or `--debug`

```
nox codeceptjs dry-run --steps --bootstrap

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx instead of nox

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thank you. Could you make a pull request fixing this?

Copy link

@nabeelharri nabeelharri Oct 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, pull request created.

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 this pull request may close these issues.

3 participants