Skip to content

Attach a plain text/log file to my cucumber test cases #2186

Discussion options

You must be logged in to vote

Hey @gitToSantosh,

As of Serenity/JS 3.15, the process to add custom attachments is not yet as obvious as I would have liked, so I'm planning to improve it in future releases.

Right now, you can use the actor.collect(artifact, name) API, and pass one of the Artifact implementations as the argument. Note that while the actor.collect is stable and won't change without a major release, artifact implementations are likely to get simplified over the coming months, so please watch this space.

Since you're interested in attaching text data, you'll need to use the actor.collect mehod as follows:

import { Name, TextData } from '@serenity-js/core/lib/model'

actor.collect(
  TextData.fromJSON({ con…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jan-molak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants