79500831

Date: 2025-03-11 13:01:51
Score: 1.5
Natty:
Report link

I cannot add a comment to Vishal's answer, but it is a valid workaround!

I made a simple helper function:

export async function reportLog(test: any, title: string, ...args: string[]) {
    await test.step(title + ": " + args.join(", "), () => {});
}

Used like: await reportLog(test, "An arbitrary 'step' comment!", "This is a comment!");

Which outputs in the 'step' flow: Example output in the 'step' flow

Alternative ways to add info to the report is annotations, console.log, attachments (as shown by unickq) and expect.

Annotations put the info at the report head:

test.info().annotations.push({ type: 'Info', description: 'An annotation' });

Example of annotations

Whereas attachments and console.log() are added to the 'Attachments' box in the report foot.

Expect can be used if you want a 'failure' red X in the report, but the caveat is that it will also appear in your 'Errors' box.

expect.soft(true, "This is a good outcome!").toBeTruthy();
expect.soft(false, "This is a bad outcome!").toBeTruthy();

Will result as: Example of using 'Expect'

Reasons:
  • Blacklisted phrase (0.5): I cannot
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: KattenFodder