resetForRetry function

void resetForRetry(
  1. TestContext? ctx
)

Drops everything a previous attempt recorded — steps, comments, errors and attachments — so a retried test reports its final attempt only (plugin tier). The bind (test case id and result name) is kept.

Implementation

void resetForRetry(TestContext? ctx) {
  if (ctx == null) return;
  ctx._resultError = '';
  ctx._resultComment = '';
  discardPendingList(ctx._resultAttachments);
  ctx._resultAttachments.clear();
  ctx._nextStepId = 1;
  ctx._clearStepTrees();
}