8000
Skip to content

feat(core): silent and hidden activities for cleaner reports - #3394

Open
nbarrett wants to merge 1 commit into
serenity-js:mainfrom
nbarrett:feat/hidden-and-silent-activities
Open

feat(core): silent and hidden activities for cleaner reports#3394
nbarrett wants to merge 1 commit into
serenity-js:mainfrom
nbarrett:feat/hidden-and-silent-activities

Conversation

@nbarrett
Copy link
Copy Markdown
Contributor

What this adds

Ports the reporting markers from Serenity BDD (Java) so that control-flow and setup activities can opt out of reporting:

  • IsHidden: an activity's own step is omitted from the report, while the activities it performs are still reported. Check now implements IsHidden (matching Java's ConditionalPerformable), so a conditional no longer narrates its own "checks whether ..." step; only the branch it decides to perform is reported.
  • IsSilent: an activity's own step, and everything nested under it, are omitted from the report. Useful for setup or teardown activities whose reporting would only add noise. The isSilent() method lets silence be decided dynamically, mirroring Java's CanBeSilent.

PerformActivities honours both markers at the single point where activity domain events are announced, so the behaviour is consistent across every reporter (console, Serenity BDD, and any custom crew).

Motivation

Reports for scenarios that repeatedly dismiss cookie banners, or run instrumented setup/teardown, fill up with steps that add no value. Check in particular narrates a "checks whether ..." line for every conditional, even when the branch does nothing. In Serenity BDD (Java) ConditionalPerformable is IsHidden, so this brings the two products back in line.

Behaviour note

Check is hidden by default in this change, matching Java's ConditionalPerformable. That removes the conditional's own line from existing reports, leaving only the branch it performs. If you would rather keep current Check output and make hiding opt-in, I am happy to adjust so the markers ship without changing Check's default.

Tests

  • packages/core/spec/screenplay/reporting/reporting-markers.spec.ts: the isHidden / isSilent guards.
  • packages/core/spec/screenplay/questions/Check.spec.ts: asserts Check is hidden.

Related discussion

Ports the reporting markers from Serenity BDD (Java) so that control-flow
and setup activities can opt out of reporting.

- IsHidden: the activity's own step is omitted from the report, while the
  activities it performs are still reported. Check now implements IsHidden,
  matching Java's ConditionalPerformable, so a conditional no longer
  narrates its own "checks whether ..." step; only the branch it decides
  to perform is reported.
- IsSilent: the activity's own step, and everything nested under it, are
  omitted from the report. Useful for setup or teardown activities whose
  reporting would only add noise.

PerformActivities honours both markers at the single point where activity
domain events are announced, so the behaviour is consistent across every
reporter (console, Serenity BDD, and any custom crew).

Related tickets:
- serenity-bdd/serenity-core#669 (the Serenity BDD Java capability this mirrors)
- serenity-js#161
- serenity-js#365
- serenity-js#155
- serenity-js#159
@nbarrett
nbarrett force-pushed the feat/hidden-and-silent-activities branch from 1f62bc1 to bb357fe Compare July 11, 2026 09:29
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.

1 participant

0